mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
reddit header: format karma number
In the top-right of every logged-in reddit page, we display the user's link karma. This number has been unformatted, which makes it a bit difficult to read at a glance as you gain a fair amount of karma. Now we'll format it with periods or commas, according to the locale.
This commit is contained in:
@@ -23,7 +23,12 @@
|
||||
<%!
|
||||
from pylons import request
|
||||
from r2.config import feature
|
||||
from r2.lib.template_helpers import add_sr, display_link_karma, header_url
|
||||
from r2.lib.template_helpers import (
|
||||
add_sr,
|
||||
display_link_karma,
|
||||
format_number,
|
||||
header_url,
|
||||
)
|
||||
from r2.models import Sub, FakeSubreddit
|
||||
from r2.models.subreddit import DefaultSR
|
||||
from r2.lib.pages import SearchForm
|
||||
@@ -78,7 +83,7 @@
|
||||
%else:
|
||||
<span class="user">
|
||||
${plain_link(c.user.name, "/user/%s/" % c.user.name, _sr_path=False)}
|
||||
(<span class="userkarma" title="${_("link karma")}">${display_link_karma(c.user.link_karma)}</span>)
|
||||
(<span class="userkarma" title="${_("link karma")}">${format_number(display_link_karma(c.user.link_karma))}</span>)
|
||||
</span>
|
||||
|
||||
${separator("|")}
|
||||
|
||||
Reference in New Issue
Block a user