Add order page for favgroups
This commit is contained in:
24
app/views/favorite_group_orders/edit.html.erb
Normal file
24
app/views/favorite_group_orders/edit.html.erb
Normal file
@@ -0,0 +1,24 @@
|
||||
<div id="c-favorite-group-orders">
|
||||
<div id="a-edit">
|
||||
<h1>Order Favorite Group: <%= @favorite_group.pretty_name %></h1>
|
||||
<p>Drag and drop the list below to determine ordering.</p>
|
||||
|
||||
<ul id="sortable">
|
||||
<% @favorite_group.posts(:limit => 1_000).each do |post| %>
|
||||
<li class="ui-state-default" id="favorite_group[post_id_array]_<%= post.id %>">
|
||||
<%= link_to(image_tag(post.preview_file_url), post_path(post)) %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<%= simple_form_for(@favorite_group, :format => :js, :html => {:id => "ordering-form"}) do |f| %>
|
||||
<%= submit_tag "Save" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "favorite_groups/secondary_links" %>
|
||||
|
||||
<% content_for(:page_title) do %>
|
||||
Order Favorite Group - <%= Danbooru.config.app_name %>
|
||||
<% end %>
|
||||
@@ -13,6 +13,9 @@
|
||||
<% if @favorite_group.editable_by?(CurrentUser.user) %>
|
||||
<li><%= link_to "Edit", edit_favorite_group_path(@favorite_group) %></li>
|
||||
<li><%= link_to "Delete", favorite_group_path(@favorite_group), :method => :delete, :data => {:confirm => "Are you sure you want to delete this favorite group?"} %></li>
|
||||
<% if @favorite_group.post_count <= 100 %>
|
||||
<li><%= link_to "Order", edit_favorite_group_order_path(@favorite_group) %></li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</menu>
|
||||
|
||||
Reference in New Issue
Block a user