mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-14 09:27:57 -05:00
CombinedSearch: Format numbers with commas
Add commas to subscriber counts, link scores, and comment counts using `format_number()`.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
<%namespace file="link.html" import="thumbnail" />
|
||||
|
||||
<%!
|
||||
from r2.lib.template_helpers import format_number
|
||||
from r2.lib.pages import WrappedUser
|
||||
%>
|
||||
|
||||
@@ -81,8 +82,8 @@
|
||||
cname=False,
|
||||
_class='search-subreddit-link may-blank',
|
||||
)} 
|
||||
<span class="search-score">${thing.score} ${ungettext('point', 'points', thing.score)},</span> 
|
||||
<span class="search-comments">${thing.num_comments} ${ungettext('comment', 'comments', thing.num_comments)},</span> 
|
||||
<span class="search-score">${format_number(thing.score)} ${ungettext('point', 'points', thing.score)},</span> 
|
||||
<span class="search-comments">${format_number(thing.num_comments)} ${ungettext('comment', 'comments', thing.num_comments)},</span> 
|
||||
<span class="search-time">submitted ${thing_timestamp(thing, thing.timesince, include_tense=True)}</span> 
|
||||
<span class="search-author">by ${WrappedUser(thing.author, thing.attribs, thing)}</span> 
|
||||
</%parent:search_result_meta>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<%namespace file="subscribebutton.html" import="subscribe_button" />
|
||||
|
||||
<%!
|
||||
from r2.lib.template_helpers import search_url
|
||||
from r2.lib.template_helpers import format_number, search_url
|
||||
from r2.lib.utils import timesince
|
||||
%>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
_class='search-subreddit-link may-blank',
|
||||
)} 
|
||||
%if not thing.score_hidden:
|
||||
<span class="search-subscribers">${thing._ups} ${ungettext('subscriber', 'subscribers', thing._ups)},</span> 
|
||||
<span class="search-subscribers">${format_number(thing._ups)} ${ungettext('subscriber', 'subscribers', thing._ups)},</span> 
|
||||
%endif
|
||||
<span class="search-time">${_("a community for %(time)s") % dict(time=timesince(thing._date))}</span> 
|
||||
</%parent:search_result_meta>
|
||||
|
||||
Reference in New Issue
Block a user