From 0ad869c25647ff041f7ea1470193919f1b4135b6 Mon Sep 17 00:00:00 2001 From: Boris Date: Thu, 27 Mar 2014 17:15:32 +1100 Subject: [PATCH] Align basic-topic-list table structure with Categories page topic-list table structure This is an optimization for people that choose their table row highlighting to be inverse of the default Discourse theme. If people choose to have the heading row (or individual th columns) and 'even' rows highlighted in topic-list.scss for the Categories page, the alternate coloring is not carried over to the User Activity page's Messages list. Because the basic-topic-list table there doesn't use the THEAD and TBODY wrappers, the first data row is effectively an 'odd' row, so highlighting is now applied both on the heading row and the first data row. By adding the THEAD and TBODY wrappers, we make sure that the table structures across the app are the same and global row highlighting styles work out of the box also on the User Activity page. --- .../components/basic-topic-list.js.handlebars | 134 +++++++++--------- 1 file changed, 69 insertions(+), 65 deletions(-) diff --git a/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars b/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars index 1208e1a2ddb..a1eafc7a3ab 100644 --- a/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars +++ b/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars @@ -1,75 +1,79 @@ {{#if loaded}} {{#if topics}} - - {{#sortable-heading sortBy="default" sortOrder=sortOrder}} - {{i18n topic.title}} - {{/sortable-heading}} - {{#unless controller.hideCategory}} - {{#sortable-heading sortBy="category" sortOrder=sortOrder}} - {{i18n category_title}} + + + {{#sortable-heading sortBy="default" sortOrder=sortOrder}} + {{i18n topic.title}} {{/sortable-heading}} - {{/unless}} - {{#sortable-heading sortBy="posts" number=true sortOrder=sortOrder}} - {{i18n posts}} - {{/sortable-heading}} - {{#sortable-heading sortBy="likes" number=true sortOrder=sortOrder}} - {{i18n likes}} - {{/sortable-heading}} - {{#sortable-heading sortBy="views" number=true sortOrder=sortOrder}} - {{i18n views}} - {{/sortable-heading}} - {{#sortable-heading sortBy="activity" number=true colspan="2" sortOrder=sortOrder}} - {{i18n activity}} - {{/sortable-heading}} - - - {{#groupedEach topic in topics}} - - - {{#unless controller.hideCategory}} - + {{#sortable-heading sortBy="category" sortOrder=sortOrder}} + {{i18n category_title}} + {{/sortable-heading}} {{/unless}} - - - - - - - {{#if topic.bumped}} - - - {{else}} - - - {{/if}} + {{#sortable-heading sortBy="posts" number=true sortOrder=sortOrder}} + {{i18n posts}} + {{/sortable-heading}} + {{#sortable-heading sortBy="likes" number=true sortOrder=sortOrder}} + {{i18n likes}} + {{/sortable-heading}} + {{#sortable-heading sortBy="views" number=true sortOrder=sortOrder}} + {{i18n views}} + {{/sortable-heading}} + {{#sortable-heading sortBy="activity" number=true colspan="2" sortOrder=sortOrder}} + {{i18n activity}} + {{/sortable-heading}} - {{/groupedEach}} + + + + {{#groupedEach topic in topics}} + + + + {{#unless controller.hideCategory}} + + {{/unless}} + + + + + + + {{#if topic.bumped}} + + + {{else}} + + + {{/if}} + + {{/groupedEach}} +
- {{categoryLink topic.category showParent=true}} - {{number topic.posts_count numberKey="posts_long"}}{{number topic.views numberKey="views_long"}} - {{unboundAge topic.created_at}} - - {{unboundAge topic.bumped_at}} - - {{unboundAge topic.created_at}} -
+ {{categoryLink topic.category showParent=true}} + {{number topic.posts_count numberKey="posts_long"}}{{number topic.views numberKey="views_long"}} + {{unboundAge topic.created_at}} + + {{unboundAge topic.bumped_at}} + + {{unboundAge topic.created_at}} +
{{else}}