From 7141ba8129edd17091a5e6154af6f2f5a22bba22 Mon Sep 17 00:00:00 2001 From: Toks Date: Sun, 14 Jul 2013 00:19:02 -0400 Subject: [PATCH] Include tags with exactly 1000 posts when shortening --- app/assets/javascripts/posts.js | 2 +- app/presenters/tag_set_presenter.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/posts.js b/app/assets/javascripts/posts.js index e6665c117..095d084b7 100644 --- a/app/assets/javascripts/posts.js +++ b/app/assets/javascripts/posts.js @@ -148,7 +148,7 @@ var $link = $("").addClass("tag-type-" + tag.category).text(tag.label); var count; - if (tag.post_count > 1000) { + if (tag.post_count >= 1000) { count = Math.floor(tag.post_count / 1000) + "k"; } else { count = tag.post_count; diff --git a/app/presenters/tag_set_presenter.rb b/app/presenters/tag_set_presenter.rb index f8a368009..7e267dead 100644 --- a/app/presenters/tag_set_presenter.rb +++ b/app/presenters/tag_set_presenter.rb @@ -115,7 +115,7 @@ private html << %{#{h(humanized_tag)} } unless options[:name_only] - if counts[tag].to_i > 1_000 + if counts[tag].to_i >= 1_000 post_count = "#{counts[tag].to_i / 1_000}k" else post_count = counts[tag].to_s