shorter post counts

This commit is contained in:
albert
2011-12-07 17:15:23 -05:00
parent 207f7de02f
commit 09183042c8

View File

@@ -54,7 +54,13 @@ private
html << %{<a class="search-tag" href="#{path}?tags=#{u(tag)}">#{h(humanized_tag)}</a> }
unless options[:name_only]
html << %{<span class="post-count">} + counts[tag].to_s + %{</span>}
if counts[tag].to_i > 1_000
post_count = "#{counts[tag].to_i / 1_000}k"
else
post_count = counts[tag].to_s
end
html << %{<span class="post-count">#{post_count}</span>}
end
html << "</li>"