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

- old
+ new

@@ -59,36 +59,36 @@ </thead> <tbody> <% @initiatives.each do |initiative| %> <tr> <td> - <% if can? :edit, initiative %> + <% if allowed_to? :edit, :initiative, initiative: initiative %> <%= link_to translated_attribute(initiative.title), decidim_admin_initiatives.edit_initiative_path(initiative.to_param) %> <% else %> <%= translated_attribute(initiative.title) %> <% end %> </td> <td><%= humanize_admin_state initiative.state %></td> <td><%= initiative.supports_count %>/<%= initiative.scoped_type.supports_required %></td> <td><%= l initiative.created_at, format: :short %></td> <td class="table-list__actions"> - <% if can? :preview, initiative %> + <% if allowed_to? :preview, :initiative, initiative: initiative %> <%= icon_link_to "eye", decidim_initiatives.initiative_path(initiative.to_param), t(".preview"), class: "action-icon--preview", target: "_blank" %> <% end %> - <% if can? :edit, initiative %> + <% if allowed_to? :edit, :initiative, initiative: initiative %> <%= icon_link_to "pencil", decidim_admin_initiatives.edit_initiative_path(initiative.to_param), t("actions.configure", scope: "decidim.admin"), class: "action-icon--edit" %> <% end %> - <% if can? :read, initiative %> + <% if allowed_to? :read, :initiative, initiative: initiative %> <%= icon_link_to "print", decidim_admin_initiatives.initiative_path(initiative.to_param), t(".print",), class: "action-icon--print" %> <% end %>