mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 22:08:19 +08:00
use d-buttons, and other small tweaks
This commit is contained in:
@ -92,6 +92,14 @@ export default ObjectController.extend(CanCheckEmails, {
|
|||||||
self.get('model').revokeApiKey();
|
self.get('model').revokeApiKey();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
anonymize: function() {
|
||||||
|
this.get('model').anonymize();
|
||||||
|
},
|
||||||
|
|
||||||
|
destroy: function() {
|
||||||
|
this.get('model').destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,7 +336,6 @@ Discourse.AdminUser = Discourse.User.extend({
|
|||||||
var performAnonymize = function() {
|
var performAnonymize = function() {
|
||||||
Discourse.ajax("/admin/users/" + user.get('id') + '/anonymize.json', {type: 'PUT'}).then(function(data) {
|
Discourse.ajax("/admin/users/" + user.get('id') + '/anonymize.json', {type: 'PUT'}).then(function(data) {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
bootbox.alert(I18n.t("admin.user.anonymize_successful"));
|
|
||||||
if (data.username) {
|
if (data.username) {
|
||||||
document.location = "/admin/users/" + data.username;
|
document.location = "/admin/users/" + data.username;
|
||||||
} else {
|
} else {
|
||||||
|
@ -450,17 +450,27 @@
|
|||||||
|
|
||||||
<section>
|
<section>
|
||||||
<hr/>
|
<hr/>
|
||||||
<button {{bind-attr class=":btn :btn-danger :pull-right anonymizeForbidden:hidden"}} {{action "anonymize" target="content"}} {{bind-attr disabled="anonymizeForbidden"}}>
|
<div class="pull-right">
|
||||||
<i class="fa fa-exclamation-triangle"></i>
|
{{#unless anonymizeForbidden}}
|
||||||
{{i18n 'admin.user.anonymize'}}
|
{{d-button label="admin.user.anonymize"
|
||||||
</button>
|
icon="exclamation-triangle"
|
||||||
|
class="btn btn-danger"
|
||||||
|
disabled=anonymizeForbidden
|
||||||
|
action="anonymize"}}
|
||||||
|
{{/unless}}
|
||||||
|
|
||||||
|
{{#unless deleteForbidden}}
|
||||||
|
{{d-button label="admin.user.delete"
|
||||||
|
icon="exclamation-triangle"
|
||||||
|
class="btn btn-danger"
|
||||||
|
disabled=deleteForbidden
|
||||||
|
action="destroy"}}
|
||||||
|
{{/unless}}
|
||||||
|
</div>
|
||||||
|
|
||||||
<button {{bind-attr class=":btn :btn-danger :pull-right deleteForbidden:hidden"}} {{action "destroy" target="content"}} {{bind-attr disabled="deleteForbidden"}}>
|
|
||||||
<i class="fa fa-exclamation-triangle"></i>
|
|
||||||
{{i18n 'admin.user.delete'}}
|
|
||||||
</button>
|
|
||||||
{{#if deleteExplanation}}
|
{{#if deleteExplanation}}
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
<br/>
|
||||||
<div class="pull-right"><i class="fa fa-exclamation-triangle"></i> {{deleteExplanation}}</div>
|
<div class="pull-right"><i class="fa fa-exclamation-triangle"></i> {{deleteExplanation}}</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</section>
|
</section>
|
||||||
|
@ -2052,7 +2052,6 @@ en:
|
|||||||
anonymize: "Anonymize User"
|
anonymize: "Anonymize User"
|
||||||
anonymize_confirm: "Are you SURE you want to anonymize this account? This will change the username and email, and reset all profile information."
|
anonymize_confirm: "Are you SURE you want to anonymize this account? This will change the username and email, and reset all profile information."
|
||||||
anonymize_yes: "Yes, anonymize this account"
|
anonymize_yes: "Yes, anonymize this account"
|
||||||
anonymize_successful: "The user was anonymized successfully."
|
|
||||||
anonymize_failed: "There was a problem anonymizing the account."
|
anonymize_failed: "There was a problem anonymizing the account."
|
||||||
delete: "Delete User"
|
delete: "Delete User"
|
||||||
delete_forbidden_because_staff: "Admins and moderators can't be deleted."
|
delete_forbidden_because_staff: "Admins and moderators can't be deleted."
|
||||||
|
Reference in New Issue
Block a user