Users: add Contributor and Approver user levels
This commit is contained in:
@@ -7,8 +7,6 @@
|
||||
|
||||
<%= edit_form_for(@user, url: admin_user_path(@user)) do |f| %>
|
||||
<%= f.input :level, collection: User.level_hash.to_a, selected: @user.level %>
|
||||
<%= f.input :can_upload_free, label: "Unrestricted Uploads", as: :boolean, selected: @user.can_upload_free %>
|
||||
<%= f.input :can_approve_posts, label: "Approve Posts", as: :boolean, selected: @user.can_approve_posts %>
|
||||
<%= f.submit "Update" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<% if (CurrentUser.can_approve_posts? || post.created_at < Danbooru.config.moderation_period.ago) && disapprovals.length > 0 %>
|
||||
<% if (CurrentUser.is_approver? || post.created_at < Danbooru.config.moderation_period.ago) && disapprovals.length > 0 %>
|
||||
<% if disapprovals.map(&:reason).grep("breaks_rules").count > 0 %>
|
||||
(breaks rules: <%= disapprovals.map(&:reason).grep("breaks_rules").count %>)
|
||||
<% end %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<% if (CurrentUser.can_approve_posts? || post.created_at < Danbooru.config.moderation_period.ago) && disapprovals.length > 0 %>
|
||||
<% if (CurrentUser.is_approver? || post.created_at < Danbooru.config.moderation_period.ago) && disapprovals.length > 0 %>
|
||||
<p>
|
||||
It has been reviewed by <%= pluralize disapprovals.length, "approver" %>.
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<%= embed_wiki("help:upload_notice", id: "upload-guide-notice") %>
|
||||
|
||||
<% unless CurrentUser.can_upload_free? %>
|
||||
<% unless CurrentUser.is_contributor? %>
|
||||
<p id="upload-limit">Upload Limit: <%= render "users/upload_limit", user: CurrentUser.user %></p>
|
||||
<% end %>
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
|
||||
<%= f.submit "Post" %>
|
||||
|
||||
<% if CurrentUser.can_upload_free? %>
|
||||
<% if CurrentUser.is_contributor? %>
|
||||
<%= f.input :is_pending, as: :boolean, label: "Upload for approval", wrapper_html: { class: "inline-block" }, input_html: { checked: post.is_pending? } %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -94,11 +94,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Permissions</th>
|
||||
<td><%= presenter.permissions %></td>
|
||||
</tr>
|
||||
|
||||
<% if user.is_banned? && user.active_ban.present? %>
|
||||
<tr>
|
||||
<th>Ban reason</th>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<%# user %>
|
||||
|
||||
<% if user.can_upload_free? %>
|
||||
<% if user.is_contributor? %>
|
||||
none
|
||||
<% else %>
|
||||
<%= link_to user.upload_limit.used_upload_slots, posts_path(tags: "user:#{user.name} status:pending") %> /
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
<%= search_form_for(users_path) do |f| %>
|
||||
<%= f.input :name_matches, label: "Name", input_html: { value: params[:search][:name_matches], data: { autocomplete: "user" } } %>
|
||||
<%= f.input :level, collection: User.level_hash.to_a, include_blank: true, selected: params[:search][:level] %>
|
||||
<%= f.input :can_upload_free, label: "Contributor?", as: :select, include_blank: true, selected: params[:search][:can_upload_free] %>
|
||||
<%= f.input :can_approve_posts, label: "Approver?", as: :select, include_blank: true, selected: params[:search][:can_approve_posts] %>
|
||||
<%= f.input :order, collection: [["Joined", "date"], ["Name", "name"], ["Posts", "post_upload_count"], ["Edits", "post_update_count"], ["Notes", "note_count"]], include_blank: true, selected: params[:search][:order] %>
|
||||
<%= f.submit "Search" %>
|
||||
<% end %>
|
||||
|
||||
@@ -7,14 +7,6 @@
|
||||
|
||||
<% if @user.is_banned? %>
|
||||
<%= link_to "Banned", users_path(search: { is_banned: true }), class: "user-tooltip-badge user-tooltip-badge-banned" %>
|
||||
<% elsif @user.is_admin? %>
|
||||
<%= link_to @user.level_string, users_path(search: { level: @user.level }), class: "user-tooltip-badge user-tooltip-badge-#{@user.level_string.downcase}" %>
|
||||
<% elsif @user.is_moderator? %>
|
||||
<%= link_to @user.level_string, users_path(search: { level: @user.level }), class: "user-tooltip-badge user-tooltip-badge-#{@user.level_string.downcase}" %>
|
||||
<% elsif @user.can_approve_posts? %>
|
||||
<%= link_to "Approver", users_path(search: { can_approve_posts: true }), class: "user-tooltip-badge user-tooltip-badge-approver" %>
|
||||
<% elsif @user.can_upload_free? %>
|
||||
<%= link_to "Contributor", users_path(search: { can_upload_free: true }), class: "user-tooltip-badge user-tooltip-badge-contributor" %>
|
||||
<% else %>
|
||||
<%= link_to @user.level_string, users_path(search: { level: @user.level }), class: "user-tooltip-badge user-tooltip-badge-#{@user.level_string.downcase}" %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user