A11Y: makes replies count a button and not a link (#12570)

This commit is contained in:
Joffrey JAFFEUX 2021-04-06 08:27:43 +02:00 committed by GitHub
parent 80be6e6949
commit f14e898f6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 7 deletions

View File

@ -1,7 +1,6 @@
import EmberObject from "@ember/object"; import EmberObject from "@ember/object";
import I18n from "I18n"; import I18n from "I18n";
import discourseComputed from "discourse-common/utils/decorators"; import discourseComputed from "discourse-common/utils/decorators";
import { fmt } from "discourse/lib/computed";
export default EmberObject.extend({ export default EmberObject.extend({
tagName: "td", tagName: "td",
@ -38,5 +37,10 @@ export default EmberObject.extend({
return ""; return "";
}, },
likesHeat: fmt("ratioText", "heatmap-%@"), @discourseComputed("ratioText")
likesHeat(ratioText) {
if (ratioText && ratioText.length) {
return `heatmap-${ratioText}`;
}
},
}); });

View File

@ -1,6 +1,6 @@
<{{view.tagName}} class='num posts-map posts {{view.likesHeat}}' title='{{view.title}}'> <{{view.tagName}} class='num posts-map posts {{view.likesHeat}}' title='{{view.title}}'>
<a href class='posts-map badge-posts {{view.likesHeat}}'> <button class="btn-link posts-map badge-posts {{view.likesHeat}}">
{{raw-plugin-outlet name="topic-list-before-reply-count"}} {{raw-plugin-outlet name="topic-list-before-reply-count"}}
{{number topic.replyCount noTitle="true" ariaLabel=view.title}} {{number topic.replyCount noTitle="true" ariaLabel=view.title}}
</a> </button>
</{{view.tagName}}> </{{view.tagName}}>

View File

@ -274,11 +274,15 @@
.num { .num {
text-align: center; text-align: center;
a:not(.badge-posts) {
a {
color: inherit; color: inherit;
} }
a.badge-posts {
font-weight: bold; .badge-posts {
font-weight: 700;
color: inherit;
padding: 15px 5px;
} }
} }