diff --git a/app/assets/javascripts/discourse/components/badge-card.js.es6 b/app/assets/javascripts/discourse/components/badge-card.js.es6 new file mode 100644 index 000000000..bb694471c --- /dev/null +++ b/app/assets/javascripts/discourse/components/badge-card.js.es6 @@ -0,0 +1,15 @@ +import computed from 'ember-addons/ember-computed-decorators'; + +export default Ember.Component.extend({ + size: 'medium', + classNameBindings: [':badge-card', 'size'], + + @computed('size') + summary(size) { + if (size === 'large') { + return Discourse.Emoji.unescape(this.get('badge.long_description') || ''); + } + return this.get('badge.translatedDescription'); + } + +}); diff --git a/app/assets/javascripts/discourse/components/check-mark.js.es6 b/app/assets/javascripts/discourse/components/check-mark.js.es6 index 702af6a15..a934a490a 100644 --- a/app/assets/javascripts/discourse/components/check-mark.js.es6 +++ b/app/assets/javascripts/discourse/components/check-mark.js.es6 @@ -1,11 +1,16 @@ import computed from 'ember-addons/ember-computed-decorators'; export default Ember.Component.extend({ - tagName: 'i', - classNameBindings: [':fa', 'iconClass'], + tagName: 'span', + classNameBindings: [':check-display', 'status'], @computed('checked') - iconClass(checked) { - return checked ? 'fa-check' : 'fa-times'; + status(checked) { + return checked ? 'status-checked' : 'status-unchecked'; + }, + + render(buffer) { + const icon = this.get('checked') ? 'check' : 'times'; + buffer.push(``); } }); diff --git a/app/assets/javascripts/discourse/controllers/badges/show.js.es6 b/app/assets/javascripts/discourse/controllers/badges/show.js.es6 index 52a4c7395..714635f60 100644 --- a/app/assets/javascripts/discourse/controllers/badges/show.js.es6 +++ b/app/assets/javascripts/discourse/controllers/badges/show.js.es6 @@ -44,11 +44,6 @@ export default Ember.Controller.extend({ @observes('canLoadMore') _showFooter() { this.set("controllers.application.showFooter", !this.get("canLoadMore")); - }, - - @computed('model.long_description') - longDescription(modelLongDesc) { - return Discourse.Emoji.unescape(modelLongDesc || ''); } }); diff --git a/app/assets/javascripts/discourse/models/badge.js.es6 b/app/assets/javascripts/discourse/models/badge.js.es6 index 6e3d852c7..3181739a2 100644 --- a/app/assets/javascripts/discourse/models/badge.js.es6 +++ b/app/assets/javascripts/discourse/models/badge.js.es6 @@ -33,13 +33,6 @@ const Badge = RestModel.extend({ return I18n.t(i18nKey, {defaultValue: this.get('name')}); }.property('name', 'i18nNameKey'), - /** - The i18n translated description for this badge. Returns the null if no - translation exists. - - @property translatedDescription - @type {String} - **/ translatedDescription: function() { const i18nKey = "badges.badge." + this.get('i18nNameKey') + ".description"; let translation = I18n.t(i18nKey); diff --git a/app/assets/javascripts/discourse/templates/badges/index.hbs b/app/assets/javascripts/discourse/templates/badges/index.hbs index 2d6de7fbd..093c258ee 100644 --- a/app/assets/javascripts/discourse/templates/badges/index.hbs +++ b/app/assets/javascripts/discourse/templates/badges/index.hbs @@ -1,21 +1,17 @@
{{bg.badgeGrouping.displayName}} |
- |||
{{#if b.has_badge}}{{/if}} | -{{user-badge badge=b}} | -{{{b.displayDescriptionHtml}}} | -{{b.grant_count}} | -