app/views/decidim/accountability/admin/timeline_entries/index.html.erb in decidim-accountability-0.11.2 vs app/views/decidim/accountability/admin/timeline_entries/index.html.erb in decidim-accountability-0.12.0.pre

- old
+ new

@@ -1,11 +1,11 @@ <div class="card"> <div class="card-divider"> <h2 class="card-title"> <%= link_to "#{translated_attribute(result.title)} > ", edit_result_path(result) %> <%= t(".title") %> - <%= link_to t("actions.new", scope: "decidim.accountability", name: t("models.timeline_entry.name", scope: "decidim.accountability.admin")), new_result_timeline_entry_path(result), class: "button tiny button--title" if can? :manage, current_component %> + <%= link_to t("actions.new", scope: "decidim.accountability", name: t("models.timeline_entry.name", scope: "decidim.accountability.admin")), new_result_timeline_entry_path(result), class: "button tiny button--title" if allowed_to? :create, :timeline_entry %> </h2> </div> <div class="card-section"> <div class="table-scroll"> @@ -21,14 +21,14 @@ <% timeline_entries.each do |timeline_entry| %> <tr data-id="<%= timeline_entry.id %>"> <td><%= timeline_entry.entry_date %><br /></td> <td><%= translated_attribute(timeline_entry.description) %></td> <td class="table-list__actions"> - <% if can? :update, current_component %> + <% if allowed_to? :update, :timeline_entry, timeline_entry: timeline_entry %> <%= icon_link_to "pencil", edit_result_timeline_entry_path(timeline_entry.result, timeline_entry), t("actions.edit", scope: "decidim.accountability"), class: "action-icon--edit" %> <% end %> - <% if can? :destroy, current_component %> + <% if allowed_to? :destroy, :timeline_entry, timeline_entry: timeline_entry %> <%= icon_link_to "circle-x", result_timeline_entry_path(timeline_entry.result, timeline_entry), t("actions.destroy", scope: "decidim.accountability"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.accountability") } %> <% end %> </td> </tr> <% end %>