Skip to content

Commit 9c5d1a8

Browse files
committed
Fix survey component _actions template
1 parent 3a92bf4 commit 9c5d1a8

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<%#
2+
Decidim Zuerich Override
3+
4+
Created at: 2025-08-05
5+
Author: Thomas Burkhalter
6+
7+
Original:
8+
Module: decidim-surveys
9+
Template: app/views/decidim/surveys/admin/component/_actions.html.erb
10+
11+
Why?:
12+
The version currently in the openpoke/backfix, seems to be an old version.
13+
This is the up-to-date file from the decidim repo.
14+
15+
%>
16+
17+
<% if component.manifest.admin_engine %>
18+
<%= icon_link_to "pencil-line", manage_component_path(component), t("actions.manage", scope: "decidim.admin"), class: "action-icon--manage" %>
19+
<% else %>
20+
<span class="action-space icon"></span>
21+
<% end %>
22+
23+
<% if allowed_to? :share, :component, component: component %>
24+
<%= icon_link_to "share-line", url_for(action: :share, id: component, controller: "components"), t("actions.share", scope: "decidim.admin"), target: :blank, class: "action-icon--share" %>
25+
<% else %>
26+
<span class="action-space icon"></span>
27+
<% end %>
28+
<% if allowed_to? :update, :component, component: component %>
29+
<%= icon_link_to "settings-4-line", url_for(action: :edit, id: component, controller: "components"), t("actions.configure", scope: "decidim.admin"), class: "action-icon--configure" %>
30+
<% else %>
31+
<span class="action-space icon"></span>
32+
<% end %>
33+
34+
<% if allowed_to?(:update, :component, component: component) %>
35+
<% if component.published? %>
36+
<%= icon_link_to "close-circle-line", url_for(action: :unpublish, id: component, controller: "components"), t("actions.unpublish", scope: "decidim.admin"), class: "action-icon--unpublish", method: :put %>
37+
<% else %>
38+
<%= icon_link_to "check-line", url_for(action: :publish, id: component, controller: "components"), t("actions.publish", scope: "decidim.admin"), class: "action-icon--publish", method: :put, data: { confirm: t(".answers_alert") } %>
39+
<% end %>
40+
<% else %>
41+
<span class="action-space icon"></span>
42+
<% end %>
43+
44+
<%= icon_link_to "eye-line", main_component_path(component), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview", target: :blank, data: { "external-link": false } %>
45+
46+
<% if allowed_to? :update, :component, component: component %>
47+
<% if component.manifest.actions.empty? %>
48+
<%= icon "key-2-line", class: "action-icon action-icon--disabled" %>
49+
<% else %>
50+
<%= icon_link_to "key-2-line", url_for(action: :edit, component_id: component, controller: "component_permissions"), t("actions.permissions", scope: "decidim.admin"), class: "action-icon--permissions" %>
51+
<% end %>
52+
<% else %>
53+
<span class="action-space icon"></span>
54+
<% end %>
55+
56+
<% if allowed_to? :destroy, :component, component: component %>
57+
<%= icon_link_to "delete-bin-line", url_for(action: :destroy, id: component, controller: "components"), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete %>
58+
<% else %>
59+
<span class="action-space icon"></span>
60+
<% end %>

0 commit comments

Comments
 (0)