UX: better tooltip for read time on user cards

This commit is contained in:
Neil Lalonde 2017-11-20 11:55:22 -05:00
parent 28073413eb
commit 8496191f0b
3 changed files with 13 additions and 3 deletions

View File

@ -98,6 +98,15 @@ export default Ember.Component.extend(CleansUp, {
return durationTiny(recentTimeReadSeconds);
},
@computed('showRecentTimeRead', 'user.time_read', 'recentTimeRead')
timeReadTooltip(showRecent, timeRead, recentTimeRead) {
if (showRecent) {
return I18n.t('time_read_recently_tooltip', {time_read: durationTiny(timeRead), recent_time_read: recentTimeRead});
} else {
return I18n.t('time_read_tooltip', {time_read: durationTiny(timeRead)});
}
},
_show(username, $target) {
// No user card for anon
if (this.siteSettings.hide_user_profiles_from_public && !this.currentUser) {

View File

@ -118,11 +118,11 @@
<h3><span class='desc'>{{i18n 'last_post'}}</span> {{format-date user.last_posted_at leaveAgo="true"}}</h3>
{{/if}}
<h3><span class='desc'>{{i18n 'joined'}}</span> {{format-date user.created_at leaveAgo="true"}}</h3>
<h3>
<h3 title="{{timeReadTooltip}}">
<span class='desc'>{{i18n 'time_read'}}</span>
{{format-duration user.time_read}}
{{#if showRecentTimeRead}}
<span title="{{i18n 'time_read_recently_tooltip' time_read=recentTimeRead}}">({{i18n 'time_read_recently' time_read=recentTimeRead}})</span>
<span>({{i18n 'time_read_recently' time_read=recentTimeRead}})</span>
{{/if}}
</h3>
{{plugin-outlet name="user-card-metadata" args=(hash user=user)}}

View File

@ -1016,7 +1016,8 @@ en:
last_post: Posted
time_read: Read
time_read_recently: '%{time_read} recently'
time_read_recently_tooltip: '%{time_read} read time in the last 60 days'
time_read_tooltip: '%{time_read} total time read'
time_read_recently_tooltip: '%{time_read} total time read (%{recent_time_read} in the last 60 days)'
last_reply_lowercase: last reply
replies_lowercase:
one: reply