diff --git a/app/assets/javascripts/discourse/app/controllers/edit-category-tabs.js b/app/assets/javascripts/discourse/app/controllers/edit-category-tabs.js index 8b29f40c6d1..2f38469f8e2 100644 --- a/app/assets/javascripts/discourse/app/controllers/edit-category-tabs.js +++ b/app/assets/javascripts/discourse/app/controllers/edit-category-tabs.js @@ -118,14 +118,12 @@ export default Controller.extend({ if (result) { this.model .destroy() - .then( - () => { - this.transitionToRoute("discovery.categories"); - }, - () => { - this.displayErrors([I18n.t("category.delete_error")]); - } - ) + .then(() => { + this.transitionToRoute("discovery.categories"); + }) + .catch(() => { + this.displayErrors([I18n.t("category.delete_error")]); + }) .finally(() => { this.set("deleting", false); }); @@ -143,9 +141,5 @@ export default Controller.extend({ goBack() { DiscourseURL.routeTo(this.model.url); }, - - toggleMenu() { - this.toggleProperty("expandedMenu"); - }, }, }); diff --git a/app/assets/javascripts/discourse/app/templates/edit-category-tabs.hbs b/app/assets/javascripts/discourse/app/templates/edit-category-tabs.hbs index 8615c267a1a..5bd179bdf62 100644 --- a/app/assets/javascripts/discourse/app/templates/edit-category-tabs.hbs +++ b/app/assets/javascripts/discourse/app/templates/edit-category-tabs.hbs @@ -1,20 +1,7 @@
- -

{{title}}

- {{#if mobileView}} - {{d-button action=(action "toggleMenu") class="menu-toggle" icon="bars"}} - {{else}} + {{#unless mobileView}} {{#if model.id}} {{d-button class="category-back" @@ -23,7 +10,20 @@ icon="caret-left" }} {{/if}} - {{/if}} + {{/unless}} +
+ +
+
{{#each panels as |tab|}} diff --git a/app/assets/stylesheets/common/base/edit-category.scss b/app/assets/stylesheets/common/base/edit-category.scss index 563f48d4a61..01f429fdd3d 100644 --- a/app/assets/stylesheets/common/base/edit-category.scss +++ b/app/assets/stylesheets/common/base/edit-category.scss @@ -7,19 +7,24 @@ div.edit-category { grid-template-rows: auto auto auto; grid-row-gap: 1em; grid-column-gap: 1.5em; - grid-template-areas: "sidebar header" "sidebar content" "sidebar footer"; + grid-template-areas: "header header" "sidebar content" "sidebar footer"; .edit-category-title { grid-area: header; + grid-column: 1 / span 2; display: flex; justify-content: space-between; align-self: start; + background-color: var(--primary-very-low); + padding: 20px; } - .nav-stacked { + .edit-category-nav { grid-area: sidebar; - grid-row: 1 / span 3; - background: transparent; + grid-row: 2 / span 3; + .nav-stacked { + background-color: var(--secondary); + } } #list-area & h2 { @@ -34,6 +39,12 @@ div.edit-category { .category-chooser { width: unquote("min(340px, 90%)"); } + + .warning { + background-color: var(--tertiary-low); + padding: 0.5em 2.5em 0.5em 1em; + margin-top: 0; + } } .edit-category-tab-security { @@ -136,6 +147,7 @@ div.edit-category { display: flex; justify-content: space-between; align-self: start; + padding-bottom: 2em; .disable-info { position: relative; diff --git a/app/assets/stylesheets/mobile/edit-category.scss b/app/assets/stylesheets/mobile/edit-category.scss index 444badc61d3..c251890191a 100644 --- a/app/assets/stylesheets/mobile/edit-category.scss +++ b/app/assets/stylesheets/mobile/edit-category.scss @@ -1,11 +1,42 @@ div.edit-category { display: block; - position: relative; + + .edit-category-nav { + width: 100%; + background-color: var(--secondary); + position: relative; + border-top: 1px solid var(--primary-low); + border-bottom: 1px solid var(--primary-low); + margin: 0.5em 0; + overflow: hidden; + &:after { + background: linear-gradient( + to right, + rgba(var(--secondary-rgb), 0) 0%, + rgba(var(--secondary-rgb), 1) 100% + ); + content: ""; + position: absolute; + right: 0px; + height: 100%; + width: 30px; + } + } + .nav-stacked { - position: absolute; - top: 3.2em; - left: -80%; - transition: left 0.2s ease; + white-space: nowrap; + flex-wrap: nowrap; + overflow-x: scroll; + display: inline-flex; + width: 100%; + margin-bottom: 0; + li { + font-size: $font-down-1; + border-bottom: none; + } + a.active::after { + display: none; + } } .edit-category-tab,