diff --git a/app/assets/stylesheets/moderators.scss b/app/assets/stylesheets/moderators.scss
index e3e321902..77d7fed8c 100644
--- a/app/assets/stylesheets/moderators.scss
+++ b/app/assets/stylesheets/moderators.scss
@@ -7,7 +7,10 @@
text-align: center;
background: #d4fffe;
h1 {
- font-size: 4em;
+ font-size: calc(1.8em + 2vw);
+ }
+ h2 {
+ font-size: calc(0.9em + 1vw);
}
a {
text-decoration: underline;
@@ -39,6 +42,9 @@
}
}
}
+ .mod-index-hero-sub {
+ font-size: 0.9em;
+ }
}
.mod-index-header {
diff --git a/app/controllers/moderations_controller.rb b/app/controllers/moderations_controller.rb
index c5c9bca39..19375e3c1 100644
--- a/app/controllers/moderations_controller.rb
+++ b/app/controllers/moderations_controller.rb
@@ -11,7 +11,7 @@ class ModerationsController < ApplicationController
@articles = @articles.cached_tagged_with(params[:tag]) if params[:tag].present?
@articles = @articles.where("nth_published_by_author > 0 AND nth_published_by_author < 4 AND published_at > ?", 7.days.ago) if params[:state] == "new-authors"
@articles = @articles.decorate
- @tag = Tag.find_by(name: params[:tag])
+ @tag = Tag.find_by(name: params[:tag]) || not_found if params[:tag].present?
end
def article
diff --git a/app/views/moderations/index.html.erb b/app/views/moderations/index.html.erb
index c1c09cb94..642fbe615 100644
--- a/app/views/moderations/index.html.erb
+++ b/app/views/moderations/index.html.erb
@@ -12,29 +12,34 @@
}
<% end %>
-
-
<%= "#" + @tag.name.titleize if @tag %> Moderators
-
We build the <%= ApplicationConfig["COMMUNITY_NAME"] %> Community
-
-
- <%= number_with_delimiter(@tag ? Article.cached_tagged_with(@tag).published.where("published_at > ?", 7.days.ago).size : Article.published.where("published_at > ?", 7.days.ago).size) %>
+ <% cache("mod-data-header-#{params[:tag]}", expires_in: 6.hours) do %>
+
+
<%= "#" + @tag.name.titleize if @tag %> Moderators
+
We build the <%= ApplicationConfig["COMMUNITY_NAME"] %> Community
+
+
+ <%= number_with_delimiter(@tag ? Article.cached_tagged_with(@tag).published.where("published_at > ?", 7.days.ago).size : Article.published.where("published_at > ?", 7.days.ago).size) %>
+
+ Posts This Week
- Posts This Week
-
- <% plucked_article_ids = Article.cached_tagged_with(@tag).pluck(:id) if @tag %>
-
-
- <%= number_with_delimiter(@tag ? Comment.where(commentable_id: plucked_article_ids ).where("created_at > ?", 7.days.ago).size : Comment.where("created_at > ?", 7.days.ago).size) %>
+ <% plucked_article_ids = Article.cached_tagged_with(@tag).pluck(:id) if @tag %>
+
+
+ <%= number_with_delimiter(@tag ? Comment.where(commentable_id: plucked_article_ids ).where("created_at > ?", 7.days.ago).size : Comment.where("created_at > ?", 7.days.ago).size) %>
+
+ Comments This Week
- Comments This Week
-
-
-
- <%= number_with_delimiter(@tag ? Reaction.where(reactable_id: plucked_article_ids ).where("created_at > ?", 7.days.ago).size : Reaction.where("created_at > ?", 7.days.ago).size) %>
+
+
+ <%= number_with_delimiter(@tag ? Reaction.where(reactable_id: plucked_article_ids ).where("created_at > ?", 7.days.ago).size : Reaction.where("created_at > ?", 7.days.ago).size) %>
+
+ Reactions This Week
+
+
+ Data as of <%= Time.current %>
- Reactions This Week
-
+ <% end %>