FIX: Form CDN URL client side instead.
This commit is contained in:
parent
9374e5d42d
commit
7dea31adce
|
@ -1,12 +0,0 @@
|
|||
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}'/>`);
|
||||
}
|
||||
});
|
|
@ -1,17 +1,10 @@
|
|||
import { iconHTML } from 'discourse/helpers/fa-icon';
|
||||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
export default Em.Component.extend({
|
||||
tagName: 'h3',
|
||||
|
||||
render(buffer) {
|
||||
const category = this.get('category');
|
||||
const categoryUrl = Discourse.getURL('/c/') + Discourse.Category.slugFor(category);
|
||||
const categoryName = Handlebars.Utils.escapeExpression(category.get('name'));
|
||||
|
||||
if (category.get('read_restricted')) { buffer.push(iconHTML('lock')); }
|
||||
|
||||
buffer.push(`<a href='${categoryUrl}'>`);
|
||||
buffer.push(`<span class='category-name'>${categoryName}</span>`);
|
||||
buffer.push(`</a>`);
|
||||
@computed("category.name")
|
||||
categoryName(name) {
|
||||
return Handlebars.Utils.escapeExpression(name);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -15,9 +15,6 @@
|
|||
<td class="category" style={{border-color c.color}}>
|
||||
<div>
|
||||
{{category-title-link category=c}}
|
||||
{{#if c.logo_url}}
|
||||
{{category-logo-link category=c}}
|
||||
{{/if}}
|
||||
<div class="category-description">
|
||||
{{{c.description_excerpt}}}
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<a href={{category.url}}>
|
||||
{{#if category.read_restricted}}
|
||||
{{fa-icon 'lock'}}
|
||||
{{/if}}
|
||||
|
||||
<span class="category-name">{{categoryName}}</span>
|
||||
|
||||
{{#if category.logo_url}}
|
||||
<div>{{cdn-img src=category.logo_url class="category-logo"}}</div>
|
||||
{{/if}}
|
||||
</a>
|
Loading…
Reference in New Issue