Merge pull request #4629 from caugner/fix-user-index-translate-boolean-values

FIX: Translate all boolean values in user index
This commit is contained in:
Régis Hanol 2016-12-29 14:46:45 +01:00 committed by GitHub
commit 1debf98d61
2 changed files with 7 additions and 12 deletions

View File

@ -175,13 +175,7 @@
<div class='display-row'>
<div class='field'>{{i18n 'admin.users.active'}}</div>
<div class='value'>
{{#if model.active}}
{{i18n 'yes_value'}}
{{else}}
{{i18n 'no_value'}}
{{/if}}
</div>
<div class='value'>{{i18n-yes-no model.active}}</div>
<div class='controls'>
{{#if model.active}}
{{#if model.can_deactivate}}
@ -221,7 +215,7 @@
<div class='display-row'>
<div class='field'>{{i18n 'admin.user.admin'}}</div>
<div class='value'>{{model.admin}}</div>
<div class='value'>{{i18n-yes-no model.admin}}</div>
<div class='controls'>
{{#if model.can_revoke_admin}}
{{d-button action="revokeAdmin" icon="shield" label="admin.user.revoke_admin"}}
@ -234,7 +228,7 @@
<div class='display-row'>
<div class='field'>{{i18n 'admin.user.moderator'}}</div>
<div class='value'>{{model.moderator}}</div>
<div class='value'>{{i18n-yes-no model.moderator}}</div>
<div class='controls'>
{{#if model.can_revoke_moderation}}
{{d-button action="revokeModeration" icon="shield" label="admin.user.revoke_moderation"}}
@ -272,7 +266,7 @@
<div class="display-row {{if model.isSuspended 'highlight-danger'}}">
<div class='field'>{{i18n 'admin.user.suspended'}}</div>
<div class='value'>{{model.isSuspended}}</div>
<div class='value'>{{i18n-yes-no model.isSuspended}}</div>
<div class='controls'>
{{#if model.isSuspended}}
{{d-button class="btn-danger" action="unsuspend" icon="ban" label="admin.user.unsuspend"}}
@ -303,7 +297,7 @@
<div class="display-row {{if model.blocked 'highlight-danger'}}">
<div class='field'>{{i18n 'admin.user.blocked'}}</div>
<div class='value'>{{model.blocked}}</div>
<div class='value'>{{i18n-yes-no model.blocked}}</div>
<div class='controls'>
{{#conditional-loading-spinner size="small" condition=model.blockingUser}}
{{#if model.blocked}}
@ -319,7 +313,7 @@
<div class="display-row">
<div class='field'>{{i18n 'admin.user.staged'}}</div>
<div class='value'>{{model.staged}}</div>
<div class='value'>{{i18n-yes-no model.staged}}</div>
<div class='controls'>{{i18n 'admin.user.staged_explanation'}}</div>
</div>
</section>

View File

@ -1,3 +1,4 @@
import { registerUnbound } from 'discourse-common/lib/helpers';
registerUnbound('i18n', (key, params) => I18n.t(key, params));
registerUnbound('i18n-yes-no', (value, params) => I18n.t(value ? 'yes_value' : 'no_value', params));