mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
add category-logo-link component
This commit is contained in:
parent
6ef1537ee0
commit
993f63ee2b
2 changed files with 14 additions and 1 deletions
|
@ -0,0 +1,13 @@
|
|||
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 category = this.get('category');
|
||||
const categoryLogo = category.get('logo_url');
|
||||
buffer.push(`<img class="category-logo" src='${categoryLogo}'/>`);
|
||||
}
|
||||
});
|
|
@ -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">
|
||||
|
|
Loading…
Reference in a new issue