decidim-decidim_awesome 0.6.0 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +38 -14
- data/app/assets/config/decidim_admin_decidim_awesome_manifest.js +1 -0
- data/app/assets/javascripts/decidim/decidim_awesome/admin/form_exit_warn.js.es6 +30 -0
- data/app/assets/javascripts/decidim/decidim_awesome/awesome_map/legacy_map.js.es6 +14 -4
- data/app/assets/javascripts/decidim/decidim_awesome/awesome_map/legacy_proposals.js.es6 +82 -0
- data/app/assets/javascripts/decidim/decidim_awesome/awesome_map/map.js.es6 +13 -2
- data/app/assets/javascripts/decidim/decidim_awesome/awesome_map/meetings.js.es6 +15 -13
- data/app/assets/javascripts/decidim/decidim_awesome/awesome_map/proposals.js.es6 +29 -13
- data/app/assets/javascripts/decidim/decidim_awesome/editors/quill_editor.js.es6 +1 -1
- data/app/assets/stylesheets/decidim/decidim_awesome/admin.scss +4 -0
- data/app/awesome_overrides/presenters/decidim/menu_presenter_override.rb +31 -0
- data/app/awesome_overrides/presenters/decidim/proposals/proposal_presenter_override.rb +31 -5
- data/app/commands/decidim/decidim_awesome/admin/create_menu_hack.rb +51 -0
- data/app/commands/decidim/decidim_awesome/admin/create_scoped_style.rb +34 -0
- data/app/commands/decidim/decidim_awesome/admin/destroy_menu_hack.rb +47 -0
- data/app/commands/decidim/decidim_awesome/admin/destroy_scoped_style.rb +40 -0
- data/app/commands/decidim/decidim_awesome/admin/update_config.rb +1 -1
- data/app/commands/decidim/decidim_awesome/admin/update_menu_hack.rb +47 -0
- data/app/commands/decidim/decidim_awesome/create_editor_image.rb +5 -3
- data/app/controllers/decidim/decidim_awesome/admin/application_controller.rb +4 -3
- data/app/controllers/decidim/decidim_awesome/admin/config_controller.rb +38 -2
- data/app/controllers/decidim/decidim_awesome/admin/constraints_controller.rb +13 -0
- data/app/controllers/decidim/decidim_awesome/admin/menu_hacks_controller.rb +116 -0
- data/app/controllers/decidim/decidim_awesome/editor_images_controller.rb +1 -1
- data/app/forms/decidim/decidim_awesome/admin/config_form.rb +11 -2
- data/app/forms/decidim/decidim_awesome/admin/constraint_form.rb +0 -2
- data/app/forms/decidim/decidim_awesome/admin/intergram_form.rb +0 -2
- data/app/forms/decidim/decidim_awesome/admin/menu_form.rb +39 -0
- data/app/forms/decidim/decidim_awesome/editor_image_form.rb +2 -0
- data/app/helpers/decidim/decidim_awesome/admin/config_constraints_helpers.rb +5 -1
- data/app/helpers/decidim/decidim_awesome/map_helper.rb +11 -1
- data/app/models/decidim/decidim_awesome/editor_image.rb +4 -3
- data/app/permissions/decidim/decidim_awesome/admin/permissions.rb +19 -0
- data/app/permissions/decidim/decidim_awesome/permissions.rb +2 -0
- data/app/uploaders/decidim/decidim_awesome/image_uploader.rb +9 -0
- data/app/views/decidim/decidim_awesome/admin/config/_form_styles.html.erb +27 -0
- data/app/views/decidim/decidim_awesome/admin/config/show.html.erb +1 -1
- data/app/views/decidim/decidim_awesome/admin/menu_hacks/_form.html.erb +7 -0
- data/app/views/decidim/decidim_awesome/admin/menu_hacks/edit.html.erb +13 -0
- data/app/views/decidim/decidim_awesome/admin/menu_hacks/index.html.erb +44 -0
- data/app/views/decidim/decidim_awesome/admin/menu_hacks/new.html.erb +13 -0
- data/app/views/decidim/decidim_awesome/iframe_component/iframe/show.html.erb +6 -1
- data/app/views/decidim/decidim_awesome/map_component/map/show.html.erb +40 -18
- data/app/views/layouts/decidim/admin/decidim_awesome.html.erb +10 -0
- data/app/views/layouts/decidim/decidim_awesome/_awesome_config.html.erb +1 -1
- data/app/views/layouts/decidim/decidim_awesome/_custom_styles.html.erb +3 -0
- data/app/views/v0.22/layouts/decidim/_head.html.erb +1 -0
- data/app/views/v0.23/layouts/decidim/_head.html.erb +1 -0
- data/config/locales/ca.yml +96 -9
- data/config/locales/cs.yml +91 -4
- data/config/locales/en.yml +70 -4
- data/config/locales/es.yml +125 -38
- data/config/locales/eu.yml +212 -0
- data/config/locales/fr.yml +90 -3
- data/config/locales/nl.yml +212 -0
- data/config/locales/sv.yml +90 -3
- data/lib/decidim/decidim_awesome.rb +27 -0
- data/lib/decidim/decidim_awesome/admin_engine.rb +3 -0
- data/lib/decidim/decidim_awesome/awesome_helpers.rb +16 -0
- data/lib/decidim/decidim_awesome/checksums.yml +8 -0
- data/lib/decidim/decidim_awesome/config.rb +13 -12
- data/lib/decidim/decidim_awesome/engine.rb +1 -1
- data/lib/decidim/decidim_awesome/iframe_component/component.rb +3 -3
- data/lib/decidim/decidim_awesome/map_component/component.rb +6 -0
- data/lib/decidim/decidim_awesome/menu_hacker.rb +88 -0
- data/lib/decidim/decidim_awesome/test/factories.rb +1 -1
- data/lib/decidim/decidim_awesome/test/shared_examples/config_examples.rb +4 -2
- data/lib/decidim/decidim_awesome/test/shared_examples/editor_examples.rb +71 -0
- data/lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb +71 -0
- data/lib/decidim/decidim_awesome/version.rb +1 -2
- data/vendor/assets/javascripts/jsrender.min.js +4 -0
- metadata +26 -3
@@ -0,0 +1,116 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
module Admin
|
6
|
+
# Editing menu items
|
7
|
+
class MenuHacksController < DecidimAwesome::Admin::ApplicationController
|
8
|
+
include NeedsAwesomeConfig
|
9
|
+
helper ConfigConstraintsHelpers
|
10
|
+
|
11
|
+
layout "decidim/admin/decidim_awesome"
|
12
|
+
|
13
|
+
helper_method :current_items, :md5, :visibility_options, :target_options
|
14
|
+
|
15
|
+
before_action do
|
16
|
+
enforce_permission_to :edit_config, :menu
|
17
|
+
end
|
18
|
+
|
19
|
+
def index; end
|
20
|
+
|
21
|
+
def new
|
22
|
+
@form = form(MenuForm).instance
|
23
|
+
end
|
24
|
+
|
25
|
+
def create
|
26
|
+
@form = form(MenuForm).from_params(params)
|
27
|
+
CreateMenuHack.call(@form, current_menu_name) do
|
28
|
+
on(:ok) do
|
29
|
+
flash[:notice] = I18n.t("menu_hacks.create.success", scope: "decidim.decidim_awesome.admin")
|
30
|
+
redirect_to decidim_admin_decidim_awesome.menu_hacks_path
|
31
|
+
end
|
32
|
+
|
33
|
+
on(:invalid) do |message|
|
34
|
+
flash.now[:alert] = I18n.t("menu_hacks.create.error", error: message, scope: "decidim.decidim_awesome.admin")
|
35
|
+
render :new
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def edit
|
41
|
+
@form = form(MenuForm).from_model(menu_item)
|
42
|
+
end
|
43
|
+
|
44
|
+
def update
|
45
|
+
@form = form(MenuForm).from_params(params)
|
46
|
+
UpdateMenuHack.call(@form, current_menu_name) do
|
47
|
+
on(:ok) do
|
48
|
+
flash[:notice] = I18n.t("menu_hacks.update.success", scope: "decidim.decidim_awesome.admin")
|
49
|
+
redirect_to decidim_admin_decidim_awesome.menu_hacks_path
|
50
|
+
end
|
51
|
+
|
52
|
+
on(:invalid) do |message|
|
53
|
+
flash.now[:alert] = I18n.t("menu_hacks.update.error", error: message, scope: "decidim.decidim_awesome.admin")
|
54
|
+
render :edit
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def destroy
|
60
|
+
DestroyMenuHack.call(menu_item, current_menu_name, current_organization) do
|
61
|
+
on(:ok) do
|
62
|
+
flash[:notice] = I18n.t("menu_hacks.destroy.success", scope: "decidim.decidim_awesome.admin")
|
63
|
+
end
|
64
|
+
on(:invalid) do |error|
|
65
|
+
flash[:alert] = I18n.t("menu_hacks.destroy.error", scope: "decidim.decidim_awesome.admin", error: error)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
redirect_to decidim_admin_decidim_awesome.menu_hacks_path
|
69
|
+
end
|
70
|
+
|
71
|
+
private
|
72
|
+
|
73
|
+
def menu_item
|
74
|
+
item = current_items.find { |i| md5(i.url) == params[:id] }
|
75
|
+
raise ActiveRecord::RecordNotFound unless item
|
76
|
+
|
77
|
+
OpenStruct.new(
|
78
|
+
raw_label: item.try(:raw_label) || { current_organization.default_locale => item.label },
|
79
|
+
url: item.url,
|
80
|
+
position: item.position,
|
81
|
+
target: item.try(:target),
|
82
|
+
visibility: item.try(:visibility),
|
83
|
+
native?: !item.respond_to?(:overrided?)
|
84
|
+
)
|
85
|
+
end
|
86
|
+
|
87
|
+
def current_items
|
88
|
+
@current_items ||= current_menu.items(true)
|
89
|
+
end
|
90
|
+
|
91
|
+
def current_menu
|
92
|
+
@current_menu ||= MenuHacker.new(current_menu_name, self)
|
93
|
+
end
|
94
|
+
|
95
|
+
def current_menu_name
|
96
|
+
:menu
|
97
|
+
end
|
98
|
+
|
99
|
+
def md5(text)
|
100
|
+
Digest::MD5.hexdigest(text)
|
101
|
+
end
|
102
|
+
|
103
|
+
def visibility_options
|
104
|
+
MenuForm::VISIBILITY_STATES.map { |key| [I18n.t(".menu_hacks.form.visibility.#{key}", scope: "decidim.decidim_awesome.admin"), key] }.to_h
|
105
|
+
end
|
106
|
+
|
107
|
+
def target_options
|
108
|
+
{
|
109
|
+
I18n.t(".menu_hacks.form.target.self", scope: "decidim.decidim_awesome.admin") => "",
|
110
|
+
I18n.t(".menu_hacks.form.target.blank", scope: "decidim.decidim_awesome.admin") => "_blank"
|
111
|
+
}
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
@@ -3,8 +3,6 @@
|
|
3
3
|
module Decidim
|
4
4
|
module DecidimAwesome
|
5
5
|
module Admin
|
6
|
-
# A form object used to configure the endpoint.
|
7
|
-
#
|
8
6
|
class ConfigForm < Decidim::Form
|
9
7
|
attribute :allow_images_in_full_editor, Boolean
|
10
8
|
attribute :allow_images_in_small_editor, Boolean
|
@@ -12,10 +10,21 @@ module Decidim
|
|
12
10
|
attribute :use_markdown_editor, Boolean
|
13
11
|
attribute :allow_images_in_markdown_editor, Boolean
|
14
12
|
attribute :auto_save_forms, Boolean
|
13
|
+
attribute :scoped_styles, Hash
|
14
|
+
attribute :menu, Array[MenuForm]
|
15
15
|
attribute :intergram_for_admins, Boolean
|
16
16
|
attribute :intergram_for_admins_settings, IntergramForm
|
17
17
|
attribute :intergram_for_public, Boolean
|
18
18
|
attribute :intergram_for_public_settings, IntergramForm
|
19
|
+
|
20
|
+
# collect all keys anything not specified in the params (UpdateConfig command ignores it)
|
21
|
+
attr_accessor :valid_keys
|
22
|
+
|
23
|
+
def self.from_params(params, additional_params = {})
|
24
|
+
instance = super(params, additional_params)
|
25
|
+
instance.valid_keys = params.keys.map(&:to_sym) || []
|
26
|
+
instance
|
27
|
+
end
|
19
28
|
end
|
20
29
|
end
|
21
30
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
module Admin
|
6
|
+
class MenuForm < Decidim::Form
|
7
|
+
include Decidim::TranslatableAttributes
|
8
|
+
VISIBILITY_STATES = %w(default hidden logged non_logged).freeze
|
9
|
+
|
10
|
+
translatable_attribute :raw_label, String
|
11
|
+
attribute :url, String
|
12
|
+
attribute :position, Integer
|
13
|
+
attribute :target, String
|
14
|
+
attribute :visibility, String
|
15
|
+
|
16
|
+
validates :raw_label, translatable_presence: true
|
17
|
+
validates :url, presence: true
|
18
|
+
validates :position, numericality: { greater_than: 0 }
|
19
|
+
validates :visibility, inclusion: { in: VISIBILITY_STATES }
|
20
|
+
validates :target, inclusion: { in: ["", "_blank"] }
|
21
|
+
|
22
|
+
# remove query string from native menu element (to avoid interactions with the locale in the generated url)
|
23
|
+
def map_model(model)
|
24
|
+
self.url = Addressable::URI.parse(model.url).path if model.native?
|
25
|
+
end
|
26
|
+
|
27
|
+
def to_params
|
28
|
+
{
|
29
|
+
label: raw_label,
|
30
|
+
position: position,
|
31
|
+
url: url,
|
32
|
+
target: target,
|
33
|
+
visibility: visibility
|
34
|
+
}
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -18,7 +18,11 @@ module Decidim
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def config_enabled?(var)
|
21
|
-
|
21
|
+
unless var.is_a?(Array)
|
22
|
+
return false unless DecidimAwesome.config.has_key?(var.to_sym)
|
23
|
+
|
24
|
+
return DecidimAwesome.config.send(var) != :disabled
|
25
|
+
end
|
22
26
|
|
23
27
|
var.detect { |v| DecidimAwesome.config.send(v) != :disabled }
|
24
28
|
end
|
@@ -23,7 +23,12 @@ module Decidim
|
|
23
23
|
amendments: component.manifest.name == :proposals ? Decidim::Proposals::Proposal.where(component: component).only_emendations.count : 0
|
24
24
|
}
|
25
25
|
end.to_json,
|
26
|
-
"data-collapsed" => current_component.settings.collapse
|
26
|
+
"data-collapsed" => current_component.settings.collapse,
|
27
|
+
"data-show-not-answered" => current_component.current_settings.show_not_answered,
|
28
|
+
"data-show-accepted" => current_component.current_settings.show_accepted,
|
29
|
+
"data-show-withdrawn" => current_component.current_settings.show_withdrawn,
|
30
|
+
"data-show-evaluating" => current_component.current_settings.show_evaluating
|
31
|
+
# "data-show-rejected" => current_component.current_settings.show_rejected
|
27
32
|
}
|
28
33
|
content_tag(:div, map, map_html_options)
|
29
34
|
end
|
@@ -45,6 +50,11 @@ module Decidim
|
|
45
50
|
}
|
46
51
|
end.to_json,
|
47
52
|
"data-collapsed" => current_component.settings.collapse,
|
53
|
+
"data-show-not-answered" => current_component.current_settings.show_not_answered,
|
54
|
+
"data-show-accepted" => current_component.current_settings.show_accepted,
|
55
|
+
"data-show-withdrawn" => current_component.current_settings.show_withdrawn,
|
56
|
+
"data-show-evaluating" => current_component.current_settings.show_evaluating,
|
57
|
+
# "data-show-rejected" => current_component.current_settings.show_rejected,
|
48
58
|
"data-markers-data" => [].to_json
|
49
59
|
}
|
50
60
|
|
@@ -11,9 +11,10 @@ module Decidim
|
|
11
11
|
validates :organization, presence: true
|
12
12
|
validates :author, presence: true
|
13
13
|
|
14
|
-
validates :image,
|
15
|
-
|
16
|
-
|
14
|
+
validates :image, presence: true
|
15
|
+
# validates :image,
|
16
|
+
# file_size: { less_than_or_equal_to: ->(_record) { Decidim.maximum_attachment_size } },
|
17
|
+
# file_content_type: { allow: ["image/jpeg", "image/png"] }
|
17
18
|
|
18
19
|
mount_uploader :image, Decidim::DecidimAwesome::ImageUploader
|
19
20
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
module Admin
|
6
|
+
class Permissions < Decidim::DefaultPermissions
|
7
|
+
include ConfigConstraintsHelpers
|
8
|
+
|
9
|
+
def permissions
|
10
|
+
return permission_action if permission_action.scope != :admin
|
11
|
+
|
12
|
+
toggle_allow(config_enabled?(permission_action.subject)) if permission_action.action == :edit_config
|
13
|
+
|
14
|
+
permission_action
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -10,10 +10,19 @@ module Decidim
|
|
10
10
|
process resize_to_fit: [nil, 237]
|
11
11
|
end
|
12
12
|
|
13
|
+
# TODO: remove when diching 0.22 support
|
13
14
|
def extension_white_list
|
14
15
|
%w(jpg jpeg png)
|
15
16
|
end
|
16
17
|
|
18
|
+
def extension_whitelist
|
19
|
+
%w(jpg jpeg png)
|
20
|
+
end
|
21
|
+
|
22
|
+
def content_type_whitelist
|
23
|
+
%w(image/jpeg image/png)
|
24
|
+
end
|
25
|
+
|
17
26
|
def max_image_height_or_width
|
18
27
|
8000
|
19
28
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<div class="row column decidim_awesome-form">
|
2
|
+
<% if config_enabled? :scoped_styles %>
|
3
|
+
<p class="help-text"><%= t("help.scoped_styles", scope: "decidim.decidim_awesome.admin.config.form") %></p>
|
4
|
+
<p class="help-text">
|
5
|
+
<%= t("help.scoped_styles_variables", scope: "decidim.decidim_awesome.admin.config.form") %><br>
|
6
|
+
<% [:primary, :secondary, :success, :warning, :alert, :highlight, :highlight_alternative].each do |color| %>
|
7
|
+
var(--<%= color %>),
|
8
|
+
<% end %>
|
9
|
+
</p>
|
10
|
+
|
11
|
+
<% form.object.scoped_styles&.each do |key, value| %>
|
12
|
+
<div class="scoped-style" data-key="<%= key %>">
|
13
|
+
<%= label_tag :scoped_styles do %>
|
14
|
+
<%= t("config.scoped_styles", scope: "activemodel.attributes", id: key) %>
|
15
|
+
<%= link_to t(".remove"), decidim_admin_decidim_awesome.destroy_scoped_style_path(key: key), method: :post, class: "float-right", data: { confirm: t(".sure_to_remove") } %>
|
16
|
+
<% end %>
|
17
|
+
<%= text_area_tag key, value, name: "config[scoped_styles][#{key}]", rows: 5 %>
|
18
|
+
<%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: "scoped_style_#{key}", constraints: constraints_for("scoped_style_#{key}") }) %>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
<%= link_to t(".new"), decidim_admin_decidim_awesome.new_scoped_style_path, method: :post %>
|
23
|
+
|
24
|
+
<% end %>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<%= javascript_include_tag "decidim/decidim_awesome/admin/form_exit_warn" %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= decidim_form_for(@form, method: :patch, url: decidim_admin_decidim_awesome.config_path(params[:var])) do |f| %>
|
1
|
+
<%= decidim_form_for(@form, method: :patch, url: decidim_admin_decidim_awesome.config_path(params[:var]), html: { class: "awesome-edit-config" }, data: { "safe-path" => decidim_admin_decidim_awesome.config_path(params[:var]) }) do |f| %>
|
2
2
|
<div class="card">
|
3
3
|
<div class="card-divider">
|
4
4
|
<h2 class="card-title"><%= t(".title", setting: params[:var]) %></h2>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<div>
|
2
|
+
<%= form.translated :text_field, :raw_label, help_text: t(".label_help") %>
|
3
|
+
<%= form.text_field :url , readonly: form.object.url.present? %>
|
4
|
+
<%= form.text_field :position %>
|
5
|
+
<%= form.select :target, target_options %>
|
6
|
+
<%= form.select :visibility, visibility_options %>
|
7
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= decidim_form_for(@form, url: menu_hack_path, method: :patch) do |f| %>
|
2
|
+
<div class="card">
|
3
|
+
<div class="card-divider">
|
4
|
+
<h2 class="card-title"><%= t ".title" %></h2>
|
5
|
+
</div>
|
6
|
+
<div class="card-section">
|
7
|
+
<%= render partial: "form", object: f %>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
<div class="button--double form-general-submit">
|
11
|
+
<%= f.submit t(".save") %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<div class="card">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title">
|
4
|
+
<%= t(".title") %>
|
5
|
+
<%= link_to t(".new"), decidim_admin_decidim_awesome.new_menu_hack_path, class: "button tiny button--title" %>
|
6
|
+
</h2>
|
7
|
+
</div>
|
8
|
+
<div class="card-section">
|
9
|
+
<div class="row column decidim_awesome-form">
|
10
|
+
<table class="table-list">
|
11
|
+
<thead>
|
12
|
+
<tr>
|
13
|
+
<th><%= t("menu.raw_label", scope: "activemodel.attributes") %></th>
|
14
|
+
<th><%= t("menu.url", scope: "activemodel.attributes") %></th>
|
15
|
+
<th><%= t("menu.position", scope: "activemodel.attributes") %></th>
|
16
|
+
<th><%= t("menu.target", scope: "activemodel.attributes") %></th>
|
17
|
+
<th><%= t("menu.visibility", scope: "activemodel.attributes") %></th>
|
18
|
+
<th class="actions"></th>
|
19
|
+
</tr>
|
20
|
+
</thead>
|
21
|
+
<tbody>
|
22
|
+
<% current_items.each do |item| %>
|
23
|
+
<tr<%= " class=menu_hack-addition" if item.try(:overrided?) == false %>>
|
24
|
+
<td><%= item.label %></td>
|
25
|
+
<td><%= item.url %></td>
|
26
|
+
<td><%= item.position %></td>
|
27
|
+
<td><%= target_options.invert[item.try(:target)||""] %></td>
|
28
|
+
<td><%= visibility_options.invert[item.try(:visibility)] %></td>
|
29
|
+
<td class="table-list__actions">
|
30
|
+
<%= icon_link_to "pencil", decidim_admin_decidim_awesome.edit_menu_hack_path(md5(item.url)), t(".edit"), class: "action-icon--edit" %>
|
31
|
+
<% if item.respond_to?(:overrided?) %>
|
32
|
+
<%= icon_link_to "circle-x", decidim_admin_decidim_awesome.menu_hack_path(md5(item.url)), t(".remove#{'_hack' if item.overrided?}"), method: :delete, class: "action-icon--remove", data: { confirm: t(".confirm_destroy") } %>
|
33
|
+
<% else %>
|
34
|
+
<span class="action-icon">
|
35
|
+
<%= icon "circle-x", class: "action-icon action-icon--disabled", role: "img" %>
|
36
|
+
</span>
|
37
|
+
<% end %>
|
38
|
+
</td>
|
39
|
+
</tr>
|
40
|
+
<% end %>
|
41
|
+
</tbody>
|
42
|
+
</table>
|
43
|
+
</div>
|
44
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= decidim_form_for(@form, url: menu_hacks_path) do |f| %>
|
2
|
+
<div class="card">
|
3
|
+
<div class="card-divider">
|
4
|
+
<h2 class="card-title"><%= t ".title" %></h2>
|
5
|
+
</div>
|
6
|
+
<div class="card-section">
|
7
|
+
<%= render partial: "form", object: f %>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
<div class="button--double form-general-submit">
|
11
|
+
<%= f.submit t(".save") %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|