Add key shortcut to add to favgroup

This commit is contained in:
Toks
2015-07-01 11:16:07 -04:00
parent 654abe60ed
commit 81f588e021
8 changed files with 73 additions and 2 deletions

View File

@@ -0,0 +1,11 @@
<p>Select a favorite group to add this post to:</p>
<% CurrentUser.favorite_groups.each_with_index do |favgroup, i| %>
<div>
<%= i + 1 %>.
<%= link_to favgroup.name,
add_post_favorite_group_path(favgroup, :post_id => post.id, :format => :js),
:id => "add-to-favgroup-#{i + 1}", :class => "add-to-favgroup",
:method => :put, :remote => true %>
</div>
<% end %>

View File

@@ -0,0 +1 @@
Danbooru.notice("Added post to favorite group <%= escape_javascript(@favorite_group.pretty_name) %>");

View File

@@ -133,6 +133,10 @@
<div id="add-commentary-dialog" title="Add artist commentary" style="display: none;">
<%= render "artist_commentaries/form", :artist_commentary => @post.artist_commentary %>
</div>
<div id="add-to-favgroup-dialog" title="Add to favorite group" style="display: none;">
<%= render "favorite_groups/add_to_favgroup_dialog", :post => @post %>
</div>
</div>
<% content_for(:page_title) do %>

View File

@@ -28,6 +28,7 @@
<li><kbd class="key">a</kbd> Previous post</li>
<li><kbd class="key">d</kbd> Next post</li>
<li><kbd class="key">f</kbd> Favorite post</li>
<li><kbd class="key">g</kbd> Add post to favorite group</li>
<li><kbd class="key">r</kbd> Go to random post</li>
<li><kbd class="key">v</kbd> Toggle between sample and full size</li>
</ul>