mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 03:02:46 +08:00
FIX: Show images in the admin section list for badges. Add help text to
indicate icons can be images too.
This commit is contained in:
parent
f3a67a48a3
commit
08233fc86e
|
@ -6,10 +6,7 @@
|
||||||
{{#each}}
|
{{#each}}
|
||||||
<li>
|
<li>
|
||||||
<a {{action "selectBadge" this}} {{bind-attr class="selected:active"}}>
|
<a {{action "selectBadge" this}} {{bind-attr class="selected:active"}}>
|
||||||
<span {{bind-attr class=":user-badge badgeTypeClassName" data-badge-name="name" title="displayDescription"}}>
|
{{badge-button badge=this}}
|
||||||
<i {{bind-attr class=":fa icon"}}></i>
|
|
||||||
{{displayName}}
|
|
||||||
</span>
|
|
||||||
{{#if newBadge}}
|
{{#if newBadge}}
|
||||||
<span class="list-badge">{{i18n filters.new.lower_title}}</span>
|
<span class="list-badge">{{i18n filters.new.lower_title}}</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -39,6 +36,7 @@
|
||||||
<div>
|
<div>
|
||||||
<label for="name">{{i18n admin.badges.icon}}</label>
|
<label for="name">{{i18n admin.badges.icon}}</label>
|
||||||
{{input type="text" name="name" value=icon}}
|
{{input type="text" name="name" value=icon}}
|
||||||
|
<p class='help'>{{i18n admin.badges.icon_help}}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
export default Ember.Component.extend({
|
||||||
|
tagName: 'span',
|
||||||
|
classNameBindings: [':user-badge', 'badge.badgeTypeClassName'],
|
||||||
|
title: Em.computed.alias('badge.displayDescription'),
|
||||||
|
attributeBindings: ['data-badge-name', 'title'],
|
||||||
|
'data-badge-name': Em.computed.alias('badge.name'),
|
||||||
|
|
||||||
|
isIcon: Em.computed.match('badge.icon', /^fa-/)
|
||||||
|
});
|
|
@ -3,7 +3,5 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
showGrantCount: function() {
|
showGrantCount: function() {
|
||||||
return this.get('count') && this.get('count') > 1;
|
return this.get('count') && this.get('count') > 1;
|
||||||
}.property('count'),
|
}.property('count')
|
||||||
|
|
||||||
isIcon: Em.computed.match('badge.icon', /^fa-/)
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
{{#if isIcon}}
|
||||||
|
<i {{bind-attr class=":fa badge.icon"}}></i>
|
||||||
|
{{else}}
|
||||||
|
<img {{bind-attr src="badge.icon"}}>
|
||||||
|
{{/if}}
|
||||||
|
{{badge.displayName}}
|
||||||
|
{{yield}}
|
|
@ -1,13 +1,7 @@
|
||||||
{{#link-to 'badges.show' badge}}
|
{{#link-to 'badges.show' badge}}
|
||||||
<span {{bind-attr class=":user-badge badge.badgeTypeClassName" data-badge-name="badge.name" title="badge.displayDescription"}}>
|
{{#badge-button badge=badge}}
|
||||||
{{#if isIcon}}
|
|
||||||
<i {{bind-attr class=":fa badge.icon"}}></i>
|
|
||||||
{{else}}
|
|
||||||
<img {{bind-attr src="badge.icon"}}>
|
|
||||||
{{/if}}
|
|
||||||
{{badge.displayName}}
|
|
||||||
{{#if showGrantCount}}
|
{{#if showGrantCount}}
|
||||||
<span class="count">(× {{count}})</span>
|
<span class="count">(× {{count}})</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</span>
|
{{/badge-button}}
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
|
|
|
@ -360,6 +360,12 @@ section.details {
|
||||||
|
|
||||||
.current-badge {
|
.current-badge {
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
|
|
||||||
|
p.help {
|
||||||
|
margin: 0;
|
||||||
|
color: scale-color($primary, $lightness: 40%);
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-horizontal {
|
.form-horizontal {
|
||||||
|
|
|
@ -2098,6 +2098,7 @@ en:
|
||||||
listable: Show badge on the public badges page
|
listable: Show badge on the public badges page
|
||||||
enabled: Enable badge
|
enabled: Enable badge
|
||||||
icon: Icon
|
icon: Icon
|
||||||
|
icon_help: "Use either a Font Awesome class or URL to an image"
|
||||||
query: Badge Query (SQL)
|
query: Badge Query (SQL)
|
||||||
target_posts: Query targets posts
|
target_posts: Query targets posts
|
||||||
auto_revoke: Run revocation query daily
|
auto_revoke: Run revocation query daily
|
||||||
|
|
Loading…
Reference in New Issue
Block a user