decidim-decidim_awesome 0.11.4 → 0.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +47 -6
- data/README.md +33 -39
- data/Rakefile +12 -0
- data/app/cells/concerns/decidim/decidim_awesome/global_menu_cell_override.rb +14 -2
- data/app/cells/concerns/decidim/decidim_awesome/proposal_l_cell_override.rb +5 -4
- data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/show.erb +4 -4
- data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/vote_block_for.erb +1 -1
- data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_cell.rb +3 -5
- data/app/commands/concerns/decidim/decidim_awesome/system/{register_organization_override.rb → create_organization_override.rb} +1 -1
- data/app/commands/concerns/decidim/decidim_awesome/update_account_override.rb +4 -4
- data/app/commands/decidim/decidim_awesome/admin/create_constraint.rb +1 -1
- data/app/commands/decidim/decidim_awesome/create_editor_image.rb +2 -2
- data/app/controllers/concerns/decidim/decidim_awesome/admin/maintenance_context.rb +0 -28
- data/app/controllers/concerns/decidim/decidim_awesome/needs_hashcash.rb +41 -0
- data/app/controllers/concerns/decidim/decidim_awesome/not_found_redirect.rb +2 -2
- data/app/controllers/decidim/decidim_awesome/admin/admin_authorizations_controller.rb +2 -2
- data/app/controllers/decidim/decidim_awesome/admin/checks_controller.rb +0 -10
- data/app/controllers/decidim/decidim_awesome/admin/config_controller.rb +2 -1
- data/app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb +1 -2
- data/app/controllers/decidim/decidim_awesome/admin/hashcash_controller.rb +39 -0
- data/app/controllers/decidim/decidim_awesome/admin/menu_hacks_controller.rb +1 -1
- data/app/controllers/decidim/decidim_awesome/admin/{maintenance_controller.rb → private_data_controller.rb} +9 -9
- data/app/controllers/decidim/decidim_awesome/utils_controller.rb +17 -0
- data/app/forms/concerns/decidim/decidim_awesome/proposals/{proposal_wizard_create_step_form_override.rb → proposal_form_customizations.rb} +1 -1
- data/app/forms/concerns/decidim/decidim_awesome/proposals/proposal_form_override.rb +7 -1
- data/app/forms/concerns/decidim/decidim_awesome/system/organization_form_override.rb +2 -2
- data/app/forms/decidim/decidim_awesome/admin/config_form.rb +13 -0
- data/app/helpers/decidim/decidim_awesome/admin/config_constraints_helpers.rb +1 -1
- data/app/helpers/decidim/decidim_awesome/map_helper.rb +4 -2
- data/app/models/decidim/decidim_awesome/paper_trail_version.rb +1 -1
- data/app/overrides/decidim/devise/registrations/new/add_hashcash.html.erb.deface +3 -0
- data/app/overrides/decidim/devise/sessions/new/add_hashcash.html.erb.deface +3 -0
- data/app/overrides/layouts/decidim/_head/add_awesome_custom_styles.html.erb.deface +3 -0
- data/app/overrides/layouts/decidim/_head/add_awesome_tags.html.erb.deface +0 -2
- data/app/packs/entrypoints/decidim_admin_decidim_awesome_search_form.scss +1 -0
- data/app/packs/entrypoints/decidim_decidim_awesome_hashcash.js +4 -0
- data/app/packs/src/decidim/decidim_awesome/admin/auto_edit.js +10 -6
- data/app/packs/src/decidim/decidim_awesome/admin/custom_fields_builder.js +4 -2
- data/app/packs/src/decidim/decidim_awesome/admin/verifications.js +6 -3
- data/app/packs/src/decidim/decidim_awesome/awesome_map/api/proposals_fetcher.js +1 -1
- data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/controller.js +1 -1
- data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/proposals_controller.js +1 -1
- data/app/packs/src/decidim/decidim_awesome/awesome_map/controls_ui.js +6 -6
- data/app/packs/src/decidim/decidim_awesome/awesome_map/load_map.js +1 -1
- data/app/packs/src/decidim/decidim_awesome/forms/autosave.js +3 -3
- data/app/packs/src/decidim/decidim_awesome/forms/custom_fields_renderer.js +1 -113
- data/app/packs/src/decidim/decidim_awesome/proposals/images.js +1 -1
- data/app/packs/src/vendor/form_builder_langs/ar-SA.lang +111 -0
- data/app/packs/src/vendor/form_builder_langs/ar-TN.lang +94 -0
- data/app/packs/src/vendor/form_builder_langs/ca-ES.lang +110 -0
- data/app/packs/src/vendor/form_builder_langs/cs-CZ.lang +105 -0
- data/app/packs/src/vendor/form_builder_langs/da-DK.lang +110 -0
- data/app/packs/src/vendor/form_builder_langs/de-DE.lang +109 -0
- data/app/packs/src/vendor/form_builder_langs/el-GR.lang +110 -0
- data/app/packs/src/vendor/form_builder_langs/en-US.lang +117 -0
- data/app/packs/src/vendor/form_builder_langs/es-ES.lang +103 -0
- data/app/packs/src/vendor/form_builder_langs/fa-IR.lang +108 -0
- data/app/packs/src/vendor/form_builder_langs/fi-FI.lang +107 -0
- data/app/packs/src/vendor/form_builder_langs/fr-FR.lang +117 -0
- data/app/packs/src/vendor/form_builder_langs/he-IL.lang +108 -0
- data/app/packs/src/vendor/form_builder_langs/hi-IN.lang +110 -0
- data/app/packs/src/vendor/form_builder_langs/hu-HU.lang +108 -0
- data/app/packs/src/vendor/form_builder_langs/id-ID.lang +110 -0
- data/app/packs/src/vendor/form_builder_langs/it-IT.lang +107 -0
- data/app/packs/src/vendor/form_builder_langs/ja-JP.lang +108 -0
- data/app/packs/src/vendor/form_builder_langs/my-MM.lang +108 -0
- data/app/packs/src/vendor/form_builder_langs/nb-NO.lang +94 -0
- data/app/packs/src/vendor/form_builder_langs/nl-NL.lang +94 -0
- data/app/packs/src/vendor/form_builder_langs/pl-PL.lang +122 -0
- data/app/packs/src/vendor/form_builder_langs/pt-BR.lang +110 -0
- data/app/packs/src/vendor/form_builder_langs/pu-IN.lang +110 -0
- data/app/packs/src/vendor/form_builder_langs/qz-MM.lang +108 -0
- data/app/packs/src/vendor/form_builder_langs/ro-RO.lang +94 -0
- data/app/packs/src/vendor/form_builder_langs/ru-RU.lang +110 -0
- data/app/packs/src/vendor/form_builder_langs/sl-SI.lang +110 -0
- data/app/packs/src/vendor/form_builder_langs/th-TH.lang +111 -0
- data/app/packs/src/vendor/form_builder_langs/tr-TR.lang +115 -0
- data/app/packs/src/vendor/form_builder_langs/uk-UA.lang +108 -0
- data/app/packs/src/vendor/form_builder_langs/vi-VN.lang +94 -0
- data/app/packs/src/vendor/form_builder_langs/zh-CN.lang +100 -0
- data/app/packs/src/vendor/form_builder_langs/zh-TW.lang +94 -0
- data/app/packs/src/vendor/hashcash.js +83 -0
- data/app/packs/src/vendor/sha1.js +143 -0
- data/app/packs/src/vendor/stamp.js +50 -0
- data/app/packs/stylesheets/decidim/decidim_awesome/admin/admin_accountability.scss +67 -0
- data/app/packs/stylesheets/decidim/decidim_awesome/forms/autosave.scss +2 -12
- data/app/permissions/decidim/decidim_awesome/permissions.rb +3 -2
- data/app/presenters/decidim/decidim_awesome/private_data_presenter.rb +2 -2
- data/app/uploaders/decidim/decidim_awesome/image_uploader.rb +12 -0
- data/app/views/decidim/decidim_awesome/admin/admin_accountability/index.html.erb +5 -4
- data/app/views/decidim/decidim_awesome/admin/admin_authorizations/callout.html.erb +2 -2
- data/app/views/decidim/decidim_awesome/admin/admin_authorizations/conflict.html.erb +4 -4
- data/app/views/decidim/decidim_awesome/admin/admin_authorizations/edit.html.erb +6 -5
- data/app/views/decidim/decidim_awesome/admin/checks/index.html.erb +6 -6
- data/app/views/decidim/decidim_awesome/admin/config/_autoedit_box_label.html.erb +2 -2
- data/app/views/decidim/decidim_awesome/admin/config/_constraints.html.erb +3 -3
- data/app/views/decidim/decidim_awesome/admin/config/_form_admins.html.erb +4 -3
- data/app/views/decidim/decidim_awesome/admin/config/_form_editors.html.erb +1 -1
- data/app/views/decidim/decidim_awesome/admin/config/_form_proposal_custom_fields.html.erb +4 -4
- data/app/views/decidim/decidim_awesome/admin/config/_form_scoped_styles.html.erb +3 -3
- data/app/views/decidim/decidim_awesome/admin/config/_form_surveys.html.erb +40 -2
- data/app/views/decidim/decidim_awesome/admin/config/_form_verifications.html.erb +1 -1
- data/app/views/decidim/decidim_awesome/admin/hashcash/_filters.html.erb +55 -0
- data/app/views/decidim/decidim_awesome/admin/hashcash/index.html.erb +33 -0
- data/app/views/decidim/decidim_awesome/admin/hashcash/ip_addresses.html.erb +29 -0
- data/app/views/decidim/decidim_awesome/admin/hashcash/show.html.erb +42 -0
- data/app/views/decidim/decidim_awesome/admin/menu_hacks/index.html.erb +2 -2
- data/app/views/decidim/decidim_awesome/admin/{maintenance → private_data}/_private_data.html.erb +2 -2
- data/app/views/decidim/decidim_awesome/admin/{maintenance/show.html.erb → private_data/index.html.erb} +2 -3
- data/app/views/decidim/decidim_awesome/admin/proposals/_private_body.html.erb +1 -1
- data/app/views/decidim/decidim_awesome/admin/shared/_filters_with_date.html.erb +41 -32
- data/app/views/decidim/decidim_awesome/amendments/_modal.html.erb +2 -2
- data/app/views/decidim/decidim_awesome/hashcash/_hidden_field.html.erb +5 -0
- data/app/views/decidim/decidim_awesome/map_component/map/_map_template.html.erb +1 -1
- data/app/views/layouts/decidim/decidim_awesome/_awesome_config.html.erb +2 -2
- data/app/views/layouts/decidim/decidim_awesome/admin/maintenance.html.erb +2 -11
- data/config/assets.rb +3 -1
- data/config/i18n-tasks.yml +1 -0
- data/config/locales/ca.yml +69 -30
- data/config/locales/cs.yml +68 -29
- data/config/locales/de.yml +67 -28
- data/config/locales/en.yml +81 -32
- data/config/locales/es.yml +68 -29
- data/config/locales/eu.yml +31 -31
- data/config/locales/fr.yml +82 -31
- data/config/locales/ja.yml +31 -31
- data/lib/decidim/decidim_awesome/admin_engine.rb +8 -5
- data/lib/decidim/decidim_awesome/awesome.rb +49 -27
- data/lib/decidim/decidim_awesome/checksums.yml +47 -42
- data/lib/decidim/decidim_awesome/context_analyzers/request_analyzer.rb +2 -2
- data/lib/decidim/decidim_awesome/engine.rb +16 -6
- data/lib/decidim/decidim_awesome/menu.rb +151 -138
- data/lib/decidim/decidim_awesome/test/initializer.rb +4 -1
- data/lib/decidim/decidim_awesome/test/shared_examples/box_label_editor_examples.rb +14 -14
- data/lib/decidim/decidim_awesome/test/shared_examples/config_examples.rb +2 -4
- data/lib/decidim/decidim_awesome/test/shared_examples/custom_fields_examples.rb +8 -8
- data/lib/decidim/decidim_awesome/test/shared_examples/custom_styles_examples.rb +6 -6
- data/lib/decidim/decidim_awesome/test/shared_examples/editor_examples.rb +5 -4
- data/lib/decidim/decidim_awesome/test/shared_examples/scoped_admins_examples.rb +5 -5
- data/lib/decidim/decidim_awesome/test/shared_examples/summary_examples.rb +16 -9
- data/lib/decidim/decidim_awesome/version.rb +2 -2
- data/lib/decidim/decidim_awesome.rb +0 -1
- data/lib/tasks/decidim_awesome_upgrade_tasks.rake +4 -5
- data/package.json +9 -18
- metadata +82 -26
- data/app/jobs/decidim/decidim_awesome/migrate_legacy_images_job.rb +0 -107
- data/app/uploaders/decidim/cw/decidim_awesome/image_uploader.rb +0 -26
- data/config/rubocop/disabled.yml +0 -11
- data/config/rubocop/faker.yml +0 -480
- data/config/rubocop/rails.yml +0 -88
- data/config/rubocop/rspec.yml +0 -65
- data/config/rubocop/ruby.yml +0 -1210
- data/lib/decidim/decidim_awesome/content_parsers/editor_images_parser.rb +0 -39
- data/lib/tasks/decidim_awesome_active_storage_migrations_tasks.rake +0 -35
- /data/{app/middleware/decidim/decidim_awesome → lib/decidim/decidim_awesome/middleware}/current_config.rb +0 -0
@@ -0,0 +1,67 @@
|
|
1
|
+
.filters__section {
|
2
|
+
@apply flex gap-4 items-start;
|
3
|
+
|
4
|
+
input {
|
5
|
+
@apply h-9;
|
6
|
+
}
|
7
|
+
|
8
|
+
.form-label {
|
9
|
+
@apply block;
|
10
|
+
}
|
11
|
+
|
12
|
+
.dropdown__container {
|
13
|
+
@apply flex flex-col items-start gap-0 py-0;
|
14
|
+
|
15
|
+
.form-label {
|
16
|
+
@apply block text-sm p-0;
|
17
|
+
}
|
18
|
+
|
19
|
+
.dropdown {
|
20
|
+
@apply flex items-center h-9;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
.grid {
|
25
|
+
@apply flex gap-4 items-start;
|
26
|
+
}
|
27
|
+
|
28
|
+
.datepicker_field {
|
29
|
+
@apply flex flex-col;
|
30
|
+
|
31
|
+
.datepicker__datepicker-row {
|
32
|
+
@apply flex items-center gap-2 order-1;
|
33
|
+
}
|
34
|
+
|
35
|
+
.datepicker__help-text-container {
|
36
|
+
@apply order-2 w-full;
|
37
|
+
}
|
38
|
+
|
39
|
+
.help-text.datepicker__help-date {
|
40
|
+
@apply w-full;
|
41
|
+
}
|
42
|
+
|
43
|
+
.input-group-field {
|
44
|
+
@apply h-9 px-2;
|
45
|
+
}
|
46
|
+
|
47
|
+
.search-button-container button {
|
48
|
+
@apply h-9 w-9 flex items-center justify-center;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
.row.column:last-child {
|
53
|
+
@apply flex items-center justify-center;
|
54
|
+
}
|
55
|
+
|
56
|
+
.search-button-container {
|
57
|
+
@apply flex flex-col items-start;
|
58
|
+
|
59
|
+
button {
|
60
|
+
@apply h-9 px-4 flex items-center justify-center;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
.row.column.search-field {
|
65
|
+
@apply flex-grow;
|
66
|
+
}
|
67
|
+
}
|
@@ -1,17 +1,7 @@
|
|
1
1
|
.awesome_autosave-notice {
|
2
|
-
|
3
|
-
position: fixed;
|
4
|
-
top: 90%;
|
5
|
-
left: 50%;
|
6
|
-
transform: translate(-50%, -50%);
|
7
|
-
padding: 1em 2em;
|
8
|
-
border-radius: 4px;
|
9
|
-
border: 1px solid var(--success);
|
10
|
-
font-weight: 600;
|
11
|
-
color: white;
|
12
|
-
z-index: 1000;
|
2
|
+
@apply bg-success/90 fixed top-[2%] right-[2%] p-4 rounded border border-success font-semibold text-white z-[1000];
|
13
3
|
|
14
4
|
&.error {
|
15
|
-
|
5
|
+
@apply bg-alert/90;
|
16
6
|
}
|
17
7
|
}
|
@@ -22,13 +22,14 @@ module Decidim
|
|
22
22
|
return allow! if user.admin?
|
23
23
|
return allow! if config[:allow_images_in_proposals]
|
24
24
|
return allow! if config[:allow_images_in_editors]
|
25
|
-
|
25
|
+
|
26
|
+
allow! if config[:allow_videos_in_editors]
|
26
27
|
end
|
27
28
|
|
28
29
|
def required_authorizations_action?
|
29
30
|
return false unless permission_action.subject == :required_authorizations
|
30
31
|
|
31
|
-
|
32
|
+
allow! unless context[:user_is_authorized]
|
32
33
|
end
|
33
34
|
end
|
34
35
|
end
|
@@ -31,7 +31,7 @@ module Decidim
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def time_ago
|
34
|
-
I18n.t("decidim.decidim_awesome.admin.
|
34
|
+
I18n.t("decidim.decidim_awesome.admin.private_data.private_data.time_ago", time: time_ago_in_words(last_date)) if last_date
|
35
35
|
end
|
36
36
|
|
37
37
|
def destroyable?
|
@@ -63,7 +63,7 @@ module Decidim
|
|
63
63
|
return if destroyable?
|
64
64
|
return if last_date
|
65
65
|
|
66
|
-
I18n.t("decidim.decidim_awesome.admin.
|
66
|
+
I18n.t("decidim.decidim_awesome.admin.private_data.private_data.done")
|
67
67
|
end
|
68
68
|
end
|
69
69
|
end
|
@@ -9,6 +9,18 @@ module Decidim
|
|
9
9
|
thumbnail: { resize_to_fit: [nil, 237] }
|
10
10
|
}
|
11
11
|
end
|
12
|
+
|
13
|
+
def extension_allowlist
|
14
|
+
%w(jpg jpeg png)
|
15
|
+
end
|
16
|
+
|
17
|
+
def content_type_allowlist
|
18
|
+
%w(image/jpeg image/png)
|
19
|
+
end
|
20
|
+
|
21
|
+
def max_image_height_or_width
|
22
|
+
8000
|
23
|
+
end
|
12
24
|
end
|
13
25
|
end
|
14
26
|
end
|
@@ -10,12 +10,12 @@
|
|
10
10
|
</span>
|
11
11
|
<div class="dropdown-pane" id="export-dropdown" data-dropdown data-auto-focus="true" data-close-on-click="true">
|
12
12
|
<ul class="vertical menu add-components">
|
13
|
-
<% %w
|
13
|
+
<% %w(CSV JSON Excel).each do |format| %>
|
14
14
|
<li class="exports--format--<%= format.downcase %> exports--registrations">
|
15
15
|
<%= link_to t("decidim.decidim_awesome.admin.admin_accountability.exports.export_as", export_format:
|
16
|
-
format.upcase), export_admin_accountability_path(export_params.merge(format:
|
17
|
-
|
18
|
-
|
16
|
+
format.upcase), export_admin_accountability_path(export_params.merge(format:)),
|
17
|
+
method: :post,
|
18
|
+
class: "focus-visible:outline-none" %>
|
19
19
|
</li>
|
20
20
|
<% end %>
|
21
21
|
</ul>
|
@@ -68,3 +68,4 @@
|
|
68
68
|
</div>
|
69
69
|
</div>
|
70
70
|
</div>
|
71
|
+
<% append_stylesheet_pack_tag "decidim_admin_decidim_awesome_search_form" %>
|
@@ -1,3 +1,3 @@
|
|
1
1
|
<%= cell("decidim/announcement",
|
2
|
-
|
3
|
-
|
2
|
+
local_assigns[:message].presence || t("decidim.decidim_awesome.admin.admin_authorizations.#{i18n_key}", name: workflow&.fullname, user: user.name),
|
3
|
+
callout_class: klass) %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%= cell("decidim/announcement", {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
title: t("decidim.decidim_awesome.admin.admin_authorizations.conflict"),
|
3
|
+
body: t("decidim.decidim_awesome.admin.admin_authorizations.conflict_help_html", user: link_to(conflict.user.name, decidim_admin.officializations_path(q: { name_or_nickname_or_email_cont: conflict.user.email })))
|
4
|
+
},
|
5
|
+
callout_class: "alert") %>
|
@@ -1,10 +1,11 @@
|
|
1
1
|
<div class="form-defaults">
|
2
|
+
<%= callout if defined?(callout) %>
|
2
3
|
<%= decidim_form_for(handler,
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
builder: Decidim::AuthorizationFormBuilder,
|
5
|
+
as: "authorization_handler",
|
6
|
+
url: decidim_admin_decidim_awesome.admin_authorization_path(id: user.id, handler: params[:handler]),
|
7
|
+
method: :patch,
|
8
|
+
remote: true) do |form| %>
|
8
9
|
<% if lookup_context.exists?(handler.to_partial_path, [], true) %>
|
9
10
|
<%= render partial: handler.to_partial_path, locals: { handler:, form: } %>
|
10
11
|
<% else %>
|
@@ -46,9 +46,9 @@
|
|
46
46
|
<strong><%= t ".head_tags" %></strong>
|
47
47
|
<ul class="vertical menu">
|
48
48
|
<% {
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
CSS: "//head/link[@rel='stylesheet'][contains(@href,'decidim_decidim_awesome')]",
|
50
|
+
JavaScript: "//script[contains(@src,'decidim_decidim_awesome')]"
|
51
|
+
}.each do |part, xpath| %>
|
52
52
|
<li>
|
53
53
|
<%= part %>
|
54
54
|
<% if head.xpath(xpath).count.positive? %>
|
@@ -66,9 +66,9 @@
|
|
66
66
|
<strong><%= t ".admin_head_tags" %></strong>
|
67
67
|
<ul class="vertical menu">
|
68
68
|
<% {
|
69
|
-
|
70
|
-
|
71
|
-
|
69
|
+
CSS: "//head/link[@rel='stylesheet'][contains(@href,'decidim_admin_decidim_awesome')]",
|
70
|
+
JavaScript: "//script[contains(@src,'decidim_admin_decidim_awesome')]"
|
71
|
+
}.each do |part, xpath| %>
|
72
72
|
<li>
|
73
73
|
<%= part %>
|
74
74
|
<% if admin_head.xpath(xpath).count.positive? %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= label_tag var do %>
|
2
2
|
<%= t("config.#{var}",
|
3
|
-
|
4
|
-
|
3
|
+
scope: "activemodel.attributes",
|
4
|
+
id: "<span class='awesome-auto-edit' data-var='#{var}' data-scope='#{scope}' data-key='#{key}'>#{key}</span>").html_safe %>
|
5
5
|
|
6
6
|
<%= icon_link_to "pencil-line", "#", t("edit_label", scope: "decidim.decidim_awesome.admin.config.form"), class: "awesome-auto-edit", data: { "scope" => "#{scope}" } %>
|
7
7
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<span class="label warning"><%= t ".always" %></span>
|
6
6
|
<% end %>
|
7
7
|
|
8
|
-
<ul class="constraints-list<%= " inactive" if constraints&.
|
8
|
+
<ul class="constraints-list<%= " inactive" if constraints&.find { |c| c.settings["participatory_space_manifest"] == "none" } %>">
|
9
9
|
<% constraints&.each do |constraint| %>
|
10
10
|
<li>
|
11
11
|
<% constraint.settings.reverse_each do |k, val| %>
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<% end %>
|
14
14
|
|
15
15
|
<div class="inline-flex items-center gap-1 ml-10">
|
16
|
-
<button id="<%= "edit-#{key}-#{constraint.id}" %>" type="button" name="button" class="edit-condition button button__xs button__transparent-secondary" data-dialog-open="<%= "edit-modal-#{key}" %>" data-constraints-url="<%= constraint_path(id: constraint.id, key:
|
16
|
+
<button id="<%= "edit-#{key}-#{constraint.id}" %>" type="button" name="button" class="edit-condition button button__xs button__transparent-secondary" data-dialog-open="<%= "edit-modal-#{key}" %>" data-constraints-url="<%= constraint_path(id: constraint.id, key:) %>">
|
17
17
|
<%= t ".edit" %>
|
18
18
|
</button>
|
19
19
|
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<% end %>
|
24
24
|
</ul>
|
25
25
|
|
26
|
-
<button id="<%= "new-#{key}" %>" type="button" name="button" class="add-condition button button__xs button__secondary" data-dialog-open="<%= "new-modal-#{key}" %>" data-constraints-url="<%= new_constraint_path(key:
|
26
|
+
<button id="<%= "new-#{key}" %>" type="button" name="button" class="add-condition button button__xs button__secondary" data-dialog-open="<%= "new-modal-#{key}" %>" data-constraints-url="<%= new_constraint_path(key:) %>">
|
27
27
|
<%= icon "add-box-line" %>
|
28
28
|
<%= t ".add_condition" %>
|
29
29
|
</button>
|
@@ -4,10 +4,11 @@
|
|
4
4
|
|
5
5
|
<% form.object.scoped_admins&.each do |key, value| %>
|
6
6
|
<div class="card p-4 scoped_admins_container js-box-container" data-key="<%= key %>">
|
7
|
-
<%= render(partial: "decidim/decidim_awesome/admin/config/autoedit_box_label", locals: { var: "scoped_admins", key
|
8
|
-
<p class="form-error is-visible" id="scoped-admin-error-<%=
|
7
|
+
<%= render(partial: "decidim/decidim_awesome/admin/config/autoedit_box_label", locals: { var: "scoped_admins", key:, scope: "scoped_admin_#{key}", delete_path: decidim_admin_decidim_awesome.scoped_admin_path(key:) }) %>
|
8
|
+
<p class="form-error is-visible" id="scoped-admin-error-<%= key %>"><%= errors[key.to_sym].join("<br>") if errors %></p>
|
9
9
|
|
10
|
-
<%=
|
10
|
+
<%= hidden_field_tag("config[scoped_admins][#{key}][]") %>
|
11
|
+
<%= select_tag "config[scoped_admins][#{key}]", options_for_select(users_for(value), value), { include_blank: false, class: "multiusers-select", multiple: true, data: { url: decidim_admin_decidim_awesome.users_path } } %>
|
11
12
|
|
12
13
|
<%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: "scoped_admin_#{key}", constraints: constraints_for("scoped_admin_#{key}") }) %>
|
13
14
|
</div>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<div class="row column card p-4">
|
9
9
|
<%= form.check_box key, help_text: t("help.#{key}", scope: "decidim.decidim_awesome.admin.config.form") %>
|
10
10
|
|
11
|
-
<%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key
|
11
|
+
<%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key:, constraints: constraints_for(key) }) %>
|
12
12
|
</div>
|
13
13
|
<% end %>
|
14
14
|
</div>
|
@@ -8,9 +8,9 @@
|
|
8
8
|
<div>
|
9
9
|
<p class="help-text text-alert"><%= t("help.proposal_private_custom_fields", scope: "decidim.decidim_awesome.admin.config.form") %></p>
|
10
10
|
<p class="help-text"><%= t("help.proposal_private_custom_fields_translations",
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
scope: "decidim.decidim_awesome.admin.config.form",
|
12
|
+
warning: content_tag(:i, t("decidim.decidim_awesome.proposal_private_custom_fields_disclosure")),
|
13
|
+
key: content_tag("code", "decidim.decidim_awesome.proposal_private_custom_fields_disclosure")
|
14
14
|
).html_safe %></p>
|
15
15
|
</div>
|
16
16
|
<% else %>
|
@@ -22,7 +22,7 @@
|
|
22
22
|
<% end %>
|
23
23
|
<% form.object.send(config_var)&.each do |key, value| %>
|
24
24
|
<div class="card p-4 proposal_custom_fields_container<%= " private" if priv %> js-box-container" data-key="<%= key %>" data-var="<%= config_var %>">
|
25
|
-
<%= render("decidim/decidim_awesome/admin/config/autoedit_box_label", var: config_var, key
|
25
|
+
<%= render("decidim/decidim_awesome/admin/config/autoedit_box_label", var: config_var, key:, scope: "#{field}_#{key}", delete_path: decidim_admin_decidim_awesome.proposal_custom_field_path(key:, private: priv)) %>
|
26
26
|
<p class="form-error is-visible"><%= errors[key.to_sym].join("<br>") if errors %></p>
|
27
27
|
|
28
28
|
<%= hidden_field_tag key, value, name: "config[#{config_var}][#{key}]" %>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<%= t("help.scoped_admin_styles_variables", scope: "decidim.decidim_awesome.admin.config.form") %>
|
12
12
|
</p>
|
13
13
|
<p class="colors">
|
14
|
-
<%
|
14
|
+
<% %w(primary secondary tertiary success warning alert).each do |color| %>
|
15
15
|
<span class="color-box <%= color %>" style="background-color: <%= current_organization.colors[color] %>"></span>
|
16
16
|
<code>var(--<%= color %>)</code>
|
17
17
|
<% end %>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<%= t("help.scoped_styles_variables", scope: "decidim.decidim_awesome.admin.config.form") %>
|
24
24
|
</p>
|
25
25
|
<p class="colors">
|
26
|
-
<%
|
26
|
+
<% %w(primary secondary tertiary success warning alert).each do |color| %>
|
27
27
|
<span class="color-box <%= color %>" style="background-color: <%= current_organization.colors[color] %>"></span>
|
28
28
|
<code>var(--<%= color %>)</code>
|
29
29
|
<% end %>
|
@@ -32,7 +32,7 @@
|
|
32
32
|
<% end %>
|
33
33
|
<% form.object.send(config_var)&.each do |key, value| %>
|
34
34
|
<div class="card p-4 scoped_styles_container<%= " private" if admin_styles %> js-box-container" data-key="<%= key %>" data-var="<%= config_var %>">
|
35
|
-
<%= render("decidim/decidim_awesome/admin/config/autoedit_box_label", var: config_var, key
|
35
|
+
<%= render("decidim/decidim_awesome/admin/config/autoedit_box_label", var: config_var, key:, scope: "#{style}_#{key}", delete_path: decidim_admin_decidim_awesome.scoped_style_path(key:, admin_panel: admin_styles)) %>
|
36
36
|
<p class="form-error is-visible" id="custom-style-error-<%= key %>"><%= errors[key.to_sym].join("<br>") if errors %></p>
|
37
37
|
<%= text_area_tag key, value, name: "config[#{config_var}][#{key}]", rows: 5 %>
|
38
38
|
<%= render("decidim/decidim_awesome/admin/config/constraints", key: "#{style}_#{key}", constraints: constraints_for("#{style}_#{key}")) %>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<% if config_enabled? :auto_save_forms %>
|
3
3
|
<div class="row column">
|
4
4
|
<%= form.check_box :auto_save_forms %>
|
5
|
-
<span class="help-text mb-4"
|
5
|
+
<span class="help-text mb-4">
|
6
6
|
<%= t("help.auto_save_forms", scope: "decidim.decidim_awesome.admin.config.form") %>
|
7
7
|
</span>
|
8
8
|
<%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :auto_save_forms, constraints: constraints_for(:auto_save_forms) }) %>
|
@@ -11,9 +11,47 @@
|
|
11
11
|
<% if config_enabled? :user_timezone %>
|
12
12
|
<div class="row column">
|
13
13
|
<%= form.check_box :user_timezone %>
|
14
|
-
<span class="help-text mb-4"
|
14
|
+
<span class="help-text mb-4">
|
15
15
|
<%= t("help.user_timezone", scope: "decidim.decidim_awesome.admin.config.form") %>
|
16
16
|
</span>
|
17
17
|
</div>
|
18
18
|
<% end %>
|
19
|
+
|
20
|
+
<% if config_enabled?(:hashcash_login, :hashcash_signup) %>
|
21
|
+
<div class="row column">
|
22
|
+
<% if config_enabled? :hashcash_signup %>
|
23
|
+
<div>
|
24
|
+
<%= form.check_box :hashcash_signup %>
|
25
|
+
<span class="help-text mb-4">
|
26
|
+
<%= t("help.hashcash_signup", scope: "decidim.decidim_awesome.admin.config.form") %>
|
27
|
+
</span>
|
28
|
+
</div>
|
29
|
+
<div>
|
30
|
+
<%= form.number_field :hashcash_signup_bits %>
|
31
|
+
<span class="help-text mb-4">
|
32
|
+
<%= t("help.hashcash_signup_bits", scope: "decidim.decidim_awesome.admin.config.form", bits: Decidim::DecidimAwesome.hashcash_signup_bits) %>
|
33
|
+
</span>
|
34
|
+
</div>
|
35
|
+
<% end %>
|
36
|
+
|
37
|
+
<% if config_enabled? :hashcash_login %>
|
38
|
+
<div>
|
39
|
+
<%= form.check_box :hashcash_login %>
|
40
|
+
<span class="help-text mb-4">
|
41
|
+
<%= t("help.hashcash_login", scope: "decidim.decidim_awesome.admin.config.form") %>
|
42
|
+
</span>
|
43
|
+
</div>
|
44
|
+
<div>
|
45
|
+
<%= form.number_field :hashcash_login_bits %>
|
46
|
+
<span class="help-text mb-4">
|
47
|
+
<%= t("help.hashcash_login_bits", scope: "decidim.decidim_awesome.admin.config.form", bits: Decidim::DecidimAwesome.hashcash_login_bits) %>
|
48
|
+
</span>
|
49
|
+
</div>
|
50
|
+
<% end %>
|
51
|
+
|
52
|
+
<p class="help-text pt-0 pb-4 label">
|
53
|
+
<%= t("help.hashcash_i18n_key", scope: "decidim.decidim_awesome.admin.config.form", key: "<code>active_hashcash.waiting_label</code>").html_safe %>
|
54
|
+
</p>
|
55
|
+
</div>
|
56
|
+
<% end %>
|
19
57
|
</div>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
<% if config_enabled? :force_authorization_after_login %>
|
5
5
|
<div>
|
6
|
-
<%= form.select :force_authorization_after_login, available_authorizations.map {|workflow| [workflow.fullname, workflow.name]}, { include_blank: false }, { multiple: true } %>
|
6
|
+
<%= form.select :force_authorization_after_login, available_authorizations.map { |workflow| [workflow.fullname, workflow.name] }, { include_blank: false }, { multiple: true } %>
|
7
7
|
<p class="help-text"><%= t("help.force_authorization_after_login", scope: "decidim.decidim_awesome.admin.config.form") %></p>
|
8
8
|
|
9
9
|
<%= form.check_box :force_authorization_with_any_method %>
|
@@ -0,0 +1,55 @@
|
|
1
|
+
<div class="fcell search mb-4">
|
2
|
+
<%= form_tag nil, method: :get, class: "form form-defaults" do %>
|
3
|
+
<div class="form__wrapper block bg-gray-5 p-4">
|
4
|
+
<div class="grid grid-cols-3 gap-x-4 pt-4">
|
5
|
+
<div class="content-end">
|
6
|
+
<%= label_tag :created_from do %>
|
7
|
+
<%= t("created_at", scope: "decidim.decidim_awesome.admin.hashcash.index") + " ≥" %>
|
8
|
+
<%= date_field_tag :created_from, params[:created_from], autocomplete: :off %>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
11
|
+
<div class="content-end">
|
12
|
+
<%= label_tag :created_from do %>
|
13
|
+
<%= t("created_at", scope: "decidim.decidim_awesome.admin.hashcash.index") + " ≤" %>
|
14
|
+
<%= date_field_tag :created_to, params[:created_to], autocomplete: :off %>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
17
|
+
<div class="content-end grid grid-cols-2 gap-x-4 pt-8">
|
18
|
+
<div>
|
19
|
+
<%= label_tag :bits_from do %>
|
20
|
+
<%= t("bits", scope: "decidim.decidim_awesome.admin.hashcash.index") + " ≥" %>
|
21
|
+
<%= number_field_tag :bits_from, params[:bits_from], autocomplete: :off %>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
24
|
+
<div>
|
25
|
+
<%= label_tag :bits_to do %>
|
26
|
+
<%= t("bits", scope: "decidim.decidim_awesome.admin.hashcash.index") + " ≤" %>
|
27
|
+
<%= number_field_tag :bits_to, params[:bits_to], autocomplete: :off %>
|
28
|
+
<% end %>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<div class="grid grid-cols-3 gap-x-4 py-4">
|
34
|
+
<div class="content-end">
|
35
|
+
<%= label_tag :ip_address_starts_with, t("ip_address", scope: "decidim.decidim_awesome.admin.hashcash.index") %>
|
36
|
+
<%= text_field_tag :ip_address_starts_with, params[:ip_address_starts_with], autocomplete: :off %>
|
37
|
+
</div>
|
38
|
+
<div class="content-end">
|
39
|
+
<%= label_tag :request_path_starts_with, t("request_path", scope: "decidim.decidim_awesome.admin.hashcash.index") %>
|
40
|
+
<%= text_field_tag :request_path_starts_with, params[:request_path_starts_with], autocomplete: :off %>
|
41
|
+
</div>
|
42
|
+
<div class="content-end">
|
43
|
+
<div class="grid grid-cols-2 gap-x-4 mb-[4px]">
|
44
|
+
<%= submit_tag t("active_hashcash.submit_filter"), class: "button button__sm button__secondary" %>
|
45
|
+
<% if params[:action] == "index" %>
|
46
|
+
<%= link_to t(".ip_addresses"), ip_addresses_hashcashes_path, class: "button button__sm button__transparent-secondary" %>
|
47
|
+
<% else %>
|
48
|
+
<%= link_to t(".stamps"), hashcashes_path, class: "button button__sm button__transparent-secondary" %>
|
49
|
+
<% end %>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
</div>
|
54
|
+
<% end %>
|
55
|
+
</div>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<div class="mb-8">
|
2
|
+
<p class="help-text"><%= t(".help_html") %>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<%= render "filters" %>
|
6
|
+
|
7
|
+
<% if stamps.empty? %>
|
8
|
+
<div class="callout warning"><%= t(".no_data") %></div>
|
9
|
+
<% else %>
|
10
|
+
<div class="table-scroll">
|
11
|
+
<table class="table-list">
|
12
|
+
<thead>
|
13
|
+
<tr>
|
14
|
+
<th><%= t(".created_at") %></th>
|
15
|
+
<th><%= t(".ip_address") %></th>
|
16
|
+
<th><%= t(".request_path") %></th>
|
17
|
+
<th><%= t(".bits") %></th>
|
18
|
+
</tr>
|
19
|
+
</thead>
|
20
|
+
|
21
|
+
<tbody>
|
22
|
+
<% stamps.each do |stamp| %>
|
23
|
+
<tr>
|
24
|
+
<td><%= link_to stamp.created_at, hashcash_path(stamp) %></td>
|
25
|
+
<td><%= stamp.ip_address %></td>
|
26
|
+
<td><%= stamp.request_path %></td>
|
27
|
+
<td><%= stamp.bits %></td>
|
28
|
+
</tr>
|
29
|
+
<% end %>
|
30
|
+
</tbody>
|
31
|
+
</table>
|
32
|
+
</div>
|
33
|
+
<% end %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<div class="mb-8">
|
2
|
+
<p class="help-text"><%= t(".help_html") %>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<%= render "filters" %>
|
6
|
+
|
7
|
+
<% if addresses.empty? %>
|
8
|
+
<div class="callout warning"><%= t(".no_data") %></div>
|
9
|
+
<% else %>
|
10
|
+
<div class="table-scroll">
|
11
|
+
<table class="table-list">
|
12
|
+
<thead>
|
13
|
+
<tr>
|
14
|
+
<th><%= t(".ip_address") %></th>
|
15
|
+
<th><%= t(".stamps") %></th>
|
16
|
+
</tr>
|
17
|
+
</thead>
|
18
|
+
|
19
|
+
<tbody>
|
20
|
+
<% addresses.each do |address, count| %>
|
21
|
+
<tr>
|
22
|
+
<td><%= link_to address, hashcashes_path(ip_address_starts_with: address) %></td>
|
23
|
+
<td><%= number_with_delimiter count %></td>
|
24
|
+
</tr>
|
25
|
+
<% end %>
|
26
|
+
</tbody>
|
27
|
+
</table>
|
28
|
+
</div>
|
29
|
+
<% end %>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<div>
|
2
|
+
<h3 class="h3"><%= stamp %></h3>
|
3
|
+
<dl class="divide-y divide-gray-100">
|
4
|
+
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
|
5
|
+
<dt class="font-semibold"><%= stamp.class.human_attribute_name(:created_at) %></dt>
|
6
|
+
<dd mt-1 class="sm:col-span-2 sm:mt-0"><%= l stamp.created_at %></dd>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
|
10
|
+
<dt class="font-semibold"><%= stamp.class.human_attribute_name(:resource) %></dt>
|
11
|
+
<dd mt-1 class="sm:col-span-2 sm:mt-0"><%= stamp.resource %></dd>
|
12
|
+
</div>
|
13
|
+
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
|
14
|
+
<dt class="font-semibold"><%= stamp.class.human_attribute_name(:bits) %></dt>
|
15
|
+
<dd mt-1 class="sm:col-span-2 sm:mt-0"><%= stamp.bits %></dd>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
|
19
|
+
<dt class="font-semibold"><%= stamp.class.human_attribute_name(:ip_address) %></dt>
|
20
|
+
<dd mt-1 class="sm:col-span-2 sm:mt-0"><%= stamp.ip_address %></dd>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
|
24
|
+
<dt class="font-semibold"><%= stamp.class.human_attribute_name(:request_path) %></dt>
|
25
|
+
<dd mt-1 class="sm:col-span-2 sm:mt-0"><%= stamp.request_path %></dd>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
|
29
|
+
<dt class="font-semibold"><%= stamp.class.human_attribute_name(:context) %></dt>
|
30
|
+
<dd mt-1 class="sm:col-span-2 sm:mt-0"><%= stamp.context %></dd>
|
31
|
+
</div>
|
32
|
+
</dl>
|
33
|
+
|
34
|
+
<div class="grid grid-cols-4 gap-x-4 mb-[4px]">
|
35
|
+
<button class="button button__sm button__transparent-secondary">
|
36
|
+
<%= link_to t("decidim.decidim_awesome.admin.hashcash.filters.stamps"), hashcashes_path %>
|
37
|
+
</button>
|
38
|
+
<button class="button button__sm button__transparent-secondary">
|
39
|
+
<%= link_to t("decidim.decidim_awesome.admin.hashcash.filters.ip_addresses"), ip_addresses_hashcashes_path %>
|
40
|
+
</button>
|
41
|
+
</div>
|
42
|
+
</div>
|
@@ -22,12 +22,12 @@
|
|
22
22
|
<td><%= item.label %></td>
|
23
23
|
<td><%= item.url %></td>
|
24
24
|
<td><%= item.position %></td>
|
25
|
-
<td><%= target_options.invert[item.try(:target)||""] %></td>
|
25
|
+
<td><%= target_options.invert[item.try(:target) || ""] %></td>
|
26
26
|
<td><%= visibility_options.invert[item.try(:visibility)] %></td>
|
27
27
|
<td class="table-list__actions">
|
28
28
|
<%= icon_link_to "pencil-line", decidim_admin_decidim_awesome.edit_menu_hack_path(params[:menu_id], md5(item.url)), t(".edit"), class: "action-icon--edit" %>
|
29
29
|
<% if item.respond_to?(:overrided?) %>
|
30
|
-
<%= icon_link_to "close-circle-line", decidim_admin_decidim_awesome.menu_hack_path(params[:menu_id], md5(item.url)), t(".remove#{
|
30
|
+
<%= icon_link_to "close-circle-line", decidim_admin_decidim_awesome.menu_hack_path(params[:menu_id], md5(item.url)), t(".remove#{"_hack" if item.overrided?}"), method: :delete, class: "action-icon--remove", data: { confirm: t(".confirm_destroy") } %>
|
31
31
|
<% else %>
|
32
32
|
<span class="action-icon">
|
33
33
|
<%= icon "close-circle-line", class: "action-icon action-icon--disabled", role: "img" %>
|
data/app/views/decidim/decidim_awesome/admin/{maintenance → private_data}/_private_data.html.erb
RENAMED
@@ -5,7 +5,7 @@
|
|
5
5
|
<% if collection.empty? %>
|
6
6
|
<div class="callout warning"><%= t(".no_data", time_ago:) %></div>
|
7
7
|
<% else %>
|
8
|
-
<div class="table-scroll autorefresh" data-url="<%=
|
8
|
+
<div class="table-scroll autorefresh" data-url="<%= private_data_path.split("?").first %>">
|
9
9
|
<table class="table-list">
|
10
10
|
<thead>
|
11
11
|
<tr>
|
@@ -27,7 +27,7 @@
|
|
27
27
|
<% if item.locked? %>
|
28
28
|
<span class="loading-spinner primary" title="<%= t(".removing") %>"></span>
|
29
29
|
<% elsif item.destroyable? %>
|
30
|
-
<%= link_to
|
30
|
+
<%= link_to private_datum_path(item), method: :delete, class: "button button__primary button__xs tiny", data: { confirm: t(".confirm_delete") } do %>
|
31
31
|
<%= icon "delete-bin-line" %>
|
32
32
|
<%= t(".delete") %>
|
33
33
|
<% end %>
|