Merge pull request #3939 from scossar/clickable-category-logo

FEATURE: make category logo clickable
This commit is contained in:
Robin Ward 2015-12-29 13:42:18 -05:00
commit a42826f2ae
2 changed files with 13 additions and 1 deletions

View File

@ -0,0 +1,12 @@
export default Em.Component.extend({
tagName: 'a',
attributeBindings: ['href'],
href: function() {
return Discourse.getURL('/c/') + Discourse.Category.slugFor(this.get('category'));
}.property(),
render(buffer) {
const categoryLogo = this.get('category.logo_url');
buffer.push(`<img class="category-logo" src='${categoryLogo}'/>`);
}
});

View File

@ -16,7 +16,7 @@
{{category-title-link category=c}}
{{category-unread category=c}}
{{#if c.logo_url}}
<img class="category-logo" src={{c.logo_url}}>
{{category-logo-link category=c}}
{{/if}}
<div class="category-description">