Allow administrators to edit and update images of any budget investment.

This commit is contained in:
Senén Rodero Rodríguez
2017-06-21 18:04:46 +02:00
parent aa471974bd
commit ce0c0f7024
4 changed files with 57 additions and 16 deletions

View File

@@ -5,12 +5,12 @@
<% if investment.image.exists? %>
<picture>
<source srcset="<%= investment.image.url(:medium) %>"
alt="<%= investment.image_description %>"
title= "<%= investment.image_description %>"
alt="<%= investment.image_title %>"
title= "<%= investment.image_title %>"
media="(max-width: 640px)">
<img srcset="<%= investment.image.url(:thumb) %>"
alt="<%= investment.image_description %>"
title="<%= investment.image_description %>">
alt="<%= investment.image_title %>"
title="<%= investment.image_title %>">
</picture>
<% else %>

View File

@@ -10,7 +10,7 @@
class: 'button hollow float-right' %>
<% end %>
<% if author_of?(investment, current_user) %>
<% if author_of?(investment, current_user) || (current_user && current_user.administrator?) %>
<%= link_to t("budgets.investments.show.edit_image"),
edit_image_budget_investment_path(investment.budget, investment),
class: 'button hollow float-right' %>