DEV: Update DButton uses (#23333)

1. Use `this.` instead of `{{action}}` where applicable
2. Use `{{fn}}` instead of `@actionParam` where applicable
3. Use non-`@` versions of class/type/tabindex/aria-controls/aria-expanded
4. Remove `btn` class (it's added automatically to all DButtons)
5. Remove `type="button"` (it's the default)
6. Use `concat-class` helper
This commit is contained in:
Jarek Radosz 2023-08-31 11:49:35 +02:00 committed by GitHub
parent e1ae32103d
commit 1c87bb7fe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
237 changed files with 998 additions and 1091 deletions

View File

@ -15,16 +15,12 @@
<div class="controls">
{{#if this.editing}}
<DButton
@class="btn-default"
@action={{action "save"}}
class="btn-default"
@action={{this.save}}
@label="admin.user_fields.save"
/>
<a href {{on "click" this.edit}}>{{i18n "cancel"}}</a>
{{else}}
<DButton
@class="btn-default"
@action={{action "edit"}}
@icon="pencil-alt"
/>
<DButton class="btn-default" @action={{this.edit}} @icon="pencil-alt" />
{{/if}}
</div>

View File

@ -2,7 +2,7 @@
<DButton
@action={{this.sortByLabel}}
@icon={{this.sortIcon}}
@class="sort-btn"
class="sort-btn"
/>
{{/if}}

View File

@ -76,9 +76,8 @@
{{#each this.pages as |pageState|}}
<DButton
@translatedLabel={{pageState.page}}
@action={{action "changePage"}}
@actionParam={{pageState.index}}
@class={{pageState.class}}
@action={{fn this.changePage pageState.index}}
class={{pageState.class}}
/>
{{/each}}
</div>

View File

@ -143,10 +143,9 @@
<div class="modes">
{{#each this.displayedModes as |displayedMode|}}
<DButton
@action={{action "onChangeMode"}}
@actionParam={{displayedMode.mode}}
@class={{displayedMode.cssClass}}
@action={{fn this.onChangeMode displayedMode.mode}}
@icon={{displayedMode.icon}}
class={{displayedMode.cssClass}}
/>
{{/each}}
</div>
@ -162,9 +161,9 @@
{{#each this.chartGroupings as |chartGrouping|}}
<DButton
@label={{chartGrouping.label}}
@action={{action "changeGrouping" chartGrouping.id}}
@class={{chartGrouping.class}}
@action={{fn this.changeGrouping chartGrouping.id}}
@disabled={{chartGrouping.disabled}}
class={{chartGrouping.class}}
/>
{{/each}}
</div>
@ -212,10 +211,10 @@
<div class="control">
<div class="input">
<DButton
@class="btn-default export-csv-btn"
@action={{action "exportCsv"}}
@action={{this.exportCsv}}
@label="admin.export_csv.button_text"
@icon="download"
class="btn-default export-csv-btn"
/>
</div>
</div>
@ -224,10 +223,10 @@
<div class="control">
<div class="input">
<DButton
@class="refresh-report-btn btn-primary"
@action={{action "refreshReport"}}
@action={{this.refreshReport}}
@label="admin.dashboard.reports.refresh_report"
@icon="sync"
class="refresh-report-btn btn-primary"
/>
</div>
</div>

View File

@ -83,14 +83,14 @@
@escape-press={{action "cancelAddField"}}
/>
<DButton
@class="ok"
@action={{action "addField" this.newFieldName}}
@action={{fn this.addField this.newFieldName}}
@icon="check"
class="ok"
/>
<DButton
@class="cancel"
@action={{action "cancelAddField"}}
@action={{this.cancelAddField}}
@icon="times"
class="cancel"
/>
{{else}}
<a href {{on "click" this.toggleAddField}} class="no-text">

View File

@ -57,16 +57,16 @@
<AdminFormRow>
<DButton
@action={{action "save"}}
@class="btn-primary save"
@action={{this.save}}
@icon="check"
@label="admin.user_fields.save"
class="btn-primary save"
/>
<DButton
@action={{action "cancel"}}
@class="btn-danger cancel"
@action={{this.cancel}}
@icon="times"
@label="admin.user_fields.cancel"
class="btn-danger cancel"
/>
</AdminFormRow>
{{else}}
@ -81,31 +81,28 @@
<div class="form-display field-type">{{this.fieldName}}</div>
<div class="form-element controls">
<DButton
@action={{action "edit"}}
@class="btn-default edit"
@action={{this.edit}}
@icon="pencil-alt"
@label="admin.user_fields.edit"
class="btn-default edit"
/>
<DButton
@action={{this.destroyAction}}
@actionParam={{this.userField}}
@class="btn-danger cancel"
@action={{fn this.destroyAction this.userField}}
@icon="far-trash-alt"
@label="admin.user_fields.delete"
class="btn-danger cancel"
/>
<DButton
@action={{this.moveUpAction}}
@actionParam={{this.userField}}
@class="btn-default"
@action={{fn this.moveUpAction this.userField}}
@icon="arrow-up"
@disabled={{this.cantMoveUp}}
class="btn-default"
/>
<DButton
@action={{this.moveDownAction}}
@actionParam={{this.userField}}
@class="btn-default"
@action={{fn this.moveDownAction this.userField}}
@icon="arrow-down"
@disabled={{this.cantMoveDown}}
class="btn-default"
/>
</div>
</div>

View File

@ -21,8 +21,8 @@
{{/if}}
<DButton
@label="admin.dashboard.new_features.dismiss"
@class="btn-default new-features-dismiss"
@action={{this.dismissNewFeatures}}
class="btn-default new-features-dismiss"
/>
</div>
{{/if}}

View File

@ -45,9 +45,9 @@
<p class="actions">
<DButton
@action={{this.refreshProblems}}
@class="btn-default"
@icon="sync"
@label="admin.dashboard.refresh_problems"
class="btn-default"
/>
{{i18n "admin.dashboard.last_checked"}}:
{{this.problemsTimestamp}}

View File

@ -35,10 +35,10 @@
<div class="admin-footer">
<div class="buttons">
<DButton
@action={{action "reset"}}
@action={{this.reset}}
@disabled={{this.resetDisabled}}
@class="btn-default"
@label="admin.customize.email_style.reset"
class="btn-default"
/>
</div>
</div>

View File

@ -29,15 +29,15 @@
<td class="editing-controls">
<DButton
@icon="check"
@action={{action "save"}}
@class="btn-primary"
@action={{this.save}}
@disabled={{this.cantSave}}
class="btn-primary"
/>
<DButton
@icon="times"
@action={{action "cancel"}}
@class="btn-danger"
@action={{this.cancel}}
@disabled={{this.host.isSaving}}
class="btn-danger"
/>
</td>
{{else}}
@ -56,11 +56,7 @@
{{category-badge this.host.category allowUncategorized=true}}
</td>
<td class="controls">
<DButton @icon="pencil-alt" @action={{action "edit"}} />
<DButton
@icon="far-trash-alt"
@action={{action "delete"}}
@class="btn-danger"
/>
<DButton @icon="pencil-alt" @action={{this.edit}} />
<DButton @icon="far-trash-alt" @action={{this.delete}} class="btn-danger" />
</td>
{{/if}}

View File

@ -3,11 +3,10 @@
{{#each this.collection as |data index|}}
<li class="value" data-index={{index}}>
<DButton
@action={{action "removeValue"}}
@actionParam={{data}}
@action={{fn this.removeValue data}}
@icon="times"
@class="remove-value-btn btn-small"
@disabled={{not data.isEditable}}
class="remove-value-btn btn-small"
/>
<div
@ -28,14 +27,14 @@
{{#if this.showUpDownButtons}}
<DButton
@action={{action "shift" -1 index}}
@action={{fn this.shift -1 index}}
@icon="arrow-up"
@class="shift-up-value-btn btn-small"
class="shift-up-value-btn btn-small"
/>
<DButton
@action={{action "shift" 1 index}}
@action={{fn this.shift 1 index}}
@icon="arrow-down"
@class="shift-down-value-btn btn-small"
class="shift-down-value-btn btn-small"
/>
{{/if}}
</li>
@ -45,11 +44,10 @@
<div class="value">
<DButton
@action={{action "editValue"}}
@actionParam={{this.data}}
@action={{fn this.editValue this.data}}
@icon="discourse-emojis"
@class="add-emoji-button d-editor-textarea-wrapper"
@label="admin.site_settings.emoji_list.add_emoji_button.label"
class="add-emoji-button d-editor-textarea-wrapper"
/>
</div>

View File

@ -17,26 +17,25 @@
</span>
{{#each this.quickInsertFields as |field|}}
<DButton
@class="btn-flat btn-icon-text quick-insert-{{field.type}}"
@icon={{field.icon}}
@label="admin.form_templates.quick_insert_fields.{{field.type}}"
@action={{this.onInsertField}}
@actionParam={{field.type}}
@action={{fn this.onInsertField field.type}}
class="btn-flat btn-icon-text quick-insert-{{field.type}}"
/>
{{/each}}
<DButton
class="btn-flat btn-icon-text form-templates__validations-modal-button"
@label="admin.form_templates.validations_modal.button_title"
@icon="check-circle"
@action={{this.showValidationOptionsModal}}
class="btn-flat btn-icon-text form-templates__validations-modal-button"
/>
</div>
<DButton
@class="form-templates__preview-button"
@icon="eye"
@label="admin.form_templates.new_template_form.preview"
@action={{this.showPreview}}
@disabled={{this.disablePreviewButton}}
class="form-templates__preview-button"
/>
</div>
@ -46,11 +45,11 @@
<div class="footer-buttons">
<DButton
@class="btn-primary"
@label="admin.form_templates.new_template_form.submit"
@icon="check"
@action={{this.onSubmit}}
@disabled={{this.disableSubmitButton}}
class="btn-primary"
/>
<DButton
@ -61,10 +60,10 @@
{{#if this.isEditing}}
<DButton
@class="btn-danger"
@label="admin.form_templates.view_template.delete"
@icon="trash-alt"
@action={{this.onDelete}}
class="btn-danger"
/>
{{/if}}
</div>

View File

@ -9,20 +9,20 @@
<DButton
@title="admin.form_templates.list_table.actions.view"
@icon="far-eye"
@class="btn-view-template"
@action={{fn (mut this.showViewTemplateModal) true}}
class="btn-view-template"
/>
<DButton
@title="admin.form_templates.list_table.actions.edit"
@icon="pencil-alt"
@class="btn-edit-template"
@action={{this.editTemplate}}
class="btn-edit-template"
/>
<DButton
@title="admin.form_templates.list_table.actions.delete"
@icon="far-trash-alt"
@class="btn-danger btn-delete-template"
@action={{this.deleteTemplate}}
class="btn-danger btn-delete-template"
/>
</td>
</tr>

View File

@ -4,13 +4,13 @@
</label>
{{#if this.changed}}
<DButton
@action={{action "apply"}}
@class="btn-primary btn-small submit-edit"
@action={{this.apply}}
@icon="check"
class="btn-primary btn-small submit-edit"
/>
<DButton
@action={{action "cancel"}}
@class="btn-small cancel-edit"
@action={{this.cancel}}
@icon="times"
class="btn-small cancel-edit"
/>
{{/if}}

View File

@ -1,9 +1,9 @@
{{#if this.ip}}
<DButton
@class="btn-default"
@action={{action "lookup"}}
@action={{this.lookup}}
@icon="globe"
@label="admin.user.ip_lookup"
class="btn-default"
/>
{{/if}}
{{#if this.show}}
@ -13,16 +13,12 @@
}}</a>
{{#if this.copied}}
<DButton
@class="btn-hover pull-right"
@icon="copy"
@label="ip_lookup.copied"
class="btn-hover pull-right"
/>
{{else}}
<DButton
@action={{action "copy"}}
@class="pull-right no-text"
@icon="copy"
/>
<DButton @action={{this.copy}} @icon="copy" class="pull-right no-text" />
{{/if}}
<h4>{{i18n "ip_lookup.title"}}</h4>
<p class="powered-by">{{html-safe (i18n "ip_lookup.powered_by")}}</p>
@ -61,13 +57,13 @@
<strong>{{this.totalOthersWithSameIP}}</strong>
{{#if this.other_accounts.length}}
<DButton
@class="btn-danger pull-right"
@action={{action "deleteOtherAccounts"}}
@action={{this.deleteOtherAccounts}}
@icon="exclamation-triangle"
@translatedLabel={{i18n
"ip_lookup.delete_other_accounts"
count=this.otherAccountsToDelete
}}
class="btn-danger pull-right"
/>
{{/if}}
</dt>

View File

@ -29,10 +29,10 @@
/>
<DButton
@action={{action "onSubmit"}}
@action={{this.onSubmit}}
@disabled={{this.formSubmitted}}
@class="permalink-add"
@label="admin.permalink.form.add"
class="permalink-add"
/>
</div>
</div>

View File

@ -15,9 +15,9 @@
/>
<DButton
@type="submit"
@class="btn-default"
@action={{action "submitForm"}}
@action={{this.submitForm}}
@disabled={{this.formSubmitted}}
@label="admin.logs.screened_ips.form.add"
type="submit"
class="btn-default"
/>

View File

@ -3,10 +3,9 @@
{{#each this.collection as |value index|}}
<div class="value" data-index={{index}}>
<DButton
@action={{action "removeValue"}}
@actionParam={{value}}
@action={{fn this.removeValue value}}
@icon="times"
@class="remove-value-btn btn-small"
class="remove-value-btn btn-small"
/>
<Input
@value={{value.key}}
@ -37,9 +36,9 @@
placeholder={{this.setting.placeholder.value}}
/>
<DButton
@action={{action "addValue"}}
@action={{this.addValue}}
@icon="plus"
@class="add-value-btn btn-small"
class="add-value-btn btn-small"
/>
</div>

View File

@ -3,10 +3,9 @@
{{#each this.collection as |value index|}}
<div data-index={{index}} class="value">
<DButton
@action={{action "removeValue"}}
@actionParam={{value}}
@action={{fn this.removeValue value}}
@icon="times"
@class="remove-value-btn btn-small"
class="remove-value-btn btn-small"
/>
<Input
@ -18,14 +17,14 @@
{{#if this.showUpDownButtons}}
<DButton
@action={{action "shift" -1 index}}
@action={{fn this.shift -1 index}}
@icon="arrow-up"
@class="shift-up-value-btn btn-small"
class="shift-up-value-btn btn-small"
/>
<DButton
@action={{action "shift" 1 index}}
@action={{fn this.shift 1 index}}
@icon="arrow-down"
@class="shift-down-value-btn btn-small"
class="shift-down-value-btn btn-small"
/>
{{/if}}
</div>
@ -45,10 +44,9 @@
/>
<DButton
@action={{action "addValue"}}
@actionParam={{this.newValue}}
@action={{fn this.addValue this.newValue}}
@disabled={{this.inputEmpty}}
@icon="plus"
@class="add-value-btn btn-small"
class="add-value-btn btn-small"
/>
</div>

View File

@ -1,7 +1,9 @@
<DButton
@label="admin.site_settings.uploaded_image_list.label"
@action={{action "showUploadModal"}}
@actionParam={{hash value=this.value setting=this.setting}}
@action={{fn
this.showUploadModal
(hash value=this.value setting=this.setting)
}}
/>
<div class="desc">{{html-safe this.setting.description}}</div>
<SettingValidationMessage @message={{this.validationMessage}} />

View File

@ -1,8 +1,7 @@
<DButton
@label="admin.site_text.edit"
@class="btn-default edit"
@action={{this.editAction}}
@actionParam={{this.siteText}}
@action={{fn this.editAction this.siteText}}
class="btn-default edit"
/>
<h3 class="site-text-id">{{this.siteText.id}}</h3>
<div class="site-text-value">{{this.siteText.value}}</div>

View File

@ -34,14 +34,14 @@
<DButton
@action={{this.upload}}
@disabled={{this.disabled}}
class="btn btn-primary"
@icon="upload"
@label="admin.customize.theme.upload"
class="btn-primary"
/>
<DButton
class="btn-flat d-modal-cancel"
@action={{@closeModal}}
@label="cancel"
class="btn-flat d-modal-cancel"
/>
</:footer>
</DModal>

View File

@ -1,20 +1,18 @@
<div class="themes-list-header">
<DButton
@action={{action "changeView"}}
@actionParam={{this.THEMES}}
@class={{concat "themes-tab " "tab " (if this.themesTabActive "active" "")}}
@action={{fn this.changeView this.THEMES}}
@label="admin.customize.theme.title"
class={{concat-class "themes-tab" "tab" (if this.themesTabActive "active")}}
/>
<DButton
@action={{action "changeView"}}
@actionParam={{this.COMPONENTS}}
@class={{concat
"components-tab "
"tab "
(if this.componentsTabActive "active" "")
}}
@action={{fn this.changeView this.COMPONENTS}}
@label="admin.customize.theme.components"
@icon="puzzle-piece"
class={{concat-class
"components-tab"
"tab"
(if this.componentsTabActive "active")
}}
/>
</div>
@ -74,6 +72,6 @@
@action={{this.installModal}}
@icon="upload"
@label="admin.customize.install"
@class="btn-primary"
class="btn-primary"
/>
</div>

View File

@ -3,10 +3,9 @@
{{#each this.collection as |value index|}}
<div data-index={{index}} class="value">
<DButton
@action={{action "removeValue"}}
@actionParam={{value}}
@action={{fn this.removeValue value}}
@icon="times"
@class="remove-value-btn btn-small"
class="remove-value-btn btn-small"
/>
<Input
@ -18,14 +17,14 @@
{{#if this.showUpDownButtons}}
<DButton
@action={{action "shift" -1 index}}
@action={{fn this.shift -1 index}}
@icon="arrow-up"
@class="shift-up-value-btn btn-small"
class="shift-up-value-btn btn-small"
/>
<DButton
@action={{action "shift" 1 index}}
@action={{fn this.shift 1 index}}
@icon="arrow-down"
@class="shift-down-value-btn btn-small"
class="shift-down-value-btn btn-small"
/>
{{/if}}
</div>

View File

@ -77,11 +77,11 @@
</div>
<DButton
@type="submit"
@class="btn btn-primary"
@action={{action "submitForm"}}
@action={{this.submitForm}}
@disabled={{this.submitDisabled}}
@label="admin.watched_words.form.add"
type="submit"
class="btn-primary"
/>
{{#if this.showMessage}}

View File

@ -40,12 +40,12 @@
{{/if}}
</div>
<DButton
@class="btn-primary"
@action={{action "massAward"}}
@type="submit"
@action={{this.massAward}}
@disabled={{this.massAwardButtonDisabled}}
@icon="certificate"
@label="admin.badges.mass_award.perform"
type="submit"
class="btn-primary"
/>
<LinkTo @route="adminBadges.index" class="btn btn-normal">
{{d-icon "times"}}

View File

@ -103,9 +103,9 @@
@onChange={{action (mut this.buffered.badge_grouping_id)}}
/>
<DButton
@class="btn-default"
@action={{route-action "editGroupings"}}
@icon="pencil-alt"
class="btn-default"
/>
</div>
</div>
@ -271,18 +271,18 @@
<div class="buttons">
<DButton
@class="btn-primary"
@action={{action "save"}}
@type="submit"
@action={{this.save}}
@disabled={{this.saving}}
@label="admin.badges.save"
type="submit"
class="btn-primary"
/>
<span class="saving">{{this.savingStatus}}</span>
{{#unless this.readOnly}}
<DButton
@action={{action "destroyBadge"}}
@class="btn-danger"
@action={{this.destroyBadge}}
@label="admin.badges.delete"
class="btn-danger"
/>
{{/unless}}
</div>

View File

@ -1,8 +1,8 @@
<DButton
@class="btn-primary"
@action={{route-action "new"}}
@icon="plus"
@label="admin.api.new_key"
class="btn-primary"
/>
{{#if this.model}}
@ -56,18 +56,16 @@
/>
{{#if k.revoked_at}}
<DButton
@action={{action "undoRevokeKey"}}
@actionParam={{k}}
@action={{fn this.undoRevokeKey k}}
@icon="undo"
@title="admin.api.undo_revoke"
/>
{{else}}
<DButton
@class="btn-danger"
@action={{action "revokeKey"}}
@actionParam={{k}}
@action={{fn this.revokeKey k}}
@icon="times"
@title="admin.api.revoke"
class="btn-danger"
/>
{{/if}}
</td>

View File

@ -15,8 +15,8 @@
<DButton
@icon="angle-right"
@label="admin.api.continue"
@action={{action "continue"}}
@class="btn-primary"
@action={{this.continue}}
class="btn-primary"
/>
</AdminFormRow>
{{else}}
@ -102,8 +102,8 @@
<td>
<DButton
@icon="link"
@action={{action "showURLs" act.urls}}
@class="btn-info"
@action={{fn this.showURLs act.urls}}
class="btn-info"
/>
</td>
<td>
@ -125,9 +125,9 @@
<DButton
@icon="check"
@label="admin.api.save"
@action={{action "save"}}
@class="btn-primary"
@action={{this.save}}
@disabled={{this.saveDisabled}}
class="btn-primary"
/>
{{/if}}
</div>

View File

@ -28,21 +28,17 @@
<div class="controls">
{{#if this.editingDescription}}
<DButton @action={{this.saveDescription}} @icon="check" class="ok" />
<DButton
@class="ok"
@action={{action "saveDescription"}}
@icon="check"
/>
<DButton
@class="cancel"
@action={{action "editDescription"}}
@action={{this.editDescription}}
@icon="times"
class="cancel"
/>
{{else}}
<DButton
@class="btn-default"
@action={{action "editDescription"}}
@action={{this.editDescription}}
@icon="pencil-alt"
class="btn-default"
/>
{{/if}}
</div>
@ -84,25 +80,22 @@
<div class="controls">
{{#if this.model.revoked_at}}
<DButton
@action={{action "undoRevokeKey"}}
@actionParam={{this.model}}
@action={{fn this.undoRevokeKey this.model}}
@icon="undo"
@label="admin.api.undo_revoke"
/>
<DButton
@action={{action "deleteKey"}}
@actionParam={{this.model}}
@action={{fn this.deleteKey this.model}}
@icon="trash-alt"
@label="admin.api.delete"
@class="btn-danger"
class="btn-danger"
/>
{{else}}
<DButton
@class="btn-danger"
@action={{action "revokeKey"}}
@actionParam={{this.model}}
@action={{fn this.revokeKey this.model}}
@icon="times"
@label="admin.api.revoke"
class="btn-danger"
/>
{{/if}}
</div>
@ -143,8 +136,8 @@
<td>
<DButton
@icon="link"
@action={{action "showURLs" scope.urls}}
@class="btn-info"
@action={{fn this.showURLs scope.urls}}
class="btn-info"
/>
</td>
<td>

View File

@ -10,21 +10,21 @@
{{#if this.site.isReadOnly}}
<DButton
@class="btn-default"
@icon="far-eye"
@action={{action "toggleReadOnlyMode"}}
@action={{this.toggleReadOnlyMode}}
@disabled={{this.status.isOperationRunning}}
@title="admin.backups.read_only.disable.title"
@label="admin.backups.read_only.disable.label"
class="btn-default"
/>
{{else}}
<DButton
@class="btn-default"
@icon="far-eye"
@action={{action "toggleReadOnlyMode"}}
@action={{this.toggleReadOnlyMode}}
@disabled={{this.status.isOperationRunning}}
@title="admin.backups.read_only.enable.title"
@label="admin.backups.read_only.enable.label"
class="btn-default"
/>
{{/if}}
<div class="backup-message">
@ -50,47 +50,42 @@
<td class="backup-controls">
<div>
<DButton
@class="btn-default download"
@action={{action "download"}}
@actionParam={{backup}}
@action={{fn this.download backup}}
@icon="download"
@title="admin.backups.operations.download.title"
@label="admin.backups.operations.download.label"
class="btn-default download"
/>
{{#if this.status.isOperationRunning}}
<DButton
@icon="far-trash-alt"
@action={{route-action "destroyBackup"}}
@actionParam={{backup}}
@class="btn-danger"
@action={{fn (route-action "destroyBackup") backup}}
@disabled="true"
@title="admin.backups.operations.is_running"
class="btn-danger"
/>
<DButton
@icon="play"
@action={{route-action "startRestore"}}
@actionParam={{backup}}
@action={{fn (route-action "startRestore") backup}}
@disabled={{this.status.restoreDisabled}}
@class="btn-default"
@title={{this.restoreTitle}}
@label="admin.backups.operations.restore.label"
class="btn-default"
/>
{{else}}
<DButton
@icon="far-trash-alt"
@action={{route-action "destroyBackup"}}
@actionParam={{backup}}
@class="btn-danger"
@action={{fn (route-action "destroyBackup") backup}}
@title="admin.backups.operations.destroy.title"
class="btn-danger"
/>
<DButton
@icon="play"
@action={{route-action "startRestore"}}
@actionParam={{backup}}
@action={{fn (route-action "startRestore") backup}}
@disabled={{this.status.restoreDisabled}}
@class="btn-default btn-restore"
@title={{this.restoreTitle}}
@label="admin.backups.operations.restore.label"
class="btn-default btn-restore"
/>
{{/if}}
</div>

View File

@ -12,28 +12,28 @@
{{#if this.model.canRollback}}
<DButton
@action={{route-action "rollback"}}
@class="btn-default btn-rollback"
@label="admin.backups.operations.rollback.label"
@title="admin.backups.operations.rollback.title"
@icon="ambulance"
@disabled={{this.rollbackDisabled}}
class="btn-default btn-rollback"
/>
{{/if}}
{{#if this.model.isOperationRunning}}
<DButton
@action={{route-action "cancelOperation"}}
@class="btn-danger"
@title="admin.backups.operations.cancel.title"
@label="admin.backups.operations.cancel.label"
@icon="times"
class="btn-danger"
/>
{{else}}
<DButton
@action={{route-action "showStartBackupModal"}}
@class="btn-primary"
@title="admin.backups.operations.backup.title"
@label="admin.backups.operations.backup.label"
@icon="rocket"
class="btn-primary"
/>
{{/if}}
</div>

View File

@ -7,23 +7,23 @@
<div class="controls">
{{#unless this.model.theme_id}}
<DButton
@class="btn-primary"
@action={{action "save"}}
@action={{this.save}}
@disabled={{this.model.disableSave}}
@label="admin.customize.save"
class="btn-primary"
/>
{{/unless}}
<DButton
@class="btn-default"
@action={{action "copy" this.model}}
@action={{fn this.copy this.model}}
@icon="copy"
@label="admin.customize.copy"
class="btn-default"
/>
<DButton
@class="btn-default copy-to-clipboard"
@action={{action "copyToClipboard" this.model}}
@action={{fn this.copyToClipboard this.model}}
@icon="far-clipboard"
@label="admin.customize.copy_to_clipboard"
class="btn-default copy-to-clipboard"
/>
<span
class="saving {{unless this.model.savingStatus 'hidden'}}"
@ -38,10 +38,10 @@
</span>
{{else}}
<DButton
@action={{action "destroy"}}
@class="btn-danger"
@action={{this.destroy}}
@icon="far-trash-alt"
@label="admin.customize.delete"
class="btn-danger"
/>
{{/if}}
</div>
@ -100,22 +100,24 @@
<td class="actions">
{{#unless this.model.theme_id}}
<DButton
@class={{concat
"btn-default revert "
(unless c.savedIsOverriden "invisible")
}}
@action={{action "revert" c}}
@action={{fn this.revert c}}
@title="admin.customize.colors.revert_title"
@label="admin.customize.colors.revert"
class={{concat-class
"btn-default"
"revert"
(unless c.savedIsOverriden "invisible")
}}
/>
<DButton
@class={{concat
"btn-default undo "
(unless c.changed "invisible")
}}
@action={{action "undo" c}}
@action={{fn this.undo c}}
@title="admin.customize.colors.undo_title"
@label="admin.customize.colors.undo"
class={{concat-class
"btn-default"
"undo"
(unless c.changed "invisible")
}}
/>
{{/unless}}
</td>

View File

@ -19,10 +19,10 @@
</ul>
<DButton
@class="btn-default"
@action={{action "newColorScheme"}}
@action={{this.newColorScheme}}
@icon="plus"
@label="admin.customize.new"
class="btn-default"
/>
</div>

View File

@ -7,10 +7,10 @@
<div class="admin-footer">
<div class="buttons">
<DButton
@action={{action "save"}}
@action={{this.save}}
@disabled={{this.saveDisabled}}
@class="btn-primary"
@translatedLabel={{this.saveButtonText}}
class="btn-primary"
/>
</div>
</div>

View File

@ -26,10 +26,10 @@
{{/if}}
<DButton
@class="btn-primary"
@label="admin.form_templates.new_template"
@title="admin.form_templates.new_template"
@icon="plus"
@action={{this.newTemplate}}
class="btn-primary"
/>
</div>

View File

@ -14,11 +14,11 @@
@saveDisabled={{this.saveDisabled}}
>
<DButton
@class="btn-default"
@disabled={{this.resetDisabled}}
@icon="undo"
@action={{action "reset"}}
@action={{this.reset}}
@label="admin.settings.reset"
class="btn-default"
/>
</SaveControls>
</div>

View File

@ -3,9 +3,9 @@
<div class="editor-information">
<DButton
@title="go_back"
@action={{action "goBack"}}
@action={{this.goBack}}
@icon="chevron-left"
@class="btn-small editor-back-button"
class="btn-small editor-back-button"
/>
<span class="editor-theme-name-wrapper">
@ -49,10 +49,10 @@
<div class="buttons">
<DButton
@action={{action "save"}}
@action={{this.save}}
@disabled={{this.saveDisabled}}
@class="btn-primary"
@translatedLabel={{this.saveButtonText}}
class="btn-primary"
/>
</div>
</div>

View File

@ -10,7 +10,7 @@
@action={{route-action "installModal"}}
@icon="upload"
@label="admin.customize.install"
@class="btn-primary"
class="btn-primary"
/>
</div>
<div class="external-resources">

View File

@ -10,21 +10,21 @@
{{#if this.editingName}}
<TextField @value={{this.model.name}} @autofocus="true" />
<DButton
@action={{action "finishedEditingName"}}
@class="btn-primary btn-small submit-edit"
@action={{this.finishedEditingName}}
@icon="check"
class="btn-primary btn-small submit-edit"
/>
<DButton
@action={{action "cancelEditingName"}}
@class="btn-small cancel-edit"
@action={{this.cancelEditingName}}
@icon="times"
class="btn-small cancel-edit"
/>
{{else}}
<span>{{this.model.name}}</span>
<DButton
@action={{action "startEditingName"}}
@action={{this.startEditingName}}
@icon="pencil-alt"
@class="btn-small"
class="btn-small"
/>
{{/if}}
</div>
@ -59,16 +59,16 @@
{{/if}}
<DButton
@action={{action "updateToLatest"}}
@action={{this.updateToLatest}}
@icon="download"
@class="btn-primary finish-install"
@label="admin.customize.theme.finish_install"
class="btn-primary finish-install"
/>
<DButton
@action={{action "destroyTheme"}}
@action={{this.destroyTheme}}
@label="admin.customize.delete"
@icon="trash-alt"
@class="btn-danger"
class="btn-danger"
/>
<span class="status-message">
@ -108,10 +108,10 @@
{{i18n "admin.customize.theme.disabled"}}
{{/if}}
<DButton
@class="btn-default"
@action={{action "enableComponent"}}
@action={{this.enableComponent}}
@icon="check"
@label="admin.customize.theme.enable"
class="btn-default"
/>
</div>
{{/unless}}
@ -181,17 +181,17 @@
{{#if this.model.remote_theme.commits_behind}}
<DButton
@action={{action "updateToLatest"}}
@action={{this.updateToLatest}}
@icon="download"
@class="btn-primary"
@label="admin.customize.theme.update_to_latest"
class="btn-primary"
/>
{{else}}
<DButton
@action={{action "checkForThemeUpdates"}}
@action={{this.checkForThemeUpdates}}
@icon="sync"
@class="btn-default"
@label="admin.customize.theme.check_for_updates"
class="btn-default"
/>
{{/if}}
@ -293,14 +293,14 @@
<div class="setting-controls">
{{#if this.colorSchemeChanged}}
<DButton
@action={{action "changeScheme"}}
@class="ok submit-edit"
@action={{this.changeScheme}}
@icon="check"
class="ok submit-edit"
/>
<DButton
@action={{action "cancelChangeScheme"}}
@class="cancel cancel-edit"
@action={{this.cancelChangeScheme}}
@icon="times"
class="cancel cancel-edit"
/>
{{/if}}
</div>
@ -349,9 +349,9 @@
{{/if}}
<DButton
@class="btn-default edit"
@action={{action "editTheme"}}
@action={{this.editTheme}}
@label="admin.customize.theme.edit_css_html"
class="btn-default edit"
/>
</div>
@ -369,10 +369,9 @@
>{{upload.filename}}</a></span>
<span class="col">
<DButton
@action={{action "removeUpload"}}
@actionParam={{upload}}
@class="second btn-default btn-default cancel-edit"
@action={{fn this.removeUpload upload}}
@icon="times"
class="second btn-default btn-default cancel-edit"
/>
</span>
</li>
@ -384,10 +383,10 @@
}}</div>
{{/if}}
<DButton
@action={{action "addUploadModal"}}
@class="btn-default"
@action={{this.addUploadModal}}
@icon="plus"
@label="admin.customize.theme.add"
class="btn-default"
/>
</div>
{{/unless}}
@ -471,48 +470,46 @@
{{#if this.showConvert}}
<DButton
@action={{action "switchType"}}
@action={{this.switchType}}
@label="admin.customize.theme.convert"
@icon={{this.convertIcon}}
@class="btn-default btn-normal"
@title={{this.convertTooltip}}
class="btn-default btn-normal"
/>
{{/if}}
{{#if this.model.component}}
{{#if this.model.enabled}}
<DButton
@class="btn-default"
@action={{action "disableComponent"}}
@action={{this.disableComponent}}
@icon="ban"
@label="admin.customize.theme.disable"
class="btn-default"
/>
{{else}}
<DButton
@class="btn-default"
@action={{action "enableComponent"}}
@action={{this.enableComponent}}
@icon="check"
@label="admin.customize.theme.enable"
class="btn-default"
/>
{{/if}}
{{/if}}
{{#if this.hasSettings}}
<DButton
@action={{this.showThemeSettingsEditor}}
@label="admin.customize.theme.settings_editor"
@icon="pen"
@class="btn-default btn-normal"
@title="admin.customize.theme.settings_editor"
class="btn-default btn-normal"
/>
{{/if}}
<DButton
@action={{action "destroyTheme"}}
@action={{this.destroyTheme}}
@label="admin.customize.delete"
@icon="trash-alt"
@class="btn-danger"
class="btn-danger"
/>
</div>
{{/if}}
</div>

View File

@ -26,11 +26,11 @@
@placeholderKey="admin.email.test_email_address"
/>
<DButton
@class="btn-primary"
@action={{action "sendTestEmail"}}
@action={{this.sendTestEmail}}
@disabled={{this.sendTestEmailDisabled}}
@label="admin.email.send_test"
@type="submit"
type="submit"
class="btn-primary"
/>
{{#if this.sentTestEmailMessage}}
<span class="result-message">{{this.sentTestEmailMessage}}</span>

View File

@ -12,9 +12,9 @@
@options={{hash maximum=1}}
/>
<DButton
@class="btn-primary digest-refresh-button"
@action={{action "refresh"}}
@action={{this.refresh}}
@label="admin.email.refresh"
class="btn-primary digest-refresh-button"
/>
<div class="toggle">
<label>{{i18n "admin.email.format"}}</label>
@ -51,10 +51,10 @@
@placeholderKey="admin.email.test_email_address"
/>
<DButton
@class="btn-default"
@action={{action "sendEmail"}}
@action={{this.sendEmail}}
@disabled={{this.sendEmailDisabled}}
@label="admin.email.send_digest"
class="btn-default"
/>
{{#if this.sentEmail}}
<span class="result-message">{{i18n

View File

@ -19,9 +19,9 @@
<DButton
@label="admin.embedding.add_host"
@action={{action "addHost"}}
@action={{this.addHost}}
@icon="plus"
@class="btn-primary add-host"
class="btn-primary add-host"
/>
</div>
@ -87,9 +87,9 @@
<div class="embedding-secondary">
<DButton
@label="admin.embedding.save"
@action={{action "saveChanges"}}
@class="btn-primary embed-save"
@action={{this.saveChanges}}
@disabled={{this.embedding.isSaving}}
class="btn-primary embed-save"
/>
{{#if this.saved}}{{i18n "saved"}}{{/if}}

View File

@ -41,9 +41,9 @@
<td>{{e.group}}</td>
<td class="action">
<DButton
@action={{action "destroyEmoji" e}}
@class="btn-danger"
@action={{fn this.destroyEmoji e}}
@icon="far-trash-alt"
class="btn-danger"
/>
</td>
</tr>

View File

@ -3,11 +3,11 @@
</p>
<DButton
@class="btn-default screened-email-export"
@action={{action "exportScreenedEmailList"}}
@action={{this.exportScreenedEmailList}}
@title="admin.export_csv.button_title.screened_email"
@icon="download"
@label="admin.export_csv.button_text"
class="btn-default screened-email-export"
/>
<br />
@ -47,8 +47,7 @@
<td class="ip_address">{{item.ip_address}}</td>
<td class="action">
<DButton
@action={{action "clearBlock"}}
@actionParam={{item}}
@action={{fn this.clearBlock item}}
@icon="check"
@label="admin.logs.screened_emails.actions.allow"
/>

View File

@ -10,11 +10,11 @@
@autocapitalize="off"
/>
<DButton
@class="btn-default"
@action={{action "exportScreenedIpList"}}
@action={{this.exportScreenedIpList}}
@icon="download"
@title="admin.export_csv.button_title.screened_ip"
@label="admin.export_csv.button_text"
class="btn-default"
/>
</div>
@ -83,44 +83,39 @@
<td class="col actions">
{{#if item.editing}}
<DButton
@class="btn-default"
@action={{action "save"}}
@actionParam={{item}}
@action={{fn this.save item}}
@label="admin.logs.save"
class="btn-default"
/>
<DButton
@class="btn-flat"
@action={{action "cancel" item}}
@action={{fn this.cancel item}}
@translatedLabel={{i18n "cancel"}}
class="btn-flat"
/>
{{else}}
<DButton
@class="btn-default btn-danger"
@action={{action "destroyRecord"}}
@actionParam={{item}}
@action={{fn this.destroyRecord item}}
@icon="far-trash-alt"
class="btn-default btn-danger"
/>
<DButton
@class="btn-default"
@action={{action "edit"}}
@actionParam={{item}}
@action={{fn this.edit item}}
@icon="pencil-alt"
class="btn-default"
/>
{{#if item.isBlocked}}
<DButton
@class="btn-default"
@action={{action "allow"}}
@actionParam={{item}}
@action={{fn this.allow item}}
@icon="check"
@label="admin.logs.screened_ips.actions.do_nothing"
class="btn-default"
/>
{{else}}
<DButton
@class="btn-default"
@action={{action "block"}}
@actionParam={{item}}
@action={{fn this.block item}}
@icon="ban"
@label="admin.logs.screened_ips.actions.block"
class="btn-default"
/>
{{/if}}
{{/if}}

View File

@ -2,11 +2,11 @@
{{i18n "admin.logs.screened_urls.description"}}
</p>
<DButton
@class="btn-default"
@action={{action "exportScreenedUrlList"}}
@action={{this.exportScreenedUrlList}}
@title="admin.export_csv.button_title.screened_url"
@icon="download"
@label="admin.export_csv.button_text"
class="btn-default"
/>
<br />

View File

@ -72,10 +72,10 @@
{{/if}}
<DButton
@class="btn-default"
@action={{action "exportStaffActionLogs"}}
@action={{this.exportStaffActionLogs}}
@label="admin.export_csv.button_text"
@icon="download"
class="btn-default"
/>
</div>

View File

@ -63,10 +63,9 @@
</td>
<td class="col action" style="text-align: right;">
<DButton
@action={{action "destroyRecord"}}
@actionParam={{pl}}
@action={{fn this.destroyRecord pl}}
@icon="far-trash-alt"
@class="btn-danger"
class="btn-danger"
/>
</td>
</tr>

View File

@ -1,11 +1,7 @@
<div class="admin-controls">
<div class="controls">
<div class="inline-form">
<DButton
@action={{action "toggleMenu"}}
@class="menu-toggle"
@icon="bars"
/>
<DButton @action={{this.toggleMenu}} @icon="bars" class="menu-toggle" />
<TextField
@id="setting-filter"
@value={{this.filter}}
@ -13,10 +9,10 @@
@class="no-blur"
/>
<DButton
@class="btn-default"
@id="clear-filter"
@action={{action "clearFilter"}}
@action={{this.clearFilter}}
@label="admin.site_settings.clear_filter"
id="clear-filter"
class="btn-default"
/>
</div>
</div>

View File

@ -16,9 +16,9 @@
<h5>{{i18n "admin.site_text.outdated.new_default"}}</h5>
<p>{{this.siteText.new_default}}</p>
<DButton
@class="btn-default"
@action={{action "dismissOutdated"}}
@action={{this.dismissOutdated}}
@label="admin.site_text.outdated.dismiss"
class="btn-default"
/>
</div>
{{/if}}
@ -43,9 +43,9 @@
>
{{#if this.siteText.can_revert}}
<DButton
@action={{action "revertChanges"}}
@action={{this.revertChanges}}
@label="admin.site_text.revert"
@class="revert-site-text"
class="revert-site-text"
/>
{{/if}}
</SaveControls>
@ -58,5 +58,4 @@
{{d-icon "arrow-left"}}
{{i18n "admin.site_text.go_back"}}
</LinkTo>
</div>

View File

@ -12,10 +12,10 @@
<div class="reseed">
<DButton
@action={{route-action "showReseedModal"}}
@class="btn-default"
@label="admin.reseed.action.label"
@title="admin.reseed.action.title"
@icon="sync"
class="btn-default"
/>
</div>

View File

@ -33,10 +33,10 @@
}}</small>
</div>
<DButton
@class="btn-primary"
@action={{this.performGrantBadge}}
@type="submit"
@label="admin.badges.grant"
type="submit"
class="btn-primary"
/>
</form>
{{/if}}
@ -71,14 +71,14 @@
<td>
{{#if userBadge.grouped}}
<DButton
@action={{action "expandGroup" userBadge}}
@action={{fn this.expandGroup userBadge}}
@label="admin.badges.expand"
/>
{{else}}
<DButton
@class="btn-danger"
@action={{action "revokeBadge" userBadge}}
@action={{fn this.revokeBadge userBadge}}
@label="admin.badges.revoke"
class="btn-danger"
/>
{{/if}}
</td>

View File

@ -10,19 +10,18 @@
@fieldTypes={{this.fieldTypes}}
@firstField={{this.firstField}}
@lastField={{this.lastField}}
@destroyAction={{action "destroyField"}}
@moveUpAction={{action "moveUp"}}
@moveDownAction={{action "moveDown"}}
@destroyAction={{this.destroyField}}
@moveUpAction={{this.moveUp}}
@moveDownAction={{this.moveDown}}
/>
{{/each}}
{{/if}}
<DButton
@disabled={{this.createDisabled}}
@class="btn-primary"
@action={{action "createField"}}
@action={{this.createField}}
@label="admin.user_fields.create"
@icon="plus"
class="btn-primary"
/>
</div>

View File

@ -9,20 +9,19 @@
{{#if this.model.can_view_action_logs}}
<DButton
@action={{action "viewActionLogs"}}
@class="btn-default"
@actionParam={{this.model.username}}
@action={{fn this.viewActionLogs this.model.username}}
@icon="far-list-alt"
@label="admin.user.action_logs"
class="btn-default"
/>
{{/if}}
{{#if this.model.active}}
{{#if this.currentUser.admin}}
<DButton
@class="btn-default"
@action={{action "logOut"}}
@action={{this.logOut}}
@icon="power-off"
@label="admin.user.log_out"
class="btn-default"
/>
{{/if}}
{{/if}}
@ -66,12 +65,11 @@
<a href="mailto:{{this.model.email}}">{{this.model.email}}</a>
{{else}}
<DButton
@class="btn-default"
@action={{route-action "checkEmail"}}
@actionParam={{this.model}}
@action={{fn (route-action "checkEmail") this.model}}
@icon="envelope"
@label="admin.users.check_email.text"
@title="admin.users.check_email.title"
class="btn-default"
/>
{{/if}}
</div>
@ -102,12 +100,11 @@
{{/if}}
{{else}}
<DButton
@action={{route-action "checkEmail"}}
@class="btn-default"
@actionParam={{this.model}}
@action={{fn (route-action "checkEmail") this.model}}
@icon="envelope"
@label="admin.users.check_email.text"
@title="admin.users.check_email.title"
class="btn-default"
/>
{{/if}}
</div>
@ -135,10 +132,10 @@
<div class="controls">
{{#if this.model.canResetBounceScore}}
<DButton
@class="btn-default"
@action={{action "resetBounceScore"}}
@action={{this.resetBounceScore}}
@label="admin.user.reset_bounce_score.label"
@title="admin.user.reset_bounce_score.title"
class="btn-default"
/>
{{/if}}
{{this.model.bounceScoreExplanation}}
@ -152,12 +149,11 @@
{{this.associatedAccounts}}
{{else}}
<DButton
@class="btn-default"
@action={{route-action "checkEmail"}}
@actionParam={{this.model}}
@action={{fn (route-action "checkEmail") this.model}}
@icon="envelope"
@label="admin.users.check_email.text"
@title="admin.users.check_email.title"
class="btn-default"
/>
{{/if}}
</div>
@ -235,10 +231,10 @@
<div class="controls">
{{#if this.canDisableSecondFactor}}
<DButton
@class="btn-default"
@action={{action "disableSecondFactor"}}
@action={{this.disableSecondFactor}}
@icon="unlock-alt"
@label="user.second_factor.disable"
class="btn-default"
/>
{{/if}}
</div>
@ -295,10 +291,10 @@
{{else}}
{{#if this.model.can_approve}}
<DButton
@class="btn-default"
@action={{action "approve"}}
@action={{this.approve}}
@icon="check"
@label="admin.user.approve"
class="btn-default"
/>
{{/if}}
{{/if}}
@ -313,27 +309,27 @@
{{#if this.model.active}}
{{#if this.model.can_deactivate}}
<DButton
@class="btn-default"
@action={{action "deactivate"}}
@action={{this.deactivate}}
@label="admin.user.deactivate_account"
class="btn-default"
/>
{{i18n "admin.user.deactivate_explanation"}}
{{/if}}
{{else}}
{{#if this.model.can_send_activation_email}}
<DButton
@class="btn-default"
@action={{action "sendActivationEmail"}}
@action={{this.sendActivationEmail}}
@icon="envelope"
@label="admin.user.send_activation_email"
class="btn-default"
/>
{{/if}}
{{#if this.model.can_activate}}
<DButton
@class="btn-default"
@action={{action "activate"}}
@action={{this.activate}}
@icon="check"
@label="admin.user.activate"
class="btn-default"
/>
{{/if}}
{{/if}}
@ -354,9 +350,9 @@
</div>
<div class="controls">
<DButton
@class="btn-default"
@href="/admin/api/keys"
@label="admin.api.manage_keys"
class="btn-default"
/>
</div>
</div>
@ -368,18 +364,18 @@
<div class="controls">
{{#if this.model.can_revoke_admin}}
<DButton
@class="btn-default"
@action={{action "revokeAdmin"}}
@action={{this.revokeAdmin}}
@icon="shield-alt"
@label="admin.user.revoke_admin"
class="btn-default"
/>
{{/if}}
{{#if this.model.can_grant_admin}}
<DButton
@class="btn-default grant-admin"
@action={{action "grantAdmin"}}
@action={{this.grantAdmin}}
@icon="shield-alt"
@label="admin.user.grant_admin"
class="btn-default grant-admin"
/>
{{/if}}
</div>
@ -391,18 +387,18 @@
<div class="controls">
{{#if this.model.can_revoke_moderation}}
<DButton
@class="btn-default"
@action={{action "revokeModeration"}}
@action={{this.revokeModeration}}
@icon="shield-alt"
@label="admin.user.revoke_moderation"
class="btn-default"
/>
{{/if}}
{{#if this.model.can_grant_moderation}}
<DButton
@class="btn-default"
@action={{action "grantModeration"}}
@action={{this.grantModeration}}
@icon="shield-alt"
@label="admin.user.grant_moderation"
class="btn-default"
/>
{{/if}}
</div>
@ -421,14 +417,14 @@
{{#if this.model.dirty}}
<div>
<DButton
@class="ok no-text"
@action={{action "saveTrustLevel"}}
@action={{this.saveTrustLevel}}
@icon="check"
class="ok no-text"
/>
<DButton
@class="cancel no-text"
@action={{action "restoreTrustLevel"}}
@action={{this.restoreTrustLevel}}
@icon="times"
class="cancel no-text"
/>
</div>
{{/if}}
@ -438,18 +434,16 @@
{{#if this.hasLockedTrustLevel}}
{{d-icon "lock" title="admin.user.trust_level_locked_tip"}}
<DButton
@class="btn-default"
@action={{action "lockTrustLevel"}}
@actionParam={{false}}
@action={{fn this.lockTrustLevel false}}
@label="admin.user.unlock_trust_level"
class="btn-default"
/>
{{else}}
{{d-icon "unlock" title="admin.user.trust_level_unlocked_tip"}}
<DButton
@class="btn-default"
@action={{action "lockTrustLevel"}}
@actionParam={{true}}
@action={{fn this.lockTrustLevel true}}
@label="admin.user.lock_trust_level"
class="btn-default"
/>
{{/if}}
{{/if}}
@ -484,19 +478,19 @@
<div class="controls">
{{#if this.model.suspended}}
<DButton
@class="btn-danger unsuspend-user"
@action={{action "unsuspend"}}
@action={{this.unsuspend}}
@icon="ban"
@label="admin.user.unsuspend"
class="btn-danger unsuspend-user"
/>
{{i18n "admin.user.suspended_explanation"}}
{{else}}
{{#if this.model.canSuspend}}
<DButton
@class="btn-danger suspend-user"
@action={{action "showSuspendModal"}}
@action={{this.showSuspendModal}}
@icon="ban"
@label="admin.user.suspend"
class="btn-danger suspend-user"
/>
{{i18n "admin.user.suspended_explanation"}}
{{/if}}
@ -542,18 +536,18 @@
>
{{#if this.model.silenced}}
<DButton
@class="btn-danger unsilence-user"
@action={{action "unsilence"}}
@action={{this.unsilence}}
@icon="microphone-slash"
@label="admin.user.unsilence"
class="btn-danger unsilence-user"
/>
{{i18n "admin.user.silence_explanation"}}
{{else}}
<DButton
@class="btn-danger silence-user"
@action={{action "showSilenceModal"}}
@action={{this.showSilenceModal}}
@icon="microphone-slash"
@label="admin.user.silence"
class="btn-danger silence-user"
/>
{{i18n "admin.user.silence_explanation"}}
{{/if}}
@ -589,9 +583,9 @@
<div class="controls">
<DButton
@label="admin.user.clear_penalty_history.title"
@class="btn-default"
@icon="times"
@action={{action "clearPenaltyHistory"}}
@action={{this.clearPenaltyHistory}}
class="btn-default"
/>
{{i18n "admin.user.clear_penalty_history.description"}}
</div>
@ -620,15 +614,11 @@
</div>
{{#if this.customGroupsDirty}}
<div class="controls">
<DButton
@icon="check"
@class="ok"
@action={{action "saveCustomGroups"}}
/>
<DButton @icon="check" @action={{this.saveCustomGroups}} class="ok" />
<DButton
@icon="times"
@class="cancel"
@action={{action "resetCustomGroups"}}
@action={{this.resetCustomGroups}}
class="cancel"
/>
</div>
{{/if}}
@ -648,13 +638,13 @@
<div class="controls">
<DButton
@icon="check"
@class="ok"
@action={{action "savePrimaryGroup"}}
@action={{this.savePrimaryGroup}}
class="ok"
/>
<DButton
@icon="times"
@class="cancel"
@action={{action "resetPrimaryGroup"}}
@action={{this.resetPrimaryGroup}}
class="cancel"
/>
</div>
{{/if}}
@ -701,10 +691,10 @@
{{#if this.model.can_delete_all_posts}}
{{#if this.model.post_count}}
<DButton
@class="btn-danger"
@action={{action "showDeletePostsConfirmation"}}
@action={{this.showDeletePostsConfirmation}}
@icon="far-trash-alt"
@label="admin.user.delete_posts.button"
class="btn-danger"
/>
{{/if}}
{{else}}
@ -789,10 +779,10 @@
{{#if this.model.can_delete_sso_record}}
<div class="controls">
<DButton
@class="btn-danger"
@action={{action "deleteSSORecord"}}
@action={{this.deleteSSORecord}}
@icon="far-trash-alt"
@label="admin.user.discourse_connect.delete_sso_record"
class="btn-danger"
/>
</div>
{{/if}}
@ -818,12 +808,11 @@
<div class="value">{{this.ssoExternalEmail}}</div>
{{else}}
<DButton
@class="btn-default"
@action={{action "checkSsoEmail"}}
@actionParam={{this.model}}
@action={{fn this.checkSsoEmail this.model}}
@icon="envelope"
@label="admin.users.check_email.text"
@title="admin.users.check_email.title"
class="btn-default"
/>
{{/if}}
</div>
@ -847,12 +836,11 @@
</div>
{{else}}
<DButton
@class="btn-default"
@action={{action "checkSsoPayload"}}
@actionParam={{this.model}}
@action={{fn this.checkSsoPayload this.model}}
@icon="far-list-alt"
@label="admin.users.check_sso.text"
@title="admin.users.check_sso.title"
class="btn-default"
/>
{{/if}}
</div>
@ -875,11 +863,11 @@
{{#if this.model.active}}
{{#if this.model.can_impersonate}}
<DButton
@class="btn-danger btn-impersonate"
@action={{action "impersonate"}}
@action={{this.impersonate}}
@icon="crosshairs"
@label="admin.impersonate.title"
@title="admin.impersonate.help"
class="btn-danger btn-impersonate"
/>
{{/if}}
{{/if}}
@ -888,8 +876,8 @@
<DButton
@label="admin.user.anonymize"
@icon="exclamation-triangle"
@class="btn-danger btn-anonymize"
@action={{action "anonymize"}}
@action={{this.anonymize}}
class="btn-danger btn-anonymize"
/>
{{/if}}
@ -897,8 +885,8 @@
<DButton
@label="admin.user.delete"
@icon="trash-alt"
@class="btn-danger btn-user-delete"
@action={{action "destroyUser"}}
@action={{this.destroyUser}}
class="btn-danger btn-user-delete"
/>
{{/if}}
@ -906,8 +894,8 @@
<DButton
@label="admin.user.merge.button"
@icon="arrows-alt-h"
@class="btn-danger btn-user-merge"
@action={{action "promptTargetUser"}}
@action={{this.promptTargetUser}}
class="btn-danger btn-user-merge"
/>
{{/if}}
</div>

View File

@ -5,15 +5,15 @@
{{#if this.canCheckEmails}}
{{#if this.showEmails}}
<DButton
@action={{action "toggleEmailVisibility"}}
@class="hide-emails btn-default"
@action={{this.toggleEmailVisibility}}
@label="admin.users.hide_emails"
class="hide-emails btn-default"
/>
{{else}}
<DButton
@action={{action "toggleEmailVisibility"}}
@class="show-emails btn-default"
@action={{this.toggleEmailVisibility}}
@label="admin.users.show_emails"
class="show-emails btn-default"
/>
{{/if}}
{{/if}}
@ -32,7 +32,6 @@
@action={{action "loadMore"}}
>
{{#if this.model}}
<ResponsiveTable
@className="users-list"
@aria-label={{this.title}}
@ -45,7 +44,6 @@
}}
@updates={{this.model.email}}
>
<:header>
<TableHeaderToggle
@class="directory-table__column-header--username"
@ -271,7 +269,6 @@
</div>
{{/each}}
</:body>
</ResponsiveTable>
<ConditionalLoadingSpinner @condition={{this.refreshing}} />

View File

@ -43,21 +43,21 @@
<li class="admin-actions">
{{#if this.currentUser.can_invite_to_forum}}
<DButton
@class="btn-flat"
@action={{route-action "sendInvites"}}
@title="admin.invite.button_title"
@icon="user-plus"
@label="admin.invite.button_text"
class="btn-flat"
/>
{{/if}}
{{#if this.currentUser.admin}}
<DButton
@class="btn-flat"
@action={{route-action "exportUsers"}}
@title="admin.export_csv.button_title.user"
@icon="download"
@label="admin.export_csv.button_text"
class="btn-flat"
/>
{{/if}}
</li>

View File

@ -4,10 +4,10 @@
<div class="watched-word-controls">
<DButton
@class="btn-default download-link"
@href={{this.downloadLink}}
@icon="download"
@label="admin.watched_words.download"
class="btn-default download-link"
/>
<WatchedWordUploader
@ -18,17 +18,17 @@
/>
<DButton
@class="watched-word-test"
@label="admin.watched_words.test.button_label"
@icon="far-eye"
@action={{action "test"}}
@action={{this.test}}
class="watched-word-test"
/>
<DButton
@class="btn-danger clear-all"
@label="admin.watched_words.clear_all"
@icon="trash-alt"
@action={{action "clearAll"}}
@action={{this.clearAll}}
class="btn-danger clear-all"
/>
</div>

View File

@ -2,18 +2,14 @@
<div class="admin-controls">
<div class="controls">
<div class="inline-form">
<DButton
@action={{action "toggleMenu"}}
@class="menu-toggle"
@icon="bars"
/>
<DButton @action={{this.toggleMenu}} @icon="bars" class="menu-toggle" />
<TextField
@value={{this.filter}}
@placeholderKey="admin.watched_words.search"
@class="no-blur"
/>
<DButton
@action={{action "clearFilter"}}
@action={{this.clearFilter}}
@label="admin.watched_words.clear_filter"
/>
</div>

View File

@ -147,9 +147,9 @@
<div class="controls">
<DButton
@translatedLabel={{this.saveButtonText}}
@action={{action "save"}}
@action={{this.save}}
@disabled={{this.saveButtonDisabled}}
@class="btn-primary admin-webhooks__save-button"
class="btn-primary admin-webhooks__save-button"
/>
{{#if this.model.isNew}}

View File

@ -51,11 +51,10 @@
</LinkTo>
<DButton
@class="destroy btn-danger"
@action={{this.destroy}}
@actionParam={{webhook}}
@action={{fn this.destroy webhook}}
@icon="times"
@title="delete"
class="destroy btn-danger"
/>
</td>
</tr>

View File

@ -10,8 +10,8 @@
<DButton
@action={{this.edit}}
@icon="far-edit"
title={{i18n "admin.web_hooks.edit"}}
class="btn no-text admin-webhooks__edit-button"
@title={{i18n "admin.web_hooks.edit"}}
class="no-text admin-webhooks__edit-button"
/>
<DButton

View File

@ -14,8 +14,8 @@
<DButton
@icon="times"
@action={{action this.dialog.cancel}}
@class="btn-flat dialog-close close"
@title="modal.close"
class="btn-flat dialog-close close"
/>
</div>
{{/if}}
@ -37,23 +37,23 @@
{{#each this.dialog.buttons as |button|}}
<DButton
@icon={{button.icon}}
@class={{button.class}}
@action={{action "handleButtonAction" button}}
@action={{fn this.handleButtonAction button}}
@translatedLabel={{button.label}}
class={{button.class}}
/>
{{else}}
<DButton
@class={{this.dialog.confirmButtonClass}}
@disabled={{this.dialog.confirmButtonDisabled}}
@action={{this.dialog.didConfirmWrapped}}
@icon={{this.dialog.confirmButtonIcon}}
@label={{this.dialog.confirmButtonLabel}}
class={{this.dialog.confirmButtonClass}}
/>
{{#if this.dialog.shouldDisplayCancel}}
<DButton
@class={{this.dialog.cancelButtonClass}}
@action={{this.dialog.cancel}}
@label={{this.dialog.cancelButtonLabel}}
class={{this.dialog.cancelButtonClass}}
/>
{{/if}}
{{/each}}

View File

@ -3,7 +3,7 @@
@action={{this.sendActivationEmail}}
@label="login.resend_title"
@icon="envelope"
@class="btn-primary resend"
class="btn-primary resend"
/>
{{/unless}}
@ -12,6 +12,6 @@
@action={{this.editActivationEmail}}
@label="login.change_email"
@icon="pencil-alt"
@class="edit-email"
class="edit-email"
/>
{{/if}}

View File

@ -9,10 +9,10 @@
<div class="controls">
<DButton
@action={{action "copyToClipboard"}}
@class="btn-default backup-codes-copy-btn"
@icon="copy"
@aria-label="user.second_factor_backup.copy_to_clipboard"
@ariaLabel="user.second_factor_backup.copy_to_clipboard"
@title="user.second_factor_backup.copy_to_clipboard"
class="btn-default backup-codes-copy-btn"
/>
<a

View File

@ -8,13 +8,12 @@
{{#if this.isFavorite}}
<DButton
@icon="star"
@class="favorite-btn"
@action={{this.onFavoriteClick}}
class="favorite-btn"
/>
{{else}}
<DButton
@icon="far-star"
@class="favorite-btn"
@action={{this.onFavoriteClick}}
@title={{if
this.canFavoriteMoreBadges
@ -22,6 +21,7 @@
"badges.favorite_max_reached"
}}
@disabled={{not this.canFavoriteMoreBadges}}
class="favorite-btn"
/>
{{/if}}
{{/if}}

View File

@ -21,10 +21,10 @@
<div class="control-group">
<div class="controls">
<DButton
@class="btn-primary"
@action={{action "saveBadgeTitle"}}
@action={{this.saveBadgeTitle}}
@disabled={{this._isSaving}}
@label={{if this._isSaving "saving" "save"}}
class="btn-primary"
/>
{{#if this._isSaved}}
<span>{{i18n "saved"}}</span>

View File

@ -5,21 +5,21 @@
</a>
</span>
<span class="options actionable">
<DButton @icon="check-square" @class="btn btn-flat see" @disabled={{true}} />
<DButton @icon="check-square" @disabled={{true}} class="btn-flat see" />
<DButton
@icon={{this.canReplyIcon}}
@action={{action "setPermissionReply"}}
@translatedTitle={{this.replyTooltip}}
@class={{concat "btn btn-flat reply-toggle " this.replyGranted}}
@disabled={{this.replyDisabled}}
class={{concat-class "btn btn-flat reply-toggle" this.replyGranted}}
/>
<DButton
@icon={{this.canCreateIcon}}
@action={{action "setPermissionFull"}}
@translatedTitle={{this.createTooltip}}
@class={{concat "btn btn-flat create-toggle " this.createGranted}}
@disabled={{this.createDisabled}}
class={{concat-class "btn-flat create-toggle" this.createGranted}}
/>
</span>

View File

@ -141,9 +141,9 @@
@recipients={{this.composer.model.targetRecipients}}
@hasGroups={{this.composer.model.hasTargetGroups}}
@focusTarget={{this.composer.focusTarget}}
@class={{concat
@class={{concat-class
"users-input"
(if this.composer.showWarning " can-warn")
(if this.composer.showWarning "can-warn")
}}
/>
{{#if this.composer.showWarning}}
@ -322,9 +322,9 @@
{{#if this.composer.showPreview}}
<DButton
@action={{this.composer.togglePreview}}
@class="hide-preview"
@ariaLabel="composer.hide_preview"
@icon="pencil-alt"
class="hide-preview"
/>
{{/if}}
{{/if}}
@ -384,8 +384,8 @@
@action={{this.composer.togglePreview}}
@translatedTitle={{this.composer.toggleText}}
@icon="angle-double-left"
@class={{concat
"btn-flat btn-mini-toggle toggle-preview "
@class={{concat-class
"btn-flat btn-mini-toggle toggle-preview"
(unless this.composer.showPreview "active")
}}
/>

View File

@ -5,27 +5,27 @@
{{#if this.site.mobileView}}
<DButton
@class="btn-flat toggle-toolbar btn-mini-toggle"
@icon="bars"
@action={{this.toggleToolbar}}
@title={{this.toggleToolbarTitle}}
@preventFocus={{true}}
class="btn-flat toggle-toolbar btn-mini-toggle"
/>
{{/if}}
{{#if this.showFullScreenButton}}
<DButton
@class="btn-flat toggle-fullscreen btn-mini-toggle"
@icon={{this.fullscreenIcon}}
@action={{this.toggleFullscreen}}
@title={{this.fullscreenTitle}}
class="btn-flat toggle-fullscreen btn-mini-toggle"
/>
{{/if}}
<DButton
@class="btn-flat toggler toggle-minimize btn-mini-toggle"
@icon={{this.toggleIcon}}
@action={{this.toggleComposer}}
@title={{this.toggleTitle}}
class="btn-flat toggler toggle-minimize btn-mini-toggle"
/>
</div>

View File

@ -1,5 +1,5 @@
<DButton
@class={{this.copyClass}}
@icon={{this.copyIcon}}
@action={{action "copy"}}
@action={{this.copy}}
class={{this.copyClass}}
/>

View File

@ -1,11 +1,11 @@
{{#if this.canCreateTopic}}
<DButton
@class={{this.btnClass}}
@id="create-topic"
@action={{this.action}}
@icon="plus"
@disabled={{this.disabled}}
@label={{this.label}}
id="create-topic"
class={{this.btnClass}}
/>
{{yield}}
{{/if}}

View File

@ -41,16 +41,14 @@
/>
{{else}}
<DButton
@action={{b.action}}
@type="button"
@actionParam={{b}}
@action={{fn (action b.action) b}}
@translatedTitle={{b.title}}
@label={{b.label}}
@icon={{b.icon}}
@class={{b.className}}
@preventFocus={{b.preventFocus}}
@tabindex={{b.tabindex}}
@onKeyDown={{this.rovingButtonBar}}
tabindex={{b.tabindex}}
class={{b.className}}
/>
{{/if}}
{{/each}}

View File

@ -7,11 +7,11 @@
>
{{#if @shouldDisplayMainImageArrows}}
<DButton
@class="d-lightbox__previous-button btn-flat"
{{on "click" @showPreviousItem passive=true capture=true}}
@title="experimental_lightbox.buttons.previous"
@icon={{@previousButtonIcon}}
@ariaHidden="true"
{{on "click" @showPreviousItem passive=true capture=true}}
class="d-lightbox__previous-button btn-flat"
/>
{{/if}}
{{#if @isLoading}}
@ -21,10 +21,10 @@
{{else if @hasLoadingError}}
<span class="d-lightbox__error-message">
<DButton
@class="d-lightbox__retry-button btn-flat"
{{on "click" @reloadImage passive=true capture=true}}
@title="experimental_lightbox.buttons.redo"
@icon="redo"
{{on "click" @reloadImage passive=true capture=true}}
class="d-lightbox__retry-button btn-flat"
/>
<span>{{i18n "experimental_lightbox.image_load_error"}}</span>
</span>
@ -49,11 +49,11 @@
{{/if}}
{{#if @shouldDisplayMainImageArrows}}
<DButton
@class="d-lightbox__next-button btn-flat"
{{on "click" @showNextItem passive=true capture=true}}
@title="experimental_lightbox.buttons.next"
@icon={{@nextButtonIcon}}
@ariaHidden="true"
{{on "click" @showNextItem passive=true capture=true}}
class="d-lightbox__next-button btn-flat"
/>
{{/if}}
</div>

View File

@ -1,11 +1,11 @@
<div class="d-lightbox__carousel">
{{#if @shouldDisplayCarouselArrows}}
<DButton
@class="d-lightbox__carousel-previous-button btn-flat"
{{on "click" @showPreviousItem passive=true capture=true}}
@title="experimental_lightbox.buttons.previous"
@icon={{@previousButtonIcon}}
@ariaHidden="true"
{{on "click" @showPreviousItem passive=true capture=true}}
class="d-lightbox__carousel-previous-button btn-flat"
/>
{{/if}}
<div
@ -39,11 +39,11 @@
</div>
{{#if @shouldDisplayCarouselArrows}}
<DButton
@class="d-lightbox__carousel-next-button btn-flat"
{{on "click" @showNextItem passive=true capture=true}}
@title="experimental_lightbox.buttons.next"
@icon={{@nextButtonIcon}}
@ariaHidden="true"
{{on "click" @showNextItem passive=true capture=true}}
class="d-lightbox__carousel-next-button btn-flat"
/>
{{/if}}
</div>

View File

@ -17,31 +17,31 @@
<div class="d-lightbox__footer-buttons">
{{#if @canZoom}}
<DButton
@class="d-lightbox__zoom-button btn-flat"
{{on "click" @toggleZoom passive=true capture=true}}
@title="experimental_lightbox.buttons.zoom"
@icon={{@zoomButtonIcon}}
@ariaHidden="true"
{{on "click" @toggleZoom passive=true capture=true}}
aria-hidden="true"
class="d-lightbox__zoom-button btn-flat"
/>
{{/if}}
{{#if @canRotate}}
<DButton
@class="d-lightbox__rotate-button btn-flat"
{{on "click" @rotateImage passive=true capture=true}}
@title="experimental_lightbox.buttons.rotate"
@icon="redo"
@ariaHidden="true"
{{on "click" @rotateImage passive=true capture=true}}
aria-hidden="true"
class="d-lightbox__rotate-button btn-flat"
/>
{{/if}}
{{#if @canDownload}}
<DButton
@class="d-lightbox__download-button btn-flat"
{{on "click" @downloadImage passive=true capture=true}}
@title="experimental_lightbox.buttons.download"
@icon="download"
@ariaHidden="true"
{{on "click" @downloadImage passive=true capture=true}}
class="d-lightbox__download-button btn-flat"
/>
{{/if}}
</div>

View File

@ -2,12 +2,12 @@
{{#if @canNavigate}}
<div aria-hidden="true" class="d-lightbox__multi-item-controls">
<DButton
@class="d-lightbox__carousel-button btn-flat"
{{on "click" @toggleCarousel passive=true capture=true}}
@title="experimental_lightbox.buttons.carousel"
@icon="images"
@ariaHidden="true"
{{on "click" @toggleCarousel passive=true capture=true}}
aria-hidden="true"
class="d-lightbox__carousel-button btn-flat"
/>
<div class="d-lightbox__counters">
<span class="d-lightbox__counter-current">
@ -25,30 +25,30 @@
<div class="d-lightbox__header-buttons">
{{#if @canDownload}}
<DButton
@class="d-lightbox__new-tab-button btn-flat"
{{on "click" @openInNewTab passive=true capture=true}}
@title="experimental_lightbox.buttons.newtab"
@icon="external-link-alt"
@ariaHidden="true"
{{on "click" @openInNewTab passive=true capture=true}}
aria-hidden="true"
class="d-lightbox__new-tab-button btn-flat"
/>
{{/if}}
{{#if @canFullscreen}}
<DButton
@class="d-lightbox__full-screen-button btn-flat"
{{on "click" @toggleFullScreen passive=true capture=true}}
@title="experimental_lightbox.buttons.fullscreen"
@icon="discourse-expand"
@ariaHidden="true"
{{on "click" @toggleFullScreen passive=true capture=true}}
aria-hidden="true"
class="d-lightbox__full-screen-button btn-flat"
/>
{{/if}}
<DButton
@class="d-lightbox__close-button btn-flat"
{{on "click" @close passive=true capture=true}}
@title="experimental_lightbox.buttons.close"
@icon="times"
@ariaHidden="true"
{{on "click" @close passive=true capture=true}}
class="d-lightbox__close-button btn-flat"
/>
</div>
</div>

View File

@ -1,5 +1,5 @@
<DButton
@class="btn-flat d-modal-cancel"
@action={{@close}}
@translatedLabel={{i18n "cancel"}}
class="btn-flat d-modal-cancel"
/>

View File

@ -30,8 +30,8 @@
<DButton
@icon="times"
@action={{route-action "closeModal" "initiatedByCloseButton"}}
@class="btn-flat modal-close close"
@title="modal.close"
class="btn-flat modal-close close"
/>
{{/if}}

View File

@ -38,8 +38,8 @@
<DButton
@icon="times"
@action={{this.handleCloseButton}}
@class="btn-flat modal-close close"
@title="modal.close"
class="btn-flat modal-close close"
/>
{{/if}}

View File

@ -29,10 +29,10 @@
{{#if (and this.category this.showCategoryEdit)}}
<DButton
@class="btn-default edit-category"
@action={{this.editCategory}}
@icon="wrench"
@title="category.edit_title"
class="btn-default edit-category"
/>
{{/if}}
@ -40,10 +40,10 @@
{{#if this.showToggleInfo}}
<DButton
@icon={{if this.currentUser.staff "wrench" "info-circle"}}
@class="btn-default"
@ariaLabel="tagging.info"
@action={{this.toggleInfo}}
@id="show-tag-info"
id="show-tag-info"
class="btn-default"
/>
{{/if}}
{{/if}}
@ -109,5 +109,4 @@
{{/if}}
{{/unless}}
{{/if}}
</div>

View File

@ -28,8 +28,8 @@
{{#if this.clearable}}
<DButton
@class="btn-default clear-date-time"
@icon="times"
@action={{action "onClear"}}
@action={{this.onClear}}
class="btn-default clear-date-time"
/>
{{/if}}

View File

@ -1,34 +1,34 @@
{{#if this.isNotSupported}}
<DButton
@icon="bell-slash"
@class="btn-default"
@label="user.desktop_notifications.not_supported"
@disabled="true"
class="btn-default"
/>
{{/if}}
{{#if this.isDeniedPermission}}
<DButton
@icon="bell-slash"
@class="btn-default"
@label="user.desktop_notifications.perm_denied_btn"
@action={{action "recheckPermission"}}
@disabled="true"
class="btn-default"
/>
{{i18n "user.desktop_notifications.perm_denied_expl"}}
{{else}}
{{#if this.isSubscribed}}
<DButton
@icon="far-bell-slash"
@class="btn-default"
@label="user.desktop_notifications.disable"
@action={{action "turnoff"}}
class="btn-default"
/>
{{else}}
<DButton
@icon="far-bell"
@class="btn-default"
@label="user.desktop_notifications.enable"
@action={{action "turnon"}}
class="btn-default"
/>
{{/if}}
{{/if}}

View File

@ -13,9 +13,9 @@
<DButton
@icon="times"
@action={{action "dismiss"}}
@class="btn btn-flat close"
@action={{this.dismiss}}
@title="banner.close"
class="btn-flat close"
/>
</div>
<div id="banner-content">

View File

@ -52,10 +52,10 @@
{{#if this.category.topic_url}}
<br />
<DButton
@class="btn-default edit-category-description"
@action={{action "showCategoryTopic"}}
@action={{this.showCategoryTopic}}
@icon="pencil-alt"
@label="category.change_in_category_topic"
class="btn-default edit-category-description"
/>
{{/if}}
</section>

View File

@ -69,17 +69,17 @@
/>
<DButton
@label="category.required_tag_group.delete"
@action={{action "deleteRequiredTagGroup" rtg}}
@action={{fn this.deleteRequiredTagGroup rtg}}
@icon="trash-alt"
@class="delete-required-tag-group"
class="delete-required-tag-group"
/>
</div>
{{/each}}
<DButton
@label="category.required_tag_group.add"
@action={{action "addRequiredTagGroup"}}
@action={{this.addRequiredTagGroup}}
@icon="plus"
@class="add-required-tag-group"
class="add-required-tag-group"
/>
</section>
</section>

View File

@ -8,9 +8,9 @@
<div class="emoji-picker-category-buttons">
{{#if this.recentEmojis.length}}
<button
type="button"
data-section="recent"
{{on "click" (fn this.onCategorySelection "recent")}}
data-section="recent"
type="button"
class="btn btn-default category-button emoji"
>
{{replace-emoji ":star:"}}
@ -24,9 +24,9 @@
{{#each-in this.customEmojis as |group emojis|}}
<button
type="button"
data-section={{concat "custom-" group}}
{{on "click" (fn this.onCategorySelection (concat "custom-" group))}}
data-section={{concat "custom-" group}}
type="button"
class="btn btn-default category-button emoji"
>
{{replace-emoji (concat ":" (get emojis "0.code") ":")}}
@ -66,8 +66,8 @@
<span class="title">{{i18n "emoji_picker.recent"}}</span>
<DButton
@icon="trash-alt"
@action={{action "onClearRecent"}}
@class="trash-recent"
@action={{this.onClearRecent}}
class="trash-recent"
/>
</div>
<div class="section-group">
@ -125,9 +125,9 @@
{{#each this.diversityScales as |diversityScale index|}}
<DButton
@icon={{diversityScale.icon}}
@class={{concat "diversity-scale " diversityScale.name}}
@title={{diversityScale.title}}
@action={{action "onDiversitySelection" index}}
@action={{fn this.onDiversitySelection index}}
class={{concat-class "diversity-scale" diversityScale.name}}
/>
{{/each}}
</div>

View File

@ -40,11 +40,11 @@
accept=".png,.gif"
/>
<DButton
@class="btn-primary"
@translatedLabel={{this.buttonLabel}}
@icon="plus"
@action={{action "chooseFiles"}}
@action={{this.chooseFiles}}
@disabled={{this.uploading}}
class="btn-primary"
/>
</div>
</div>

View File

@ -14,10 +14,9 @@
{{#if notice.options.dismissable}}
<DButton
@class="btn-flat close"
@icon="times"
@action={{action "dismissNotice"}}
@actionParam={{notice}}
@action={{fn this.dismissNotice notice}}
class="btn-flat close"
/>
{{/if}}
</div>

View File

@ -55,9 +55,9 @@
<li>
<DButton
@action={{action "messageGroup"}}
@class="btn-primary group-message-button inline"
@icon="envelope"
@label="groups.message"
class="btn-primary group-message-button inline"
/>
</li>
{{/if}}

View File

@ -83,12 +83,12 @@
<div class="control-group buttons">
<DButton
@disabled={{or this.missingSettings this.testingSettings}}
@class="btn-primary test-imap-settings"
@action={{action "testImapSettings"}}
@action={{this.testImapSettings}}
@icon="cog"
@label="groups.manage.email.test_settings"
@tabindex="12"
@title="groups.manage.email.settings_required"
tabindex="12"
class="btn-primary test-imap-settings"
/>
<ConditionalLoadingSpinner

View File

@ -1,9 +1,8 @@
{{#if this.value}}
<DButton
@class="btn-default group-manage-logs-filter"
@action={{action "clearFilter"}}
@actionParam={{this.type}}
@action={{fn this.clearFilter this.type}}
@icon="times-circle"
@translatedLabel={{concat this.label ": " this.filterText}}
class="btn-default group-manage-logs-filter"
/>
{{/if}}

View File

@ -16,10 +16,4 @@ export default Component.extend({
? I18n.t(`group_histories.actions.${value}`)
: value;
},
actions: {
clearFilter(param) {
this.clearFilter(param);
},
},
});

View File

@ -1,23 +1,21 @@
<tr class="group-manage-logs-row">
<td>
<DButton
@class="btn-default"
@action={{action "filter"}}
@actionParam={{hash value=this.log.action key="action"}}
@action={{fn this.filter (hash value=this.log.action key="action")}}
@translatedLabel={{this.log.actionTitle}}
class="btn-default"
/>
</td>
<td>
<span>{{avatar this.log.acting_user imageSize="tiny"}}</span>
<DButton
@class="btn-default"
@action={{action "filter"}}
@actionParam={{hash
value=this.log.acting_user.username
key="acting_user"
@action={{fn
this.filter
(hash value=this.log.acting_user.username key="acting_user")
}}
@translatedLabel={{this.log.acting_user.username}}
class="btn-default"
/>
</td>
@ -25,13 +23,12 @@
{{#if this.log.target_user}}
<span>{{avatar this.log.target_user imageSize="tiny"}}</span>
<DButton
@class="btn-default"
@action={{action "filter"}}
@actionParam={{hash
value=this.log.target_user.username
key="target_user"
@action={{fn
this.filter
(hash value=this.log.target_user.username key="target_user")
}}
@translatedLabel={{this.log.target_user.username}}
class="btn-default"
/>
{{/if}}
</td>
@ -39,10 +36,9 @@
<td>
{{#if this.log.subject}}
<DButton
@class="btn-default"
@action={{action "filter"}}
@actionParam={{hash value=this.log.subject key="subject"}}
@action={{fn this.filter (hash value=this.log.subject key="subject")}}
@translatedLabel={{this.log.subject}}
class="btn-default"
/>
{{/if}}
</td>
@ -52,7 +48,7 @@
<td class="group-manage-logs-expand-details">
{{#if this.log.prev_value}}
<DButton
@action={{action "toggleDetails"}}
@action={{this.toggleDetails}}
@icon={{if this.expandDetails "angle-up" "angle-down"}}
/>
{{/if}}

View File

@ -1,15 +1,17 @@
import Component from "@ember/component";
import { action } from "@ember/object";
export default Component.extend({
tagName: "",
expandDetails: false,
actions: {
toggleDetails() {
this.toggleProperty("expandDetails");
},
@action
toggleDetails() {
this.toggleProperty("expandDetails");
},
filter(params) {
this.set(`filters.${params.key}`, params.value);
},
@action
filter(params) {
this.set(`filters.${params.key}`, params.value);
},
});

View File

@ -9,8 +9,8 @@
<DButton
@action={{this.save}}
@disabled={{or this.disabled this.saving}}
@class="btn btn-primary group-manage-save"
@translatedLabel={{this.savingText}}
class="btn-primary group-manage-save"
/>
{{#if this.saved}}
<span>{{i18n "saved"}}</span>

View File

@ -1,26 +1,26 @@
{{#if this.canJoinGroup}}
<DButton
@action={{action "joinGroup"}}
@class="btn-default group-index-join"
@icon="user-plus"
@label="groups.join"
@disabled={{this.updatingMembership}}
class="btn-default group-index-join"
/>
{{else if this.canLeaveGroup}}
<DButton
@action={{action "leaveGroup"}}
@class="btn-danger group-index-leave"
@icon="user-times"
@label="groups.leave"
@disabled={{this.updatingMembership}}
class="btn-danger group-index-leave"
/>
{{else if this.canRequestMembership}}
<DButton
@action={{action "showRequestMembershipForm"}}
@class="btn-default group-index-request"
@disabled={{this.loading}}
@icon="user-plus"
@label="groups.request"
class="btn-default group-index-request"
/>
{{else}}
{{yield}}

View File

@ -99,12 +99,12 @@
<div class="control-group buttons">
<DButton
@disabled={{or this.missingSettings this.testingSettings}}
@class="btn-primary test-smtp-settings"
@action={{action "testSmtpSettings"}}
@action={{this.testSmtpSettings}}
@icon="cog"
@label="groups.manage.email.test_settings"
@tabindex="7"
@title="groups.manage.email.settings_required"
tabindex="7"
class="btn-primary test-smtp-settings"
/>
<ConditionalLoadingSpinner

View File

@ -1,9 +1,5 @@
{{#unless this.expanded}}
<DButton
@action={{action "expand"}}
@class="btn-link"
@label={{this.label}}
/>
<DButton @action={{this.expand}} @label={{this.label}} class="btn-link" />
{{/unless}}
{{#if this.expanded}}
<span class="description" aria-live="assertive">{{this.details}}</span>

View File

@ -1,8 +1,8 @@
<div class="ignored-user-list-item">
<span class="ignored-user-name">{{this.item}}</span>
<DButton
@class="remove-ignored-user no-text btn-icon"
@action={{action "removeIgnoredUser" this.item}}
@action={{fn (action "removeIgnoredUser") this.item}}
@icon="times"
class="remove-ignored-user no-text btn-icon"
/>
</div>

Some files were not shown because too many files have changed in this diff Show More