diff --git a/app/assets/javascripts/discourse/templates/components/categories-boxes-with-topics.hbs b/app/assets/javascripts/discourse/templates/components/categories-boxes-with-topics.hbs index aae157c5213..9c082b2c57b 100644 --- a/app/assets/javascripts/discourse/templates/components/categories-boxes-with-topics.hbs +++ b/app/assets/javascripts/discourse/templates/components/categories-boxes-with-topics.hbs @@ -4,7 +4,10 @@
{{{dir-span category.description}}}
{{/if}} diff --git a/app/assets/stylesheets/common/base/category-list.scss b/app/assets/stylesheets/common/base/category-list.scss index 0e130634b00..66234afa8a5 100644 --- a/app/assets/stylesheets/common/base/category-list.scss +++ b/app/assets/stylesheets/common/base/category-list.scss @@ -43,6 +43,7 @@ .logo { display: block; + width: auto; height: 40px; margin: 0 auto 1em auto; } diff --git a/app/assets/stylesheets/desktop/topic-list.scss b/app/assets/stylesheets/desktop/topic-list.scss index 5cbda677385..a5669500a75 100644 --- a/app/assets/stylesheets/desktop/topic-list.scss +++ b/app/assets/stylesheets/desktop/topic-list.scss @@ -222,6 +222,7 @@ button.dismiss-read { } .category-logo { + width: auto; max-height: 150px; float: left; margin: 0.25em 1em 0.5em 0; diff --git a/app/assets/stylesheets/mobile/topic-list.scss b/app/assets/stylesheets/mobile/topic-list.scss index 319c94324b0..71b0a7ae2ac 100644 --- a/app/assets/stylesheets/mobile/topic-list.scss +++ b/app/assets/stylesheets/mobile/topic-list.scss @@ -480,6 +480,7 @@ ol.category-breadcrumb { .category-logo { display: block; + width: auto; max-width: 100%; max-height: 150px; padding: 8px 0; diff --git a/app/serializers/category_upload_serializer.rb b/app/serializers/category_upload_serializer.rb index f537c1a3362..72ab9885cf7 100644 --- a/app/serializers/category_upload_serializer.rb +++ b/app/serializers/category_upload_serializer.rb @@ -1,3 +1,3 @@ class CategoryUploadSerializer < ApplicationSerializer - attributes :id, :url + attributes :id, :url, :width, :height end diff --git a/spec/serializers/category_upload_serializer_spec.rb b/spec/serializers/category_upload_serializer_spec.rb new file mode 100644 index 00000000000..478ee54b977 --- /dev/null +++ b/spec/serializers/category_upload_serializer_spec.rb @@ -0,0 +1,13 @@ +require 'rails_helper' + +describe CategoryUploadSerializer do + + let(:upload) { Fabricate(:upload) } + let(:subject) { described_class.new(upload, root: false) } + + it 'should include width and height' do + expect(subject.width).to eq(upload.width) + expect(subject.height).to eq(upload.height) + end + +end