Browse Source

Always show description

master
Angus McLeod 3 years ago
parent
commit
7bb3e905ad
3 changed files with 13 additions and 7 deletions
  1. +4
    -0
      common/common.scss
  2. +5
    -6
      javascripts/discourse/components/category-name-header.js.es6
  3. +4
    -1
      javascripts/discourse/templates/components/category-name-header.hbs

+ 4
- 0
common/common.scss

@ -12,6 +12,10 @@
margin-bottom: 20px; margin-bottom: 20px;
width: 100%; width: 100%;
p:first-child {
display: none;
}
&.has-logo { &.has-logo {
border: 2px solid $tertiary; border: 2px solid $tertiary;
padding: 1em; padding: 1em;

+ 5
- 6
javascripts/discourse/components/category-name-header.js.es6

@ -7,14 +7,13 @@ export default Component.extend({
didInsertElement() { didInsertElement() {
scheduleOnce('afterRender', () => { scheduleOnce('afterRender', () => {
let $el = $(this.element); let $el = $(this.element);
$el.appendTo('section.category-heading');
if (this.category.uploaded_logo) { if (this.category.uploaded_logo) {
$el.insertAfter('section.category-heading .category-logo');
$('section.category-heading').addClass('has-logo');
$('section.category-heading .category-name-header, section.category-heading p').wrapAll('<div class="category-heading-details"></div>');
} else {
$el.appendTo('section.category-heading');
$('section.category-heading').addClass('has-logo');
} }
$('section.category-heading .category-name-header, section.category-heading p').wrapAll('<div class="category-heading-details"></div>');
}); });
} }
}) })

+ 4
- 1
javascripts/discourse/templates/components/category-name-header.hbs

@ -1 +1,4 @@
{{category.name}}
{{category.name}}
{{#if category.description}}
<p>{{dir-span category.description}}</p>
{{/if}}

Loading…
Cancel
Save