Add link counts to alt tags of their badges.

This commit is contained in:
Robin Ward 2014-03-07 14:43:29 -05:00
parent f5c3199b38
commit 055b367e2b
4 changed files with 6 additions and 4 deletions

View file

@ -60,7 +60,7 @@
<ul class='topic-links'>
{{#groupedEach infoLinks}}
<li>
<span class='badge badge-notification clicks' title='{{i18n topic_map.clicks}}'>{{clicks}}</span>
<span class='badge badge-notification clicks' title='{{i18n topic_map.clicks count=clicks}}'>{{clicks}}</span>
<a href="{{unbound url}}" target="_blank" class='topic-link track-link' data-user-id="{{unbound user_id}}" data-ignore-post-id="true" title="{{unbound url}}">
{{#if title}}{{title}}{{else}}{{shortenUrl url}}{{/if}}
{{#unless internal}}<i class='fa fa-external-link'></i>{{/unless}}

View file

@ -134,7 +134,7 @@ Discourse.PostView = Discourse.GroupedView.extend(Ember.Evented, {
// don't display badge counts on category badge
if (link.closest('.badge-category').length === 0 && (link.closest(".onebox-result").length === 0 || link.hasClass("track-link"))) {
link.append("<span class='badge badge-notification clicks' title='" +
I18n.t("topic_map.clicks") +
I18n.t("topic_map.clicks", {count: lc.clicks}) +
"'>" + Discourse.Formatter.number(lc.clicks) + "</span>");
}
}

View file

@ -29,7 +29,7 @@ class TopicLinkSerializer < ApplicationSerializer
end
def clicks
object['clicks'] || 0
object['clicks'].to_i
end
def user_id

View file

@ -1121,7 +1121,9 @@ en:
topic_map:
title: "Topic Summary"
links_shown: "show all {{totalLinks}} links..."
clicks: "clicks"
clicks:
one: "1 click"
other: "%{count} clicks"
topic_statuses:
locked: