Browse Source

Update show location to use user_can_edit_scheme?

pull/1637/head
Kat 3 years ago
parent
commit
aa2778df91
  1. 2
      app/views/locations/show.html.erb

2
app/views/locations/show.html.erb

@ -16,7 +16,7 @@
<%= summary_list.row do |row| %> <%= summary_list.row do |row| %>
<% row.key { attr[:name] } %> <% row.key { attr[:name] } %>
<% row.value { attr[:attribute].eql?("status") ? status_tag(attr[:value]) : details_html(attr) } %> <% row.value { attr[:attribute].eql?("status") ? status_tag(attr[:value]) : details_html(attr) } %>
<% row.action(text: "Change", href: scheme_location_name_path(@scheme, @location, referrer: "details")) if attr[:attribute] == "name" && current_user.organisation == @scheme.owning_organisation %> <% row.action(text: "Change", href: scheme_location_name_path(@scheme, @location, referrer: "details")) if attr[:attribute] == "name" && user_can_edit_scheme?(current_user, @scheme) %>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>

Loading…
Cancel
Save