UX: Always show avatar on mobile topic lists (#15323)

This commit is contained in:
Kris 2021-12-15 20:31:03 -05:00 committed by GitHub
parent 7039046d9e
commit ad4faf637c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 54 deletions

View File

@ -6,8 +6,6 @@ export default Component.extend({
loadingMore: alias("topicList.loadingMore"), loadingMore: alias("topicList.loadingMore"),
loading: not("loaded"), loading: not("loaded"),
hideMobileAvatar: true,
@discourseComputed("topicList.loaded") @discourseComputed("topicList.loaded")
loaded() { loaded() {
let topicList = this.topicList; let topicList = this.topicList;

View File

@ -195,11 +195,6 @@ export default Component.extend({
return false; return false;
}, },
@discourseComputed("expandPinned", "hideMobileAvatar")
showMobileAvatar(expandPinned, hideMobileAvatar) {
return !(hideMobileAvatar || expandPinned);
},
showEntrance, showEntrance,
click(e) { click(e) {

View File

@ -2,7 +2,6 @@
{{#if topics}} {{#if topics}}
{{topic-list {{topic-list
showPosters=showPosters showPosters=showPosters
hideMobileAvatar=hideMobileAvatar
hideCategory=hideCategory hideCategory=hideCategory
topics=topics topics=topics
expandExcerpts=expandExcerpts expandExcerpts=expandExcerpts

View File

@ -36,7 +36,6 @@
showTopicPostBadges=showTopicPostBadges showTopicPostBadges=showTopicPostBadges
hideCategory=hideCategory hideCategory=hideCategory
showPosters=showPosters showPosters=showPosters
hideMobileAvatar=hideMobileAvatar
showLikes=showLikes showLikes=showLikes
showOpLikes=showOpLikes showOpLikes=showOpLikes
expandGloballyPinned=expandGloballyPinned expandGloballyPinned=expandGloballyPinned

View File

@ -1,55 +1,51 @@
<td class="topic-list-data"> <td class="topic-list-data">
{{~raw-plugin-outlet name="topic-list-before-columns"}} {{~raw-plugin-outlet name="topic-list-before-columns"}}
{{~#if showMobileAvatar}}
<div class='pull-left'> <div class='pull-left'>
<a href="{{topic.lastPostUrl}}" data-user-card="{{topic.last_poster_username}}">{{avatar topic.lastPosterUser imageSize="large"}}</a> <a href="{{topic.lastPostUrl}}" data-user-card="{{topic.last_poster_username}}">{{avatar topic.lastPosterUser imageSize="large"}}</a>
</div> </div>
<div class='right'> <div class='right'>
{{else}} {{!--
<div> The `~` syntax strip spaces between the elements, making it produce
{{/if~}} `<a class=topic-post-badges>Some text</a><span class=topic-post-badges>`,
{{!-- with no space between them.
The `~` syntax strip spaces between the elements, making it produce This causes the topic-post-badge to be considered the same word as "text"
`<a class=topic-post-badges>Some text</a><span class=topic-post-badges>`, at the end of the link, preventing it from line wrapping onto its own line.
with no space between them. --}}
This causes the topic-post-badge to be considered the same word as "text" {{~raw-plugin-outlet name="topic-list-before-link"}}
at the end of the link, preventing it from line wrapping onto its own line. <div class='main-link'>
--}} {{~raw-plugin-outlet name="topic-list-before-status"}}
{{~raw-plugin-outlet name="topic-list-before-link"}} {{~raw "topic-status" topic=topic~}}
<div class='main-link'> {{~topic-link topic class="raw-link raw-topic-link"}}
{{~raw-plugin-outlet name="topic-list-before-status"}} {{~#if topic.featured_link~}}
{{~raw "topic-status" topic=topic~}} {{~topic-featured-link topic~}}
{{~topic-link topic class="raw-link raw-topic-link"}} {{~/if~}}
{{~#if topic.featured_link~}} {{~raw-plugin-outlet name="topic-list-after-title"}}
{{~topic-featured-link topic~}} {{~#if topic.unseen~}}
{{~/if~}} <span class="topic-post-badges">&nbsp;<span class="badge-notification new-topic"></span></span>
{{~raw-plugin-outlet name="topic-list-after-title"}} {{~/if~}}
{{~#if topic.unseen~}} {{~#if expandPinned~}}
<span class="topic-post-badges">&nbsp;<span class="badge-notification new-topic"></span></span> {{~raw "list/topic-excerpt" topic=topic~}}
{{~/if~}} {{~/if~}}
{{~#if expandPinned~}} </div>
{{~raw "list/topic-excerpt" topic=topic~}} <div class='pull-right'>
{{~/if~}} {{raw "list/post-count-or-badges" topic=topic postBadgesEnabled=showTopicPostBadges}}
</div>
<div class="topic-item-stats clearfix">
{{#unless hideCategory}}
{{~raw-plugin-outlet name="topic-list-before-category"}}
<div class='category'>
{{category-link topic.category}}
</div> </div>
<div class='pull-right'> {{/unless}}
{{raw "list/post-count-or-badges" topic=topic postBadgesEnabled=showTopicPostBadges}} {{discourse-tags topic mode="list"}}
</div> <div class="pull-right">
<div class="topic-item-stats clearfix"> <div class='num activity last'>
{{#unless hideCategory}} <span class="age activity" title="{{topic.bumpedAtTitle}}"><a
{{~raw-plugin-outlet name="topic-list-before-category"}} href="{{topic.lastPostUrl}}">{{format-date topic.bumpedAt format="tiny" noTitle="true"}}</a>
<div class='category'> </span>
{{category-link topic.category}}
</div>
{{/unless}}
{{discourse-tags topic mode="list"}}
<div class="pull-right">
<div class='num activity last'>
<span class="age activity" title="{{topic.bumpedAtTitle}}"><a
href="{{topic.lastPostUrl}}">{{format-date topic.bumpedAt format="tiny" noTitle="true"}}</a>
</span>
</div>
</div>
<div class="clearfix"></div>
</div> </div>
</div> </div>
<div class="clearfix"></div>
</div>
</div>
</td> </td>