Update a couple buttons to use correct markup (#11926)

This commit is contained in:
Kris 2021-02-02 15:46:48 -05:00 committed by GitHub
parent e8b82724fd
commit 75d766499f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 6 deletions

View File

@ -22,6 +22,13 @@ export default Controller.extend(ModalFunctionality, {
});
},
@discourseComputed("username")
mergeButtonText(username) {
return I18n.t(`admin.user.merge.confirmation.transfer_and_delete`, {
username,
});
},
@discourseComputed("value", "text")
mergeDisabled(value, text) {
return !value || text !== value;

View File

@ -1,4 +1,5 @@
import Controller, { inject as controller } from "@ember/controller";
import I18n from "I18n";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import { action, get } from "@ember/object";
import { alias } from "@ember/object/computed";
@ -17,6 +18,13 @@ export default Controller.extend(ModalFunctionality, {
return !targetUsername || username === targetUsername;
},
@discourseComputed("username")
mergeButtonText(username) {
return I18n.t(`admin.user.merge.confirmation.transfer_and_delete`, {
username,
});
},
@action
showConfirmation() {
this.send("closeModal");

View File

@ -5,14 +5,13 @@
{{/d-modal-body}}
<div class="modal-footer">
{{#d-button
{{d-button
class="btn-danger"
action=(action "confirm")
icon="trash-alt"
disabled=mergeDisabled
translatedLabel=mergeButtonText
}}
{{i18n "admin.user.merge.confirmation.transfer_and_delete" username=username}}
{{/d-button}}
{{d-button
action=(action "close")
label="admin.user.merge.confirmation.cancel"

View File

@ -13,14 +13,13 @@
{{/d-modal-body}}
<div class="modal-footer">
{{#d-button
{{d-button
class="btn-primary"
action=(action "showConfirmation")
icon="trash-alt"
disabled=mergeDisabled
translatedLabel=mergeButtonText
}}
{{i18n "admin.user.merge.prompt.transfer_and_delete" username=username}}
{{/d-button}}
{{d-button
action=(action "close")
label="admin.user.merge.prompt.cancel"