app/views/decidim/admin/components/index.html.erb in decidim-admin-0.20.1 vs app/views/decidim/admin/components/index.html.erb in decidim-admin-0.21.0

- old
+ new

@@ -1,16 +1,18 @@ <div class="card"> <div class="card-divider"> <h2 class="card-title"> <%= t("components.title", scope: "decidim.admin") %> - <button class="dropdown tiny button button--title" data-toggle="add-component-dropdown"><%= t "components.index.add", scope: "decidim.admin" %></button> - <div class="dropdown-pane" id="add-component-dropdown" data-dropdown data-auto-focus="true" data-close-on-click="true"> - <ul class="vertical menu add-components"> - <% @manifests.each do |manifest| %> - <li><%= link_to t("#{manifest.name}.name", scope: "decidim.components"), new_component_path(type: manifest.name), class: manifest.name %></li> - <% end %> - </ul> - </div> + <% if allowed_to?(:create, :component) %> + <button class="dropdown tiny button button--title" data-toggle="add-component-dropdown"><%= t "components.index.add", scope: "decidim.admin" %></button> + <div class="dropdown-pane" id="add-component-dropdown" data-dropdown data-auto-focus="true" data-close-on-click="true"> + <ul class="vertical menu add-components"> + <% @manifests.each do |manifest| %> + <li><%= link_to t("#{manifest.name}.name", scope: "decidim.components"), new_component_path(type: manifest.name), class: manifest.name %></li> + <% end %> + </ul> + </div> + <% end %> </h2> </div> <div class="card-section"> <div class="table-scroll">