reports: add more reportable tables.
This commit is contained in:
@@ -24,11 +24,36 @@ class ReportsController < ApplicationController
|
||||
@title = "Posts Report"
|
||||
@available_columns = { posts: "COUNT(*)", uploaders: "COUNT(distinct uploader_id)" }
|
||||
@available_groups = %w[uploader approver rating is_deleted]
|
||||
when "post_approvals"
|
||||
@model = PostApproval
|
||||
@title = "Post Approvals Report"
|
||||
@available_columns = { approvals: "COUNT(*)", approvers: "COUNT(distinct user_id)" }
|
||||
@available_groups = %w[user]
|
||||
when "post_appeals"
|
||||
@model = PostAppeal
|
||||
@title = "Post Appeals Report"
|
||||
@available_columns = { appeals: "COUNT(*)", appealers: "COUNT(distinct creator_id)" }
|
||||
@available_groups = %w[creator status]
|
||||
when "post_flags"
|
||||
@model = PostFlag
|
||||
@title = "Post Flags Report"
|
||||
@available_columns = { flags: "COUNT(*)", flaggers: "COUNT(distinct creator_id)" }
|
||||
@available_groups = %w[status]
|
||||
when "post_replacements"
|
||||
@model = PostReplacement
|
||||
@title = "Post Replacements Report"
|
||||
@available_columns = { replacements: "COUNT(*)", replacers: "COUNT(distinct creator_id)" }
|
||||
@available_groups = %w[creator]
|
||||
when "post_votes"
|
||||
@model = PostVote
|
||||
@title = "Post Votes Report"
|
||||
@available_columns = { votes: "COUNT(*)", posts: "COUNT(distinct post_id)", voters: "COUNT(distinct user_id)" }
|
||||
@available_groups = %w[]
|
||||
when "media_assets"
|
||||
@model = MediaAsset
|
||||
@title = "Media Assets Report"
|
||||
@available_columns = { assets: "COUNT(*)", size: "SUM(file_size)", duration: "SUM(duration)" }
|
||||
@available_groups = %w[file_ext status]
|
||||
when "pools"
|
||||
@model = Pool
|
||||
@title = "Pools Report"
|
||||
@@ -69,6 +94,11 @@ class ReportsController < ApplicationController
|
||||
@title = "Artist Edits Report"
|
||||
@available_columns = { artist_edits: "COUNT(*)", artists: "COUNT(distinct artist_id)", editors: "COUNT(distinct updater_id)" }
|
||||
@available_groups = %w[updater]
|
||||
when "artist_commentary_versions"
|
||||
@model = ArtistCommentaryVersion
|
||||
@title = "Artist Commentary Edits Report"
|
||||
@available_columns = { commentary_edits: "COUNT(*)", editors: "COUNT(distinct updater_id)" }
|
||||
@available_groups = %w[updater]
|
||||
when "note_versions"
|
||||
@model = NoteVersion
|
||||
@title = "Note Edits Report"
|
||||
@@ -79,16 +109,21 @@ class ReportsController < ApplicationController
|
||||
@title = "Wiki Edits Report"
|
||||
@available_columns = { wiki_edits: "COUNT(*)", editors: "COUNT(distinct updater_id)" }
|
||||
@available_groups = %w[updater]
|
||||
when "users"
|
||||
@model = User
|
||||
@title = "New Users Report"
|
||||
@available_columns = { users: "COUNT(*)" }
|
||||
@available_groups = %w[level]
|
||||
when "mod_actions"
|
||||
@model = ModAction
|
||||
@title = "Mod Actions Report"
|
||||
@available_columns = { mod_actions: "COUNT(*)", creators: "COUNT(distinct creator_id)" }
|
||||
@available_groups = %w[creator category subject_type]
|
||||
when "bans"
|
||||
@model = Ban
|
||||
@title = "Bans Report"
|
||||
@available_columns = { bans: "COUNT(*)", banners: "COUNT(DISTINCT banner_id)" }
|
||||
@available_groups = %w[banner duration]
|
||||
when "users"
|
||||
@model = User
|
||||
@title = "New Users Report"
|
||||
@available_columns = { users: "COUNT(*)" }
|
||||
@available_groups = %w[level]
|
||||
else
|
||||
raise ActiveRecord::RecordNotFound
|
||||
end
|
||||
|
||||
@@ -6,7 +6,12 @@
|
||||
|
||||
<ul class="list-bulleted">
|
||||
<li><%= link_to "Posts", report_path("posts") %></li>
|
||||
<li><%= link_to "Post approvals", report_path("post_approvals") %></li>
|
||||
<li><%= link_to "Post appeals", report_path("post_appeals") %></li>
|
||||
<li><%= link_to "Post flags", report_path("post_flags") %></li>
|
||||
<li><%= link_to "Post replacements", report_path("post_replacements") %></li>
|
||||
<li><%= link_to "Post votes", report_path("post_votes") %></li>
|
||||
<li><%= link_to "Media assets", report_path("media_assets") %></li>
|
||||
<li><%= link_to "Pools", report_path("pools") %></li>
|
||||
<li><%= link_to "Comments", report_path("comments") %></li>
|
||||
<li><%= link_to "Comment votes", report_path("comment_votes") %></li>
|
||||
@@ -15,10 +20,12 @@
|
||||
<li><%= link_to "Tag aliases", report_path("tag_aliases") %></li>
|
||||
<li><%= link_to "Tag implications", report_path("tag_implications") %></li>
|
||||
<li><%= link_to "Artist edits", report_path("artist_versions") %></li>
|
||||
<li><%= link_to "Artist commentary edits", report_path("artist_commentary_versions") %></li>
|
||||
<li><%= link_to "Note edits", report_path("note_versions") %></li>
|
||||
<li><%= link_to "Wiki edits", report_path("wiki_page_versions") %></li>
|
||||
<li><%= link_to "New users", report_path("users") %></li>
|
||||
<li><%= link_to "Mod actions", report_path("mod_actions") %></li>
|
||||
<li><%= link_to "Bans", report_path("bans") %></li>
|
||||
<li><%= link_to "Users", report_path("users") %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user