From ca4cba76353f62ec8900f53960be1dce813ebdaa Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 19 Sep 2019 04:41:00 -0500 Subject: [PATCH] views: remove tag size indicator bars from /tags. Remove tag size indicator bars. These bars don't play nicely with dark mode and aren't all that useful to begin with. --- app/helpers/tags_helper.rb | 6 ------ app/models/tag.rb | 6 ------ app/views/tags/index.html.erb | 2 +- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb index 41b43a51a..d0d754482 100644 --- a/app/helpers/tags_helper.rb +++ b/app/helpers/tags_helper.rb @@ -37,10 +37,4 @@ module TagsHelper html.html_safe end - - def tag_post_count_style(tag) - @highest_post_count ||= Tag.highest_post_count - width_percent = Math.log([tag.post_count, 1].max, @highest_post_count) * 100 - "background: linear-gradient(to left, #DDD #{width_percent}%, white #{width_percent}%)" - end end diff --git a/app/models/tag.rb b/app/models/tag.rb index 2785325a0..eaeb1fe79 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -91,12 +91,6 @@ class Tag < ApplicationRecord extend ActiveSupport::Concern module ClassMethods - def highest_post_count - Cache.get("highest-post-count", 4.hours) do - select("post_count").order("post_count DESC").first.post_count - end - end - def increment_post_counts(tag_names) Tag.where(:name => tag_names).update_all("post_count = post_count + 1") end diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb index 0a6d6fa08..c09eaa3aa 100644 --- a/app/views/tags/index.html.erb +++ b/app/views/tags/index.html.erb @@ -12,7 +12,7 @@ <% @tags.each do |tag| %> - <%= tag.post_count %> + <%= tag.post_count %> <%= link_to("?", show_or_new_wiki_pages_path(:title => tag.name)) %> <%= link_to(tag.name, posts_path(:tags => tag.name)) %>