discourse/app/assets/javascripts/admin/templates/badges.js.handlebars

117 lines
3.5 KiB
Handlebars
Raw Normal View History

2014-03-05 07:52:20 -05:00
<div class="badges">
<div class='content-list span6'>
<h3>{{i18n admin.badges.title}}</h3>
<ul>
{{#each}}
<li>
<a {{action selectBadge this}} {{bind-attr class="selected:active"}}>
{{displayName}}
{{#if newBadge}}
<span class="list-badge">{{i18n filters.new.lower_title}}</span>
2014-03-05 07:52:20 -05:00
{{/if}}
</a>
</li>
{{/each}}
</ul>
2014-05-23 22:33:46 -04:00
<button {{action createNewBadge}} {{bind-attr disabled=newBadgeExists}} class='btn'><i class="fa fa-plus"></i>{{i18n admin.badges.new}}</button>
2014-03-05 07:52:20 -05:00
</div>
{{#if selectedItem}}
{{#with selectedItem controller='adminBadge'}}
2014-03-19 01:13:38 -04:00
<div class='current-badge span13'>
2014-03-05 07:52:20 -05:00
<form class="form-horizontal">
<div>
<label for="name">{{i18n admin.badges.name}}</label>
{{input type="text" name="name" value=name}}
2014-03-05 07:52:20 -05:00
</div>
{{#if showDisplayName}}
<div>
<strong>{{i18n admin.badges.display_name}}</strong>
{{displayName}}
</div>
2014-03-05 07:52:20 -05:00
{{/if}}
<div>
<label for="name">{{i18n admin.badges.icon}}</label>
{{input type="text" name="name" value=icon}}
</div>
2014-03-05 07:52:20 -05:00
<div>
<label for="badge_type_id">{{i18n admin.badges.badge_type}}</label>
{{view Ember.Select name="badge_type_id" value=badge_type_id
content=controller.badgeTypes
optionValuePath="content.id"
optionLabelPath="content.name"
disabled=readOnly}}
2014-03-05 07:52:20 -05:00
</div>
<div>
<label for="badge_grouping_id">{{i18n admin.badges.badge_grouping}}</label>
{{view Ember.Select name="badge_grouping_id" value=badge_grouping_id
content=controller.badgeGroupings
optionValuePath="content.id"
optionLabelPath="content.name"
disabled=readOnly}}
</div>
2014-03-05 07:52:20 -05:00
<div>
<label for="description">{{i18n admin.badges.description}}</label>
{{#if controller.canEditDescription}}
{{textarea name="description" value=description}}
{{else}}
2014-05-21 03:22:42 -04:00
{{textarea name="description" value=displayDescription disabled=true}}
2014-03-05 07:52:20 -05:00
{{/if}}
</div>
<div>
<span>
{{input type="checkbox" checked=allow_title disabled=readOnly}}
{{i18n admin.badges.allow_title}}
</span>
</div>
2014-05-21 03:22:42 -04:00
<div>
<span>
{{input type="checkbox" checked=multiple_grant disabled=readOnly}}
{{i18n admin.badges.multiple_grant}}
</span>
</div>
2014-07-03 03:44:16 -04:00
<div>
<span>
{{input type="checkbox" checked=listable disabled=readOnly}}
{{i18n admin.badges.listable}}
</span>
</div>
<div>
<span>
{{input type="checkbox" checked=enabled}}
{{i18n admin.badges.enabled}}
</span>
</div>
<div class='buttons'>
<button {{action save}} {{bind-attr disabled=controller.disableSave}} class='btn btn-primary'>{{i18n admin.badges.save}}</button>
<span class='saving'>{{savingStatus}}</span>
{{#unless readOnly}}
<a {{action destroy}} class='delete-link'>{{i18n admin.badges.delete}}</a>
{{/unless}}
</div>
2014-03-05 07:52:20 -05:00
</form>
</div>
2014-07-23 22:39:09 -04:00
{{#if grant_count}}
<div class="span13 current-badge-actions">
<div>
2014-07-23 22:39:09 -04:00
{{#link-to 'badges.show' this}}{{i18n badges.granted count=grant_count}}{{/link-to}}
</div>
</div>
2014-07-23 22:39:09 -04:00
{{/if}}
2014-03-05 07:52:20 -05:00
{{/with}}
{{/if}}
</div>