This commit is contained in:
r888888888
2015-06-25 13:51:05 -07:00
parent 3cc7dbbedc
commit 1d9596d7f2
64 changed files with 244 additions and 140 deletions

View File

@@ -8,7 +8,7 @@
<th width="5%">Post</th>
<th>Original</th>
<th>Translated</th>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<th width="10%">IP Address</th>
<% end %>
<th width="10%">Edited By</th>
@@ -30,7 +30,7 @@
<h3><%= h(commentary_version.translated_title) %></h3>
<%= h(commentary_version.translated_description) %>
</td>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<td>
<%= commentary_version.updater_ip_addr %>
</td>

View File

@@ -11,7 +11,7 @@
<th>Group</th>
<th>Updated</th>
<th>Updated by</th>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<th>IP Address</th>
<% end %>
<th>Active</th>
@@ -31,7 +31,7 @@
<td><%= artist_version.group_name %></td>
<td><%= compact_time artist_version.created_at %></td>
<td><%= link_to_user artist_version.updater %></td>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<td>
<%= artist_version.updater_ip_addr %>
</td>

View File

@@ -1,4 +1,4 @@
<% if CurrentUser.is_janitor? || !forum_post.is_deleted? %>
<% if CurrentUser.is_moderator? || !forum_post.is_deleted? %>
<article class="forum-post" id="forum_post_<%= forum_post.id %>" data-forum-post-id="<%= forum_post.id %>" data-creator="<%= forum_post.creator.name %>">
<div class="author">
<h4>
@@ -23,7 +23,7 @@
<% if CurrentUser.is_member? && @forum_topic %>
<li><%= link_to "Quote", new_forum_post_path(:post_id => forum_post.id), :method => :get, :remote => true %></li>
<% end %>
<% if CurrentUser.is_janitor? && !forum_post.is_original_post? %>
<% if CurrentUser.is_moderator? && !forum_post.is_original_post? %>
<% if forum_post.is_deleted %>
<li><%= link_to "Undelete", undelete_forum_post_path(forum_post.id), :method => :post, :remote => true %></li>
<% else %>

View File

@@ -11,7 +11,7 @@
</thead>
<tbody>
<% @forum_posts.each do |forum_post| %>
<% if CurrentUser.is_janitor? || !forum_post.is_deleted? %>
<% if CurrentUser.is_moderator? || !forum_post.is_deleted? %>
<tr>
<td><%= link_to forum_post.topic.title, forum_topic_path(forum_post.topic) %></td>
<td>

View File

@@ -17,7 +17,7 @@
<%= dtext_field "forum_post", "body", :input_name => "forum_topic[original_post_attributes][body]", :value => forum_topic.original_post.body, :input_id => "forum_post_body_for_#{forum_topic.original_post.id}", :preview_id => "dtext-preview-for-#{forum_topic.original_post.id}" %>
<% end %>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<%= f.input :is_sticky %>
<%= f.input :is_locked %>
<% end %>

View File

@@ -20,7 +20,7 @@
<% end %>
<% if !@forum_topic.new_record? && @forum_topic.editable_by?(CurrentUser.user) %>
<li><%= link_to "Edit", edit_forum_topic_path(@forum_topic) %></li>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<% if @forum_topic.is_deleted? %>
<li><%= link_to "Undelete", undelete_forum_topic_path(@forum_topic), :method => :post %></li>
<% else %>

View File

@@ -18,7 +18,7 @@
<%= render "forum_posts/listing", :forum_posts => @forum_posts %>
<% if CurrentUser.is_member? %>
<% if CurrentUser.is_janitor? || !@forum_topic.is_locked? %>
<% if CurrentUser.is_moderator? || !@forum_topic.is_locked? %>
<p><%= link_to "Reply &raquo;".html_safe, new_forum_post_path(:topic_id => @forum_topic.id), :id => "new-response-link" %></p>
<div style="display: none;" id="topic-response">

View File

@@ -1,5 +1,5 @@
<menu class="main">
<% if CurrentUser.user.is_anonymous? %>
<% if CurrentUser.is_anonymous? %>
<%= nav_link_to("Sign in", new_session_path, :class => "login") %>
<% else %>
<%= nav_link_to("My Account #{CurrentUser.dmail_count}", user_path(CurrentUser.user)) %>
@@ -15,8 +15,8 @@
<% end %>
<%= 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_janitor? %>
<%= nav_link_to("Forum", forum_topics_path, :class => (CurrentUser.has_forum_been_updated? ? "forum-updated" : nil)) %>
<% if CurrentUser.is_moderator? %>
<%= nav_link_to("Dashboard", moderator_dashboard_path) %>
<% end %>
<%= nav_link_to("More &raquo;".html_safe, site_map_path, :id => "site-map-link") %>

View File

@@ -74,7 +74,7 @@
| <%= link_to "Approve", approve_tag_alias_path(tag_alias), :remote => true, :method => :post %>
<% end %>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.is_builder? %>
| <%= link_to "Fix", tag_alias_correction_path(:tag_alias_id => tag_alias.id) %>
<% end %>
</td>

View File

@@ -10,7 +10,7 @@
<th width="5%">Note</th>
<th>Body</th>
<th width="5%">Position</th>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<th width="10%">IP Address</th>
<% end %>
<th width="10%">Edited By</th>
@@ -36,7 +36,7 @@
<td>
<%= note_version_position_diff(note_version) %>
</td>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<td>
<%= note_version.updater_ip_addr %>
</td>

View File

@@ -9,7 +9,7 @@
<th>Post Count</th>
<th>Changes</th>
<th>Updater</th>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<th>IP Address</th>
<% end %>
<th>Date</th>
@@ -25,7 +25,7 @@
<td><%= link_to pool_version.post_id_array.size, pool_versions_path(:search => {:pool_id => pool_version.pool_id}) %></td>
<td><%= pool_version_diff(pool_version) %></td>
<td><%= link_to_user pool_version.updater%></td>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<td>
<%= pool_version.updater_ip_addr %>
</td>

View File

@@ -19,7 +19,7 @@
</td>
</tr>
<% if CurrentUser.user.is_janitor? %>
<% if CurrentUser.user.is_moderator? %>
<tr>
<th><label for="search_creator_name">Creator</th>
<td>

View File

@@ -7,7 +7,7 @@
<thead>
<tr>
<th width="1%"></th>
<% if CurrentUser.user.is_janitor? %>
<% if CurrentUser.user.is_moderator? %>
<th width="10%">Creator</th>
<% end %>
<th>Reason</th>
@@ -18,7 +18,7 @@
<% @post_flags.each do |post_flag| %>
<tr class="resolved-<%= post_flag.is_resolved? %>">
<td><%= PostPresenter.preview(post_flag.post, :tags => "status:any") %></td>
<% if CurrentUser.user.is_janitor? %>
<% if CurrentUser.user.is_moderator? %>
<td>
<%= link_to_user post_flag.creator %>
</td>

View File

@@ -7,7 +7,7 @@
<th width="10%">User</th>
<th width="5%">Rating</th>
<th width="5%">Parent</th>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<th width="10%">IP Address</th>
<% end %>
<th>Tags</th>
@@ -28,7 +28,7 @@
</td>
<td><%= post_version.rating %></td>
<td><%= post_version.parent_id %></td>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<td>
<%= post_version.updater_ip_addr %>
</td>

View File

@@ -7,13 +7,13 @@
<% unless CurrentUser.is_anonymous? %>
<li><%= link_to "Favorites", favorites_path %></li>
<li><%= link_to "Favorite groups", favorite_groups_path %></li>
<% if CurrentUser.user.has_saved_searches? %>
<% if CurrentUser.has_saved_searches? %>
<li><%= link_to "Saved searches", saved_searches_path %></li>
<% end %>
<li><%= link_to "Subscriptions", posts_path(:tags => "sub:#{CurrentUser.name}") %></li>
<% end %>
<li class="nonessential"><%= link_to "Changes", post_versions_path %></li>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.can_approve_posts? %>
<li class="nonessential"><%= link_to "Moderate", moderator_post_queue_path %></li>
<% end %>
<li class="nonessential"><%= link_to "Help", wiki_pages_path(:title => "help:posts") %></li>

View File

@@ -17,7 +17,7 @@
<option value="lock-rating">Lock rating</option>
<option value="lock-note">Lock notes</option>
<% end %>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.can_approve_posts? %>
<option value="approve">Approve</option>
<% end %>
</select>

View File

@@ -27,7 +27,7 @@
<div class="ui-corner-all ui-state-highlight notice notice-pending" id="pending-approval-notice">
This post is pending approval (<%= link_to "learn more", wiki_pages_path(:title => "about:mod_queue") %>)
<% if CurrentUser.is_janitor? && !post.disapproved_by?(CurrentUser.user) %>
<% if CurrentUser.can_approve_posts? && !post.disapproved_by?(CurrentUser.user) %>
<div class="quick-mod">
<% unless post.is_status_locked? %>
<%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :method => :post, :remote => true, :class => "btn" %> |

View File

@@ -28,7 +28,7 @@
<li><%= link_to "Appeal", new_post_appeal_path(:post_id => post.id), :id => "appeal" %></li>
<% end %>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.can_approve_posts? %>
<% if post.is_deleted? %>
<li><%= link_to "Undelete", undelete_moderator_post_post_path(:post_id => post.id), :remote => true, :method => :post, :id => "undelete" %></li>
<% else %>

View File

@@ -11,7 +11,7 @@
<li><%= link_to("Upload Listing", uploads_path) %></li>
<li><%= link_to("Appeals", post_appeals_path) %></li>
<li><%= link_to("Flags", post_flags_path) %></li>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.can_approve_posts? %>
<li><%= link_to("Moderate", moderator_post_queue_path) %></li>
<% end %>
<% if CurrentUser.is_admin? %>
@@ -87,7 +87,7 @@
<section>
<ul>
<li><h1>Users</h1></li>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.can_approve_posts? %>
<li><%= link_to("Dashboard", moderator_dashboard_path) %></li>
<% end %>
<li><%= link_to("Help", wiki_pages_path(:title => "help:users")) %></li>

View File

@@ -36,7 +36,7 @@
| <%= link_to "Approve", approve_tag_alias_path(tag_alias), :remote => true, :method => :post %>
<% end %>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.is_builder? %>
| <%= link_to "Fix", tag_alias_correction_path(:tag_alias_id => tag_alias.id) %>
<% end %>
</td>

View File

@@ -9,7 +9,7 @@
<%= f.input :category, :collection => Danbooru.config.canonical_tag_category_mapping.to_a, :include_blank => false %>
<% end %>
<% if CurrentUser.user.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<%= f.input :is_locked, :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false %>
<% end %>

View File

@@ -94,14 +94,14 @@
<td><%= presenter.comment_count(self) %> in <%= presenter.commented_posts_count(self) %> posts</td>
</tr>
<% if CurrentUser.user.id == user.id || CurrentUser.user.is_janitor? %>
<% if CurrentUser.user.id == user.id || CurrentUser.is_moderator? %>
<tr>
<th>Appeals</th>
<td><%= presenter.appeal_count(self) %></td>
</tr>
<% end %>
<% if CurrentUser.user.id == user.id || CurrentUser.user.is_janitor? %>
<% if CurrentUser.user.id == user.id || CurrentUser.is_moderator? %>
<tr>
<th>Flags</th>
<td><%= presenter.flag_count(self) %></td>
@@ -126,7 +126,7 @@
</td>
</tr>
<% if CurrentUser.user.is_janitor? && presenter.previous_names.present? %>
<% if CurrentUser.is_moderator? && presenter.previous_names.present? %>
<tr>
<th>Previous Names</th>
<td><%= presenter.previous_names %></td>

View File

@@ -14,7 +14,7 @@
<th>Name</th>
<th>Posts</th>
<th>Deleted</th>
<% if CurrentUser.user.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<th><abbr title="3+ Score Binomial Confidence Interval">5+ SBCI</abbr></th>
<th><abbr title="6+ Score Binomial Confidence Interval">10+ SBCI</abbr></th>
<% end %>
@@ -40,7 +40,7 @@
</td>
<td><%= link_to user.posts.count, posts_path(:tags => "user:#{user.name}") %></td>
<td><%= user.posts.deleted.count %></td>
<% if CurrentUser.user.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<td><%= number_to_percentage Reports::UserPromotions.confidence_interval_for(user, 3), :precision => 0 %></td>
<td><%= number_to_percentage Reports::UserPromotions.confidence_interval_for(user, 6), :precision => 0 %></td>
<% end %>

View File

@@ -16,7 +16,7 @@
<% end %>
<th>Title</th>
<th width="5%"></th>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<th width="10%">IP Address</th>
<% end %>
<th width="26%">Last edited</th>
@@ -50,7 +50,7 @@
<% end %>
<td class="category-<%= wiki_page_version.category_name %>"><%= link_to wiki_page_version.title, wiki_page_version_path(wiki_page_version) %></td>
<td><%= link_to "wiki", wiki_page_path(wiki_page_version.wiki_page_id) %></td>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<td>
<%= wiki_page_version.updater_ip_addr %>
</td>

View File

@@ -18,7 +18,7 @@
<%= dtext_field "wiki_page", "body" %>
<% if CurrentUser.user.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<%= f.input :is_locked %>
<% end %>

View File

@@ -18,7 +18,7 @@
<% if CurrentUser.is_member? %>
<li><%= link_to "Edit", edit_wiki_page_path(@wiki_page), :id => "wiki-page-edit-link" %></li>
<% end %>
<% if CurrentUser.is_janitor? %>
<% if CurrentUser.is_moderator? %>
<li><%= link_to "Delete", wiki_page_path(@wiki_page), :remote => true, :method => :delete, :data => {:confirm => "Are you sure you want to delete this wiki page?"} %></li>
<% end %>
<% end %>