mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: improve categories page subcategory layout (#27612)
This commit is contained in:
parent
4e42dc8d60
commit
e505a5a1d5
@ -36,4 +36,9 @@ export default Component.extend({
|
|||||||
newTopicsCount() {
|
newTopicsCount() {
|
||||||
return this.category.newTopicsCount;
|
return this.category.newTopicsCount;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@discourseComputed("category.path")
|
||||||
|
slugPath(categoryPath) {
|
||||||
|
return categoryPath.substring("/c/".length);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
tagName: "span",
|
tagName: "span",
|
||||||
|
classNames: ["category__badges"],
|
||||||
});
|
});
|
||||||
|
@ -57,10 +57,14 @@
|
|||||||
/>
|
/>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{#if (gt this.category.unloadedSubcategoryCount 0)}}
|
{{#if (gt this.category.unloadedSubcategoryCount 0)}}
|
||||||
{{i18n
|
<div class="subcategories__more-subcategories">
|
||||||
"category_row.subcategory_count"
|
<LinkTo @route="discovery.subcategories" @model={{this.slugPath}}>
|
||||||
count=this.category.unloadedSubcategoryCount
|
{{i18n
|
||||||
}}
|
"category_row.subcategory_count"
|
||||||
|
count=this.category.unloadedSubcategoryCount
|
||||||
|
}}
|
||||||
|
</LinkTo>
|
||||||
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -50,7 +50,7 @@ module(
|
|||||||
);
|
);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
this.subject.rowByIndex(1).el().innerText.replaceAll("\n", " "),
|
this.subject.rowByIndex(1).el().innerText.replaceAll("\n", " "),
|
||||||
"Parent Category × 95 + 2 subcategories"
|
"Parent Category × 95 +2 subcategories"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -47,22 +47,44 @@
|
|||||||
display: block;
|
display: block;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
margin-top: 5px;
|
&:first-child {
|
||||||
|
margin-top: 0.75em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.subcategories {
|
.subcategories {
|
||||||
margin-top: 0.25em;
|
display: flex;
|
||||||
clear: both;
|
flex-wrap: wrap;
|
||||||
|
gap: 0.15em 0.75em;
|
||||||
|
margin-top: 0.5em;
|
||||||
.subcategory {
|
.subcategory {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
margin-right: 0.3em;
|
gap: 0.25em;
|
||||||
|
@include ellipsis;
|
||||||
|
.badge-category {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.category__badges {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.25em;
|
||||||
|
.badge-notification {
|
||||||
|
top: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.badge-notification.unread-posts {
|
.badge-notification.unread-posts {
|
||||||
display: block;
|
display: block;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
&__more-subcategories {
|
||||||
|
font-size: var(--font-down-1);
|
||||||
|
a {
|
||||||
|
color: var(--primary-high);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.featured-topic {
|
.featured-topic {
|
||||||
|
@ -2406,8 +2406,8 @@ en:
|
|||||||
|
|
||||||
category_row:
|
category_row:
|
||||||
subcategory_count:
|
subcategory_count:
|
||||||
one: "+ %{count} subcategory"
|
one: "+%{count} subcategory"
|
||||||
other: "+ %{count} subcategories"
|
other: "+%{count} subcategories"
|
||||||
topic_count:
|
topic_count:
|
||||||
one: "%{count} topic in this category"
|
one: "%{count} topic in this category"
|
||||||
other: "%{count} topics in this category"
|
other: "%{count} topics in this category"
|
||||||
|
Loading…
Reference in New Issue
Block a user