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.
This commit is contained in:
evazion
2019-09-19 04:41:00 -05:00
parent 828b225dac
commit ca4cba7635
3 changed files with 1 additions and 13 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -12,7 +12,7 @@
<tbody>
<% @tags.each do |tag| %>
<tr>
<td style="<%= tag_post_count_style(tag) %>"><%= tag.post_count %></td>
<td><%= tag.post_count %></td>
<td class="category-<%= tag.category %>">
<%= link_to("?", show_or_new_wiki_pages_path(:title => tag.name)) %>
<%= link_to(tag.name, posts_path(:tags => tag.name)) %>