UX: puts tags and categories on same line in search-menu-results (#7830)

This commit is contained in:
Joffrey JAFFEUX 2019-07-01 13:11:43 +02:00 committed by GitHub
parent 384f5cea05
commit af58049eeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 8 deletions

View File

@ -148,24 +148,27 @@ createSearchResult({
builder(result, term) {
const topic = result.topic;
const linkContent = [
h("div.header", [
const firstLine = [
this.attach("topic-status", { topic, disableActions: true }),
h("span.topic-title", new Highlighted(topic.fancyTitle, term))
]),
];
const secondLine = [
this.attach("category-link", {
category: topic.category,
link: false
})
];
if (Discourse.SiteSettings.tagging_enabled) {
linkContent.push(
secondLine.push(
this.attach("discourse-tags", { topic, tagName: "span" })
);
}
const link = h("span.topic", linkContent);
const link = h("span.topic", [
h("div.first-line", firstLine),
h("div.second-line", secondLine)
]);
return postResult.call(this, result, link, term);
}

View File

@ -253,6 +253,17 @@
.topic {
display: inline-block;
line-height: $line-height-medium;
.second-line {
display: flex;
flex-wrap: wrap;
align-items: center;
.discourse-tags {
flex-wrap: wrap;
display: contents;
}
}
}
.topic-title {