forked from e621ng/e621ng

Admins are no longer considered owner of all sets, partically fixing the update modaction. Closes #384
55 lines
2.0 KiB
Plaintext
55 lines
2.0 KiB
Plaintext
<div id="c-sets">
|
|
<div id="a-maintainers">
|
|
<% @maintainers = @post_set.post_set_maintainers %>
|
|
<h1>Maintainers for set <span class="set-name"><%= @post_set.name %></span></h1>
|
|
<p>Maintainers are users who are assigned to a set and have the ability to add or remove posts from it. They cannot
|
|
edit any other details of the set.</p>
|
|
|
|
<% if @post_set.can_edit_settings?(CurrentUser) && @post_set.is_public %>
|
|
<h3 style="margin-top:15px;">Add new Maintainer</h3>
|
|
<div class='section' style="width:380px;">
|
|
<%= form_tag(post_set_maintainers_path) do %>
|
|
<label for="set_maintainer_name">Username</label><br/>
|
|
<%= hidden_field_tag "post_set_id", @post_set.id %>
|
|
<%= text_field_tag "username", nil, data: { autocomplete: "user" } %>
|
|
<%= submit_tag "Invite" %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<table class="striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Username</th>
|
|
<th>Status</th>
|
|
<th>Date</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% @maintainers.where(status: ["pending", "approved"]).order(updated_at: :desc).each do |m| %>
|
|
<tr>
|
|
<td><%= link_to_user m.user %></td>
|
|
<td><%= m.status.capitalize %></td>
|
|
<td><%= compact_time m.updated_at %></td>
|
|
<td>
|
|
<% if @post_set.can_edit_settings?(CurrentUser) && m.status == "approved" %>
|
|
<%= link_to "Remove", post_set_maintainer_path(m), method: :delete, data: {confirm: "Are you sure you want to remove this maintainer?"} %>
|
|
<% end %>
|
|
<% if @post_set.can_edit_settings?(CurrentUser) && m.status == "pending" %>
|
|
<%= link_to "Remove", post_set_maintainer_path(m), method: :delete, data: {confirm: "Are you sure you want to remove this pending invite?"} %>
|
|
<% end %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<%= render partial: "secondary_links" %>
|
|
|
|
<% content_for(:page_title) do %>
|
|
Set Maintainers - <%= @post_set.name %>
|
|
<% end %>
|