expose resize image to window functionality to anon users

This commit is contained in:
r888888888
2017-09-29 18:11:22 -07:00
parent 0f373f8452
commit 9ffbae3cc0
3 changed files with 54 additions and 51 deletions

View File

@@ -61,7 +61,7 @@ class AnonymousUser
end end
def always_resize_images? def always_resize_images?
false true
end end
def show_samples? def show_samples?

View File

@@ -1,5 +1,7 @@
<ul> <ul>
<li><%= link_to "Resize to window", "#", :id => "image-resize-to-window-link" %></li> <li><%= link_to "Resize to window", "#", :id => "image-resize-to-window-link" %></li>
<% if CurrentUser.is_member? %>
<li><%= link_to "Favorite", favorites_path(:post_id => post.id), :remote => true, :method => :post, :id => "add-to-favorites", :title => "Shortcut is F" %></li> <li><%= link_to "Favorite", favorites_path(:post_id => post.id), :remote => true, :method => :post, :id => "add-to-favorites", :title => "Shortcut is F" %></li>
<li><%= link_to "Unfavorite", favorite_path(post), :remote => true, :method => :delete, :id => "remove-from-favorites" %></li> <li><%= link_to "Unfavorite", favorite_path(post), :remote => true, :method => :delete, :id => "remove-from-favorites" %></li>
<li><%= link_to_if post.visible?, "Download", post.file_url, :download => post.presenter.humanized_essential_tag_string + " - " + post.file_name %></li> <li><%= link_to_if post.visible?, "Download", post.file_url, :download => post.presenter.humanized_essential_tag_string + " - " + post.file_name %></li>
@@ -56,4 +58,5 @@
<li><%= link_to "Replace Image", new_post_replacement_path(:post_id => post.id), :id => "replace-image" %></li> <li><%= link_to "Replace Image", new_post_replacement_path(:post_id => post.id), :id => "replace-image" %></li>
<% end %> <% end %>
<% end %> <% end %>
<% end %>
</ul> </ul>

View File

@@ -14,12 +14,12 @@
<%= render "posts/partials/show/information", :post => @post %> <%= render "posts/partials/show/information", :post => @post %>
</section> </section>
<% if CurrentUser.is_member? %>
<section id="post-options"> <section id="post-options">
<h1>Options</h1> <h1>Options</h1>
<%= render "posts/partials/show/options", :post => @post %> <%= render "posts/partials/show/options", :post => @post %>
</section> </section>
<% if CurrentUser.is_member? %>
<section id="post-history"> <section id="post-history">
<h1>History</h1> <h1>History</h1>
<ul> <ul>