From 30983021e266489b65a12c1ad32d3e42806d2186 Mon Sep 17 00:00:00 2001 From: Jordan Vidrine <30537603+jordanvidrine@users.noreply.github.com> Date: Mon, 6 Apr 2020 12:02:33 -0500 Subject: [PATCH] No category styles (#9359) * UI: "No category styles" apply to category boxes --- .../components/categories-boxes-with-topics.js | 2 ++ .../discourse/components/categories-boxes.js | 2 ++ .../components/categories-boxes-with-topics.hbs | 2 +- .../templates/components/categories-boxes.hbs | 2 +- .../discourse/templates/user/messages.hbs | 4 ++-- .../stylesheets/common/base/category-list.scss | 16 ++++++++++++++++ .../stylesheets/desktop/category-list.scss | 5 ----- 7 files changed, 24 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/discourse/components/categories-boxes-with-topics.js b/app/assets/javascripts/discourse/components/categories-boxes-with-topics.js index ffd3a77ca87..40fb4df22f8 100644 --- a/app/assets/javascripts/discourse/components/categories-boxes-with-topics.js +++ b/app/assets/javascripts/discourse/components/categories-boxes-with-topics.js @@ -1,6 +1,7 @@ import discourseComputed from "discourse-common/utils/decorators"; import { isEmpty } from "@ember/utils"; import Component from "@ember/component"; +import { equal } from "@ember/object/computed"; export default Component.extend({ tagName: "section", @@ -8,6 +9,7 @@ export default Component.extend({ ":category-boxes-with-topics", "anyLogos:with-logos:no-logos" ], + noCategoryStyle: equal("siteSettings.category_style", "none"), @discourseComputed("categories.[].uploaded_logo.url") anyLogos() { diff --git a/app/assets/javascripts/discourse/components/categories-boxes.js b/app/assets/javascripts/discourse/components/categories-boxes.js index c3aadd638c4..331d06c216d 100644 --- a/app/assets/javascripts/discourse/components/categories-boxes.js +++ b/app/assets/javascripts/discourse/components/categories-boxes.js @@ -1,6 +1,7 @@ import discourseComputed from "discourse-common/utils/decorators"; import { isEmpty } from "@ember/utils"; import Component from "@ember/component"; +import { equal } from "@ember/object/computed"; export default Component.extend({ tagName: "section", @@ -9,6 +10,7 @@ export default Component.extend({ "anyLogos:with-logos:no-logos", "hasSubcategories:with-subcategories" ], + noCategoryStyle: equal("siteSettings.category_style", "none"), @discourseComputed("categories.[].uploaded_logo.url") anyLogos() { 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 d4a40fc5a97..fc718918543 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 @@ -1,5 +1,5 @@ {{#each categories as |c|}} -
+
diff --git a/app/assets/javascripts/discourse/templates/components/categories-boxes.hbs b/app/assets/javascripts/discourse/templates/components/categories-boxes.hbs index b629646a564..755eea2b723 100644 --- a/app/assets/javascripts/discourse/templates/components/categories-boxes.hbs +++ b/app/assets/javascripts/discourse/templates/components/categories-boxes.hbs @@ -1,5 +1,5 @@ {{#each categories as |c|}} -
{{#unless c.isMuted}} diff --git a/app/assets/javascripts/discourse/templates/user/messages.hbs b/app/assets/javascripts/discourse/templates/user/messages.hbs index 3dc34f67a15..643928faa1d 100644 --- a/app/assets/javascripts/discourse/templates/user/messages.hbs +++ b/app/assets/javascripts/discourse/templates/user/messages.hbs @@ -1,7 +1,7 @@ {{#d-section class="user-secondary-navigation" pageClass="user-messages"}} {{#unless site.mobileView}} {{#if showNewPM}} - {{d-button class="btn-primary new-private-message" action=(route-action "composePrivateMessage") icon="envelope" label="user.new_private_message"}} + {{d-button class="btn-primary new-" action=(route-action "composePrivateMessage") icon="envelope" label="user.new_private_message"}} {{/if}} {{/unless}} @@ -72,7 +72,7 @@ {{#if site.mobileView}} {{#if showNewPM}} {{d-button - class="btn-primary new-private-message" + class="btn-primary new-" action=(route-action "composePrivateMessage") icon="envelope" label="user.new_private_message"}} diff --git a/app/assets/stylesheets/common/base/category-list.scss b/app/assets/stylesheets/common/base/category-list.scss index b7cc6432a7d..782415c5dcb 100644 --- a/app/assets/stylesheets/common/base/category-list.scss +++ b/app/assets/stylesheets/common/base/category-list.scss @@ -324,3 +324,19 @@ color: $primary-medium; } } + +.category-list { + tbody { + .category { + &.no-category-style { + border-color: transparent; + border-left: 0px; + padding-left: 0px; + } + } + } +} + +.category-box.no-category-boxes-style { + border-left-width: 2px; +} diff --git a/app/assets/stylesheets/desktop/category-list.scss b/app/assets/stylesheets/desktop/category-list.scss index c5774106abc..50801d9d340 100644 --- a/app/assets/stylesheets/desktop/category-list.scss +++ b/app/assets/stylesheets/desktop/category-list.scss @@ -94,11 +94,6 @@ tbody { .category { - &.no-category-style { - border-color: transparent; - border-left: 0px; - padding-left: 0px; - } border-left: 6px solid; h3, h4 {