FIX: Category images were not using the CDN

This commit is contained in:
Robin Ward 2015-02-18 12:30:41 -05:00
parent 722c43b912
commit 2a4b30346c
3 changed files with 14 additions and 4 deletions

View file

@ -6,6 +6,8 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
_docTitle: document.title, _docTitle: document.title,
getURL: function(url) { getURL: function(url) {
if (!url) { return url; }
// If it's a non relative URL, return it. // If it's a non relative URL, return it.
if (url.indexOf('http') === 0) return url; if (url.indexOf('http') === 0) return url;

View file

@ -0,0 +1,8 @@
export default Ember.Component.extend({
tagName: 'img',
attributeBindings: ['cdnSrc:src'],
cdnSrc: function() {
return Discourse.getURLWithCDN(this.get('src'));
}.property('src')
});

View file

@ -15,18 +15,18 @@
{{/if}} {{/if}}
{{#if canCreateTopic}} {{#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}}
{{#if canEditCategory}} {{#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}} {{/if}}
<section class='category-heading'> <section class='category-heading'>
{{#if category.logo_url}} {{#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}} {{#if category.description}}
<p>{{{category.description}}}</p> <p>{{{category.description}}}</p>
{{/if}} {{/if}}
{{/if}} {{/if}}
</section> </section>