From a014507da49032f75a7dc323b554902db49b9b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 15 Dec 2014 15:39:13 +0100 Subject: [PATCH] FIX: semantic HTML for category with images --- .../components/category-title-link.js.es6 | 18 ++++++++---------- app/assets/stylesheets/desktop/topic-list.scss | 5 +++++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/discourse/components/category-title-link.js.es6 b/app/assets/javascripts/discourse/components/category-title-link.js.es6 index 6358476cbd7..2f33b7e5e91 100644 --- a/app/assets/javascripts/discourse/components/category-title-link.js.es6 +++ b/app/assets/javascripts/discourse/components/category-title-link.js.es6 @@ -3,19 +3,17 @@ export default Em.Component.extend({ render: function(buffer) { var category = this.get('category'), - logoUrl = category.get('logo_url'); + logoUrl = category.get('logo_url'), + categoryUrl = Discourse.getURL('/c/') + Discourse.Category.slugFor(category), + categoryName = Handlebars.Utils.escapeExpression(category.get('name')); - if (category.get('read_restricted')) { - buffer.push(" "); - } + if (category.get('read_restricted')) { buffer.push(""); } - buffer.push(""); + buffer.push(""); + buffer.push("" + categoryName + ""); + + if (!Em.isEmpty(logoUrl)) { buffer.push(""); } - var noLogo = Em.isEmpty(logoUrl); - buffer.push(Handlebars.Utils.escapeExpression(category.get('name'))); - if (!noLogo) { - buffer.push("
"); - } buffer.push("
"); } }); diff --git a/app/assets/stylesheets/desktop/topic-list.scss b/app/assets/stylesheets/desktop/topic-list.scss index 484abfb70ad..b1c54815fac 100644 --- a/app/assets/stylesheets/desktop/topic-list.scss +++ b/app/assets/stylesheets/desktop/topic-list.scss @@ -312,6 +312,11 @@ button.dismiss-read { font-size: 1.5em; } } + +.category-name { + display: block; +} + .category-logo { max-height: 150px; float: left;