implemented moderator dashboard queue
This commit is contained in:
@@ -42,8 +42,9 @@
|
||||
<%= nav_link_to("Pools", pools_path) %>
|
||||
<%= nav_link_to("Wiki", wiki_pages_path(:title => "help:home")) %>
|
||||
<%= nav_link_to("Forum", forum_topics_path, :class => (CurrentUser.user.has_forum_been_updated? ? "forum-updated" : nil)) %>
|
||||
<% if CurrentUser.is_moderator? %>
|
||||
<% if CurrentUser.is_janitor? %>
|
||||
<%= nav_link_to("Dashboard", moderator_dashboard_path) %>
|
||||
<%= nav_link_to("Queue", moderator_post_dashboard_path) %>
|
||||
<% end %>
|
||||
<%= nav_link_to("»".html_safe, site_map_path) %>
|
||||
</menu>
|
||||
|
||||
25
app/views/moderator/dashboards/_activity_appeal.html.erb
Normal file
25
app/views/moderator/dashboards/_activity_appeal.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<table>
|
||||
<caption>Appeals</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Post</th>
|
||||
<th>User</th>
|
||||
<th>Flags</th>
|
||||
<th>Appeals</th>
|
||||
<th>Score</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @dashboard.appeals.each do |appeal| %>
|
||||
<tr>
|
||||
<td><%= link_to image_tag(appeal.post.preview_file_url), post_path(appeal.post) %></td>
|
||||
<td><%= mod_link_to_user appeal.post.uploader, :negative %></td>
|
||||
<td><%= post_flag_reasons(appeal.post) %></td>
|
||||
<td><%= post_appeal_reasons(appeal.post) %></td>
|
||||
<td><%= appeal.post.score %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p><%= link_to "View all appeals", post_appeals_path %></p>
|
||||
17
app/views/moderator/dashboards/_activity_artist.html.erb
Normal file
17
app/views/moderator/dashboards/_activity_artist.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<table>
|
||||
<caption>Artist Updates</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @dashboard.artists.each do |activity| %>
|
||||
<tr>
|
||||
<td><%= mod_link_to_user(activity.user, :positive) %></td>
|
||||
<td><%= link_to activity.count, artist_versions_path(:search => {:updater_id_eq => activity.user.id}) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
21
app/views/moderator/dashboards/_activity_comment.html.erb
Normal file
21
app/views/moderator/dashboards/_activity_comment.html.erb
Normal file
@@ -0,0 +1,21 @@
|
||||
<table>
|
||||
<caption>Comment Activity</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Comment</th>
|
||||
<th>User</th>
|
||||
<th>Votes</th>
|
||||
<th>Score</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @dashboard.comments.each do |activity| %>
|
||||
<tr>
|
||||
<td><%= link_to activity.comment.body, post_path(activity.comment.post_id) %></td>
|
||||
<td><%= mod_link_to_user(activity.comment.creator, :negative) %></td>
|
||||
<td><%= activity.count %></td>
|
||||
<td><%= activity.comment.score %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
19
app/views/moderator/dashboards/_activity_mod_action.html.erb
Normal file
19
app/views/moderator/dashboards/_activity_mod_action.html.erb
Normal file
@@ -0,0 +1,19 @@
|
||||
<table>
|
||||
<caption>Mod Actions</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Moderator</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @dashboard.mod_actions.each do |mod_action| %>
|
||||
<tr>
|
||||
<td><%= link_to mod_action.creator.name, user_path(mod_action.creator) %></td>
|
||||
<td><%= format_text(mod_action.description) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p><%= link_to "View all actions", mod_actions_path %></p>
|
||||
17
app/views/moderator/dashboards/_activity_note.html.erb
Normal file
17
app/views/moderator/dashboards/_activity_note.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<table>
|
||||
<caption>Note Updates</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @dashboard.notes.each do |activity| %>
|
||||
<tr>
|
||||
<td><%= mod_link_to_user(activity.user, :positive) %></td>
|
||||
<td><%= link_to activity.count, note_versions_path(:search => {:updater_id_eq => activity.user.id}) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
17
app/views/moderator/dashboards/_activity_tag.html.erb
Normal file
17
app/views/moderator/dashboards/_activity_tag.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<table>
|
||||
<caption>Tag Updates</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @dashboard.tags.each do |activity| %>
|
||||
<tr>
|
||||
<td><%= mod_link_to_user(activity.user, :positive) %></td>
|
||||
<td><%= link_to activity.count, post_versions_path(:search => {:updater_id_eq => activity.user.id}) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
17
app/views/moderator/dashboards/_activity_upload.html.erb
Normal file
17
app/views/moderator/dashboards/_activity_upload.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<table>
|
||||
<caption>Uploads</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @dashboard.posts.each do |activity| %>
|
||||
<tr>
|
||||
<td><%= mod_link_to_user(activity.user, :positive) %></td>
|
||||
<td><%= link_to activity.count, posts_path(:tags => "user:#{activity.user.name}") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,19 @@
|
||||
<table>
|
||||
<caption>User Feedback</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Message</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @dashboard.user_feedbacks.each do |record| %>
|
||||
<tr class="user-record-score-<%= record.category %>">
|
||||
<td><%= link_to(record.user.name, user_path(record.user)) %></td>
|
||||
<td><%= format_text(record.body) %></td>
|
||||
<td><%= time_ago_in_words(record.created_at) %> ago</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
17
app/views/moderator/dashboards/_activity_wiki_page.html.erb
Normal file
17
app/views/moderator/dashboards/_activity_wiki_page.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<table>
|
||||
<caption>Wiki Page Updates</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @dashboard.wiki_pages.each do |activity| %>
|
||||
<tr>
|
||||
<td><%= mod_link_to_user(activity.user, :positive) %></td>
|
||||
<td><%= link_to activity.count, wiki_page_versions_path(:search => {:updater_id_eq => activity.user.id}) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
7
app/views/moderator/dashboards/_search.html.erb
Normal file
7
app/views/moderator/dashboards/_search.html.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<div id="ip-addr-search">
|
||||
<%= render "search_ip_addr" %>
|
||||
</div>
|
||||
|
||||
<div id="activity-search">
|
||||
<%= render "search_activity" %>
|
||||
</div>
|
||||
9
app/views/moderator/dashboards/_search_activity.html.erb
Normal file
9
app/views/moderator/dashboards/_search_activity.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<% form_tag(moderator_dashboard_path, :method => :get) do %>
|
||||
<label for="min_date">Minimum Date</label>
|
||||
<%= text_field_tag :min_date, @dashboard.min_date %><br>
|
||||
|
||||
<label for="max_level">Max Level</label>
|
||||
<%= user_level_select_tag(:max_level) %><br>
|
||||
|
||||
<%= submit_tag "Search" %>
|
||||
<% end %>
|
||||
11
app/views/moderator/dashboards/_search_ip_addr.html.erb
Normal file
11
app/views/moderator/dashboards/_search_ip_addr.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<% form_tag(moderator_ip_addrs_path, :method => :get) do %>
|
||||
<label for="user_ids">Search IPs</label>
|
||||
<%= text_field_tag "search[ip_addr_eq]", params[:ip_addrs] %>
|
||||
<%= submit_tag "Search" %>
|
||||
<% end %>
|
||||
|
||||
<% form_tag(moderator_ip_addrs_path, :method => :get) do %>
|
||||
<label for="user_ids">Search User IDs</label>
|
||||
<%= text_field_tag "search[user_id_eq]", params[:user_ids] %>
|
||||
<%= submit_tag "Search" %>
|
||||
<% end %>
|
||||
@@ -1,222 +1,22 @@
|
||||
<div id="moderator-dashboard">
|
||||
<h1>Moderator Dashboard</h1>
|
||||
|
||||
<div id="ip-addr-search">
|
||||
<% form_tag(moderator_ip_addrs_path, :method => :get) do %>
|
||||
<label for="user_ids">Search IPs</label>
|
||||
<%= text_field_tag "search[ip_addr_eq]", params[:ip_addrs] %>
|
||||
<%= submit_tag "Search" %>
|
||||
<% end %>
|
||||
|
||||
<% form_tag(moderator_ip_addrs_path, :method => :get) do %>
|
||||
<label for="user_ids">Search User IDs</label>
|
||||
<%= text_field_tag "search[user_id_eq]", params[:user_ids] %>
|
||||
<%= submit_tag "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div id="activity-search">
|
||||
<% form_tag(moderator_dashboard_path, :method => :get) do %>
|
||||
<label for="min_date">Minimum Date</label>
|
||||
<%= text_field_tag :min_date, @dashboard.min_date %><br>
|
||||
|
||||
<label for="max_level">Max Level</label>
|
||||
<%= user_level_select_tag(:max_level) %><br>
|
||||
|
||||
<%= submit_tag "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div id="comment-activity">
|
||||
<table width="100%" class="striped">
|
||||
<caption>Uploads</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @dashboard.upload_activity.each do |activity| %>
|
||||
<tr>
|
||||
<td><%= admin_link_to_user(activity.user, :positive) %></td>
|
||||
<td><%= link_to activity.count, {:controller => "post", :action => "index", :tags => "user:#{activity.user.name}"} %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table width="100%" class="striped">
|
||||
<caption>Note Updates</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @dashboard.note_activity.each do |activity| %>
|
||||
<tr>
|
||||
<td><%= admin_link_to_user(activity.user, :positive) %></td>
|
||||
<td><%= link_to activity.count, {:controller => "note", :action => "history", :user_id => activity.user.id} %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<table width="100%" class="striped">
|
||||
<caption>Tag Updates</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @dashboard.tag_activity.each do |activity| %>
|
||||
<tr>
|
||||
<td><%= admin_link_to_user(activity.user, :positive) %></td>
|
||||
<td><%= link_to activity.count, {:controller => "post_tag_history", :action => "index", :user_id => activity.user.id} %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<table width="100%" class="striped">
|
||||
<caption>Wiki Page Updates</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @dashboard.wiki_page_activity.each do |activity| %>
|
||||
<tr>
|
||||
<td><%= admin_link_to_user(activity.user, :positive) %></td>
|
||||
<td><%= link_to activity.count, {:controller => "wiki", :action => "recent_changes", :user_id => activity.user.id} %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<table width="100%" class="striped">
|
||||
<caption>Artist Updates</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @dashboard.artist_activity.each do |activity| %>
|
||||
<tr>
|
||||
<td><%= admin_link_to_user(activity.user, :positive) %></td>
|
||||
<td><%= link_to activity.count, {:controller => "artist", :action => "recent_changes", :user_id => activity.user.id} %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<table width="100%" class="striped">
|
||||
<caption>Comment Activity (Negative)</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Comment</th>
|
||||
<th>User</th>
|
||||
<th>Votes</th>
|
||||
<th>Score</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @dashboard.comment_activity.each do |activity| %>
|
||||
<tr>
|
||||
<td><%= link_to activity.comment.body, :controller => "post", :action => "show", :id => activity.comment.post_id %></td>
|
||||
<td><%= admin_link_to_user(activity.comment.user, :negative) %></td>
|
||||
<td><%= activity.count %></td>
|
||||
<td><%= activity.comment.score %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="post-activity">
|
||||
<table width="100%" class="striped">
|
||||
<caption>Appealed Posts</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Post</th>
|
||||
<th>User</th>
|
||||
<th>Flags</th>
|
||||
<th>Appeals</th>
|
||||
<th>Score</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="5"><%= link_to "View all posts", :controller => "post_appeal", :action => "index" %></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<% @dashboard.appealed_posts.each do |appeal| %>
|
||||
<tr>
|
||||
<td><%= link_to image_tag(appeal.post.preview_url), :controller => "post", :action => "show", :id => appeal.post.id %></td>
|
||||
<td><%= admin_link_to_user appeal.post.user, :negative %></td>
|
||||
<td><%= post_flag_summary(appeal.post) %></td>
|
||||
<td><%= post_appeal_summary(appeal.post) %></td>
|
||||
<td><%= appeal.post.score %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="c-moderator-dashboards">
|
||||
<div id="a-show">
|
||||
<h1>Moderator Dashboard</h1>
|
||||
|
||||
<table width="100%" class="striped">
|
||||
<caption>User Records</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Message</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% UserRecord.recent(@dashboard.min_date).all(:order => "id desc").each do |record| %>
|
||||
<tr class="user-record-score-<%= record.score %>">
|
||||
<td><%= link_to(record.user.name, :controller => "user", :action => "show", :id => record.user_id) %></td>
|
||||
<td><%= format_text(record.body) %></td>
|
||||
<td><%= time_ago_in_words(record.created_at) %> ago</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<table width="100%" class="striped">
|
||||
<caption>Mod Actions</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Moderator</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2"><%= link_to "View all actions", :controller => "mod_action", :action => "index" %></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<% ModAction.all(:order => "id desc", :limit => 10).each do |mod_action| %>
|
||||
<tr>
|
||||
<td><%= link_to mod_action.user.name, :controller => "user", :action => "show", :id => mod_action.user_id %></td>
|
||||
<td><%= format_text(mod_action.description) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= render "search" %>
|
||||
|
||||
<div id="col1">
|
||||
<%= render "activity_upload" %>
|
||||
<%= render "activity_note" %>
|
||||
<%= render "activity_tag" %>
|
||||
<%= render "activity_wiki_page" %>
|
||||
<%= render "activity_artist" %>
|
||||
<%= render "activity_comment" %>
|
||||
</div>
|
||||
|
||||
<div id="col2">
|
||||
<%= render "activity_appeal" %>
|
||||
<%= render "activity_user_feedback" %>
|
||||
<%= render "activity_mod_action" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user