BURs: add edit and reject links to the BUR show page (#3824).
This commit is contained in:
11
app/views/bulk_update_requests/_bur_edit_links.html.erb
Normal file
11
app/views/bulk_update_requests/_bur_edit_links.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<%# bur %>
|
||||
|
||||
<% if bur.approvable?(CurrentUser.user) %>
|
||||
<%= link_to "Approve", approve_bulk_update_request_path(bur), remote: true, method: :post, "data-confirm": "Are you sure you want to approve this bulk update request?" %> |
|
||||
<% end %>
|
||||
<% if bur.rejectable?(CurrentUser.user) %>
|
||||
<%= link_to "Reject", bur, remote: true, method: :delete, "data-confirm": "Are you sure you want to reject this bulk update request?" %> |
|
||||
<% end %>
|
||||
<% if bur.editable?(CurrentUser.user) %>
|
||||
<%= link_to "Edit", edit_bulk_update_request_path(bur), :"data-shortcut" => "e" %>
|
||||
<% end %>
|
||||
@@ -25,15 +25,9 @@
|
||||
<td id="request-status-for-<%= request.id %>"><%= request.status %></td>
|
||||
<td>
|
||||
<%= link_to "Show", bulk_update_request_path(request) %> |
|
||||
<% if CurrentUser.is_admin? && request.status == "pending" %>
|
||||
<%= link_to "Approve", approve_bulk_update_request_path(request), :remote => true, :method => :post %> |
|
||||
<% end %>
|
||||
<% if request.editable?(CurrentUser.user) %>
|
||||
<%= link_to "Reject", bulk_update_request_path(request), :method => :delete, :remote => true, :data => {:confirm => "Are you sure you want to reject this bulk update request?"} %> |
|
||||
<%= link_to "Edit", edit_bulk_update_request_path(request) %>
|
||||
<% end %>
|
||||
<%= render "bur_edit_links", bur: request %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<% if @bulk_update_request.errors.any? %>
|
||||
$(window).trigger("danbooru:error", <%= j @bulk_update_request.errors.full_messages.join(',') %>);
|
||||
<% else %>
|
||||
$("#request-status-for-<%= @bulk_update_request.id %>").html("queued");
|
||||
if ($("#a-index").length) {
|
||||
$("#request-status-for-<%= @bulk_update_request.id %>").html("queued");
|
||||
} else {
|
||||
location.reload();
|
||||
}
|
||||
<% end %>
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
$("#request-status-for-<%= @bulk_update_request.id %>").html("rejected");
|
||||
if ($("#a-index").length) {
|
||||
$("#request-status-for-<%= @bulk_update_request.id %>").html("rejected");
|
||||
} else {
|
||||
location.reload();
|
||||
}
|
||||
|
||||
@@ -10,15 +10,13 @@
|
||||
<li><strong>Date</strong> <%= @bulk_update_request.created_at %></li>
|
||||
<li><strong>Status</strong>: <%= @bulk_update_request.status %></li>
|
||||
<li><strong title="How many posts will be affected">Estimate</strong>: <%= @bulk_update_request.estimate_update_count %></li>
|
||||
|
||||
<% if CurrentUser.is_admin? && @bulk_update_request.is_pending? %>
|
||||
<li><strong>Commands</strong> <%= link_to "Approve", approve_bulk_update_request_path(@bulk_update_request), :method => :post %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<div style="margin: 1em 0;">
|
||||
<h2>Script</h2>
|
||||
<pre><%= format_text @bulk_update_request.script_with_links %></pre>
|
||||
|
||||
<%= render "bur_edit_links", bur: @bulk_update_request %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -27,4 +25,4 @@
|
||||
|
||||
<% content_for(:page_title) do %>
|
||||
Bulk Update Request - <%= Danbooru.config.app_name %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user