mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
FIX: Category images were not using the CDN
This commit is contained in:
parent
722c43b912
commit
2a4b30346c
3 changed files with 14 additions and 4 deletions
|
@ -6,6 +6,8 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
|||
_docTitle: document.title,
|
||||
|
||||
getURL: function(url) {
|
||||
if (!url) { return url; }
|
||||
|
||||
// If it's a non relative URL, return it.
|
||||
if (url.indexOf('http') === 0) return url;
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
export default Ember.Component.extend({
|
||||
tagName: 'img',
|
||||
attributeBindings: ['cdnSrc:src'],
|
||||
|
||||
cdnSrc: function() {
|
||||
return Discourse.getURLWithCDN(this.get('src'));
|
||||
}.property('src')
|
||||
});
|
|
@ -15,16 +15,16 @@
|
|||
{{/if}}
|
||||
|
||||
{{#if canCreateTopic}}
|
||||
<button id="create-topic" class='btn btn-default' {{action "createTopic"}}><i class='fa fa-plus'></i>{{i18n 'topic.create'}}</button>
|
||||
{{d-button id="create-topic" class="btn-default" action="createTopic" icon="plus" label="topic.create"}}
|
||||
{{/if}}
|
||||
|
||||
{{#if canEditCategory}}
|
||||
<button class='btn btn-default' {{action "editCategory" category}}><i class="fa fa-wrench"></i> {{i18n 'category.edit_long'}}</button>
|
||||
{{d-button class="btn-default" action="editCategory" actionParam=category icon="wrench" label="category.edit_long"}}
|
||||
{{/if}}
|
||||
|
||||
<section class='category-heading'>
|
||||
{{#if category.logo_url}}
|
||||
<img {{bind-attr src=category.logo_url}} class="category-logo">
|
||||
{{cdn-img src=category.logo_url class="category-logo"}}
|
||||
{{#if category.description}}
|
||||
<p>{{{category.description}}}</p>
|
||||
{{/if}}
|
||||
|
|
Loading…
Reference in a new issue