decidim-admin 0.30.1 → 0.31.0.rc1
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/app/commands/decidim/admin/update_organization.rb +18 -3
- data/app/controllers/concerns/decidim/admin/content_blocks/landing_page_content_blocks.rb +1 -1
- data/app/controllers/concerns/decidim/admin/filterable.rb +1 -1
- data/app/controllers/decidim/admin/area_types_controller.rb +2 -2
- data/app/controllers/decidim/admin/areas_controller.rb +2 -2
- data/app/controllers/decidim/admin/block_user_controller.rb +2 -2
- data/app/controllers/decidim/admin/component_permissions_controller.rb +1 -1
- data/app/controllers/decidim/admin/components_controller.rb +2 -2
- data/app/controllers/decidim/admin/concerns/has_attachment_collections.rb +2 -2
- data/app/controllers/decidim/admin/concerns/has_attachments.rb +2 -2
- data/app/controllers/decidim/admin/concerns/has_private_users.rb +3 -3
- data/app/controllers/decidim/admin/concerns/has_private_users_csv_import.rb +1 -1
- data/app/controllers/decidim/admin/conflicts_controller.rb +1 -1
- data/app/controllers/decidim/admin/dashboard_controller.rb +0 -9
- data/app/controllers/decidim/admin/impersonations_controller.rb +1 -1
- data/app/controllers/decidim/admin/imports_controller.rb +1 -1
- data/app/controllers/decidim/admin/managed_users/promotions_controller.rb +1 -1
- data/app/controllers/decidim/admin/newsletters_controller.rb +4 -4
- data/app/controllers/decidim/admin/organization_appearance_controller.rb +1 -3
- data/app/controllers/decidim/admin/organization_controller.rb +3 -5
- data/app/controllers/decidim/admin/organization_external_domain_allowlist_controller.rb +1 -1
- data/app/controllers/decidim/admin/organization_homepage_controller.rb +4 -0
- data/app/controllers/decidim/admin/participatory_space/user_role_controller.rb +2 -2
- data/app/controllers/decidim/admin/reminders_controller.rb +1 -1
- data/app/controllers/decidim/admin/resource_permissions_controller.rb +1 -1
- data/app/controllers/decidim/admin/scope_types_controller.rb +2 -2
- data/app/controllers/decidim/admin/scopes_controller.rb +2 -2
- data/app/controllers/decidim/admin/share_tokens_controller.rb +8 -8
- data/app/controllers/decidim/admin/static_page_topics_controller.rb +2 -2
- data/app/controllers/decidim/admin/static_pages_controller.rb +2 -2
- data/app/controllers/decidim/admin/statistics_controller.rb +34 -0
- data/app/controllers/decidim/admin/taxonomies_controller.rb +2 -2
- data/app/controllers/decidim/admin/taxonomy_filters_controller.rb +2 -2
- data/app/controllers/decidim/admin/taxonomy_items_controller.rb +2 -2
- data/app/controllers/decidim/admin/users_controller.rb +1 -1
- data/app/forms/decidim/admin/block_user_form.rb +1 -1
- data/app/forms/decidim/admin/block_users_form.rb +1 -1
- data/app/forms/decidim/admin/organization_form.rb +35 -6
- data/app/helpers/decidim/admin/filterable_helper.rb +27 -8
- data/app/helpers/decidim/admin/icon_link_helper.rb +2 -3
- data/app/helpers/decidim/admin/icon_with_tooltip_helper.rb +1 -2
- data/app/helpers/decidim/admin/imports_helper.rb +0 -5
- data/app/helpers/decidim/admin/menu_helper.rb +3 -2
- data/app/helpers/decidim/admin/moderations/reports_helper.rb +1 -1
- data/app/helpers/decidim/admin/resource_permissions_helper.rb +13 -13
- data/app/helpers/decidim/admin/settings_helper.rb +11 -3
- data/app/jobs/decidim/admin/newsletter_job.rb +1 -0
- data/app/packs/entrypoints/decidim_admin.js +2 -3
- data/app/packs/entrypoints/decidim_admin.scss +1 -1
- data/app/packs/entrypoints/decidim_admin_overrides.scss +1 -1
- data/app/packs/src/decidim/admin/admin_autocomplete.js +2 -2
- data/app/packs/src/decidim/admin/application.js +11 -10
- data/app/packs/src/decidim/admin/budget_rule_toggler.component.js +84 -34
- data/app/packs/src/decidim/admin/controllers/slug/controller.js +25 -0
- data/app/packs/src/decidim/admin/controllers/slug/slug.test.js +239 -0
- data/app/packs/src/decidim/admin/css_preview.js +1 -1
- data/app/packs/src/decidim/admin/draggable-list.js +1 -1
- data/app/packs/src/decidim/admin/draggable-table.js +1 -1
- data/app/packs/src/decidim/admin/dynamic_fields.component.js +13 -12
- data/app/packs/src/decidim/admin/external_domain_allowlist.js +1 -1
- data/app/packs/src/decidim/admin/form.js +21 -4
- data/app/packs/src/decidim/admin/global_moderations.js +2 -2
- data/app/packs/src/decidim/admin/managed_moderated_users.js +2 -2
- data/app/packs/src/decidim/admin/moderations.js +1 -1
- data/app/packs/src/decidim/admin/newsletters.js +1 -1
- data/app/packs/src/decidim/admin/officializations.js +1 -1
- data/app/packs/src/decidim/admin/participatory_space_search.js +2 -2
- data/app/packs/src/decidim/admin/proposal_infinite_edit.js +1 -1
- data/app/packs/src/decidim/admin/resources_permissions.js +1 -1
- data/app/packs/src/decidim/admin/sortable.js +1 -1
- data/app/packs/src/decidim/admin/sync_radio_buttons.js +1 -1
- data/app/packs/src/decidim/admin/tab_focus.js +1 -1
- data/app/packs/src/decidim/admin/text_copy.js +1 -1
- data/app/packs/src/decidim/admin/triadic_color_picker.js +1 -1
- data/app/packs/stylesheets/decidim/admin/_datepicker.scss +2 -2
- data/app/packs/stylesheets/decidim/admin/_dropdown.scss +12 -2
- data/app/packs/stylesheets/decidim/admin/_filters.scss +1 -57
- data/app/packs/stylesheets/decidim/admin/_forms.scss +1 -10
- data/app/packs/stylesheets/decidim/admin/_item_edit.scss +2 -10
- data/app/packs/stylesheets/decidim/admin/_item_show.scss +1 -5
- data/app/packs/stylesheets/decidim/admin/_legacy_foundation.scss +0 -412
- data/app/packs/stylesheets/decidim/admin/_main-nav.scss +75 -3
- data/app/packs/stylesheets/decidim/admin/_secondary-nav.scss +6 -10
- data/app/packs/stylesheets/decidim/admin/_select_picker.scss +1 -1
- data/app/packs/stylesheets/decidim/admin/_sidebar-menu.scss +2 -2
- data/app/packs/stylesheets/decidim/admin/_table-list.scss +25 -7
- data/app/packs/stylesheets/decidim/admin/_tabs.scss +4 -0
- data/app/packs/stylesheets/decidim/admin/_taxonomies.scss +6 -2
- data/app/packs/stylesheets/decidim/admin/application.scss +28 -29
- data/app/permissions/decidim/admin/permissions.rb +17 -5
- data/app/presenters/decidim/admin/dashboard_statistic_charts_presenter.rb +18 -0
- data/app/queries/decidim/admin/user_filter.rb +3 -3
- data/app/views/decidim/admin/area_types/index.html.erb +34 -11
- data/app/views/decidim/admin/areas/index.html.erb +32 -12
- data/app/views/decidim/admin/attachment_collections/index.html.erb +42 -14
- data/app/views/decidim/admin/attachments/index.html.erb +32 -13
- data/app/views/decidim/admin/block_user/bulk_new.html.erb +1 -1
- data/app/views/decidim/admin/block_user/new.html.erb +1 -1
- data/app/views/decidim/admin/components/_actions.html.erb +114 -54
- data/app/views/decidim/admin/components/_component_row.html.erb +5 -5
- data/app/views/decidim/admin/components/_components_table.html.erb +1 -1
- data/app/views/decidim/admin/components/_form.html.erb +4 -4
- data/app/views/decidim/admin/components/index.html.erb +12 -13
- data/app/views/decidim/admin/dashboard/show.html.erb +9 -21
- data/app/views/decidim/admin/exports/_dropdown.html.erb +16 -14
- data/app/views/decidim/admin/help_sections/_form.html.erb +1 -1
- data/app/views/decidim/admin/impersonatable_users/index.html.erb +68 -33
- data/app/views/decidim/admin/imports/_dropdown.html.erb +13 -11
- data/app/views/decidim/admin/imports/new.html.erb +13 -12
- data/app/views/decidim/admin/moderated_users/bulk_actions/_dropdown.html.erb +29 -32
- data/app/views/decidim/admin/moderated_users/index.html.erb +61 -21
- data/app/views/decidim/admin/moderations/_moderation-tr.html.erb +87 -32
- data/app/views/decidim/admin/moderations/_report.html.erb +2 -4
- data/app/views/decidim/admin/moderations/bulk_actions/_dropdown.html.erb +30 -34
- data/app/views/decidim/admin/moderations/index.html.erb +1 -1
- data/app/views/decidim/admin/moderations/reports/index.html.erb +1 -2
- data/app/views/decidim/admin/newsletters/index.html.erb +64 -21
- data/app/views/decidim/admin/officializations/index.html.erb +91 -32
- data/app/views/decidim/admin/organization/_form.html.erb +6 -92
- data/app/views/decidim/admin/organization/edit.html.erb +1 -5
- data/app/views/decidim/admin/organization/form/_admin_terms_of_service.html.erb +15 -0
- data/app/views/decidim/admin/organization/form/_basic_configuration.html.erb +31 -0
- data/app/views/decidim/admin/{organization_appearance → organization}/form/_colors.html.erb +9 -9
- data/app/views/decidim/admin/organization/form/_extra_features.html.erb +84 -0
- data/app/views/decidim/admin/{organization_appearance/form/_images.html.erb → organization/form/_logos.html.erb} +4 -4
- data/app/views/decidim/admin/organization/form/_welcome_notification.html.erb +25 -0
- data/app/views/decidim/admin/organization_external_domain_allowlist/_external_domain.html.erb +8 -6
- data/app/views/decidim/admin/participatory_space_private_users/index.html.erb +49 -22
- data/app/views/decidim/admin/resource_permissions/edit.html.erb +1 -1
- data/app/views/decidim/admin/scope_types/index.html.erb +31 -12
- data/app/views/decidim/admin/scopes/index.html.erb +40 -13
- data/app/views/decidim/admin/share_tokens/_form.html.erb +1 -1
- data/app/views/decidim/admin/share_tokens/edit.html.erb +1 -1
- data/app/views/decidim/admin/share_tokens/index.html.erb +69 -12
- data/app/views/decidim/admin/share_tokens/new.html.erb +1 -1
- data/app/views/decidim/admin/shared/_filters.html.erb +8 -10
- data/app/views/decidim/admin/shared/landing_page/_content_blocks.html.erb +14 -11
- data/app/views/decidim/admin/shared/landing_page_content_blocks/edit.html.erb +2 -4
- data/app/views/decidim/admin/static_page_topics/index.html.erb +31 -10
- data/app/views/decidim/admin/static_pages/_form.html.erb +1 -1
- data/app/views/decidim/admin/static_pages/_topic.html.erb +46 -16
- data/app/views/decidim/admin/statistics/_statistics.html.erb +13 -0
- data/app/views/decidim/admin/statistics/index.html.erb +6 -0
- data/app/views/decidim/admin/taxonomies/_form.html.erb +1 -1
- data/app/views/decidim/admin/taxonomies/_row.html.erb +24 -6
- data/app/views/decidim/admin/taxonomies/_table.html.erb +2 -2
- data/app/views/decidim/admin/taxonomies/_taxonomy_actions.html.erb +48 -15
- data/app/views/decidim/admin/taxonomies/edit.html.erb +10 -0
- data/app/views/decidim/admin/taxonomy_filters/_form.html.erb +1 -1
- data/app/views/decidim/admin/taxonomy_filters/_table.html.erb +52 -15
- data/app/views/decidim/admin/taxonomy_filters/new.html.erb +1 -1
- data/app/views/decidim/admin/taxonomy_filters_selector/_component_table.html.erb +38 -23
- data/app/views/decidim/admin/taxonomy_items/_form.html.erb +1 -1
- data/app/views/decidim/admin/users/index.html.erb +48 -24
- data/app/views/layouts/decidim/admin/_application.html.erb +3 -6
- data/app/views/layouts/decidim/admin/_header.html.erb +3 -1
- data/app/views/layouts/decidim/admin/_js_configuration.html.erb +11 -12
- data/app/views/layouts/decidim/admin/_sidebar_menu.html.erb +1 -1
- data/app/views/layouts/decidim/admin/_title_bar.html.erb +4 -4
- data/app/views/layouts/decidim/admin/_title_bar_responsive.html.erb +4 -4
- data/app/views/layouts/decidim/admin/insights.html.erb +6 -0
- data/config/assets.rb +2 -2
- data/config/locales/ar.yml +2 -86
- data/config/locales/bg.yml +4 -105
- data/config/locales/bs-BA.yml +0 -44
- data/config/locales/ca-IT.yml +59 -117
- data/config/locales/ca.yml +59 -117
- data/config/locales/cs.yml +51 -119
- data/config/locales/de.yml +63 -121
- data/config/locales/el.yml +5 -97
- data/config/locales/en.yml +61 -119
- data/config/locales/eo.yml +0 -4
- data/config/locales/es-MX.yml +60 -118
- data/config/locales/es-PY.yml +60 -118
- data/config/locales/es.yml +60 -118
- data/config/locales/eu.yml +65 -123
- data/config/locales/fi-plain.yml +62 -109
- data/config/locales/fi.yml +62 -109
- data/config/locales/fr-CA.yml +69 -120
- data/config/locales/fr.yml +69 -120
- data/config/locales/ga-IE.yml +4 -28
- data/config/locales/gl.yml +3 -89
- data/config/locales/he-IL.yml +0 -8
- data/config/locales/hu.yml +5 -100
- data/config/locales/id-ID.yml +0 -58
- data/config/locales/is-IS.yml +1 -36
- data/config/locales/it.yml +202 -96
- data/config/locales/ja.yml +61 -110
- data/config/locales/kaa.yml +0 -12
- data/config/locales/ko.yml +0 -76
- data/config/locales/lb.yml +5 -89
- data/config/locales/lt.yml +4 -99
- data/config/locales/lv.yml +2 -70
- data/config/locales/nl.yml +5 -90
- data/config/locales/no.yml +5 -89
- data/config/locales/pl.yml +5 -103
- data/config/locales/pt-BR.yml +130 -105
- data/config/locales/pt.yml +2 -90
- data/config/locales/ro-RO.yml +13 -97
- data/config/locales/ru.yml +2 -50
- data/config/locales/sk.yml +2 -68
- data/config/locales/sl.yml +1 -18
- data/config/locales/sq-AL.yml +0 -43
- data/config/locales/sr-CS.yml +1 -44
- data/config/locales/sv.yml +59 -120
- data/config/locales/th-TH.yml +0 -5
- data/config/locales/tr-TR.yml +6 -83
- data/config/locales/uk.yml +1 -45
- data/config/locales/val-ES.yml +0 -1
- data/config/locales/zh-CN.yml +0 -68
- data/config/locales/zh-TW.yml +4 -97
- data/config/routes.rb +1 -12
- data/lib/decidim/admin/engine.rb +5 -1
- data/lib/decidim/admin/form_builder.rb +1 -1
- data/lib/decidim/admin/menu.rb +32 -16
- data/lib/decidim/admin/test/filterable_examples.rb +8 -18
- data/lib/decidim/admin/test/invite_participatory_space_admins_shared_examples.rb +4 -4
- data/lib/decidim/admin/test/invite_participatory_space_collaborators_shared_examples.rb +2 -2
- data/lib/decidim/admin/test/invite_participatory_space_moderators_shared_examples.rb +9 -6
- data/lib/decidim/admin/test/invite_participatory_space_users_shared_context.rb +1 -0
- data/lib/decidim/admin/test/manage_attachment_collections_examples.rb +5 -1
- data/lib/decidim/admin/test/manage_attachments_examples.rb +5 -1
- data/lib/decidim/admin/test/manage_component_permissions_examples.rb +31 -4
- data/lib/decidim/admin/test/manage_moderations_examples.rb +12 -5
- data/lib/decidim/admin/test/manage_participatory_space_publications_examples.rb +12 -6
- data/lib/decidim/admin/test/manage_resource_soft_deletion_examples.rb +19 -4
- data/lib/decidim/admin/test/manage_taxonomy_filters_examples.rb +28 -8
- data/lib/decidim/admin/version.rb +1 -1
- metadata +22 -35
- data/app/commands/decidim/admin/process_user_group_verification_csv.rb +0 -44
- data/app/commands/decidim/admin/reject_user_group.rb +0 -42
- data/app/commands/decidim/admin/update_organization_appearance.rb +0 -39
- data/app/commands/decidim/admin/update_user_groups.rb +0 -44
- data/app/commands/decidim/admin/verify_user_group.rb +0 -43
- data/app/controllers/concerns/decidim/admin/user_groups/filterable.rb +0 -45
- data/app/controllers/concerns/decidim/admin/user_groups.rb +0 -24
- data/app/controllers/decidim/admin/metrics_controller.rb +0 -23
- data/app/controllers/decidim/admin/user_groups_controller.rb +0 -76
- data/app/controllers/decidim/admin/user_groups_csv_verifications_controller.rb +0 -36
- data/app/forms/decidim/admin/organization_appearance_form.rb +0 -88
- data/app/forms/decidim/admin/user_group_csv_verification_form.rb +0 -25
- data/app/jobs/decidim/admin/verify_user_group_from_csv_job.rb +0 -30
- data/app/packs/src/decidim/admin/welcome_notification.js +0 -32
- data/app/packs/stylesheets/decidim/admin/_bulk_actions.scss +0 -16
- data/app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb +0 -33
- data/app/queries/decidim/admin/user_groups_evaluation.rb +0 -56
- data/app/views/decidim/admin/metrics/_metrics.html.erb +0 -16
- data/app/views/decidim/admin/metrics/index.html.erb +0 -7
- data/app/views/decidim/admin/organization_appearance/_form.html.erb +0 -100
- data/app/views/decidim/admin/organization_appearance/edit.html.erb +0 -18
- data/app/views/decidim/admin/organization_appearance/form/_header_snippets.html.erb +0 -17
- data/app/views/decidim/admin/user_groups/index.html.erb +0 -68
- data/app/views/decidim/admin/user_groups_csv_verifications/new.html.erb +0 -31
- /data/app/views/decidim/admin/{organization_appearance → organization}/form/_minimap.html.erb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c34cd47009937e22b9702e072abd4ed2b202b23b76d6977a1e82eb777dfa1fde
|
4
|
+
data.tar.gz: 536f248f74f2b6c02c0d486b7d8c0237a9e714816b6a1d6be9fd4efb9e4de5f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 840132645dcff9896ac71fd53b2feb8dc4f3026ec9d1b855951b1285d3e914dd100bdb437269ef0e411195a1b8346761e8232f2ddc1833196a1343a49fe51d84
|
7
|
+
data.tar.gz: 91dd77784880249c7909850780737c7dcbc6f0d619f3e553bbc677fcfac177e1504b790df63edf1a87d052d35fdf520c16400c53ac5799b3d43f648bc9e21f26
|
@@ -5,10 +5,14 @@ module Decidim
|
|
5
5
|
# A command with all the business logic for updating the current
|
6
6
|
# organization.
|
7
7
|
class UpdateOrganization < Decidim::Commands::UpdateResource
|
8
|
-
|
8
|
+
fetch_file_attributes :logo, :favicon, :official_img_footer
|
9
|
+
|
10
|
+
fetch_form_attributes :name, :description, :default_locale, :reference_prefix, :time_zone, :twitter_handler,
|
9
11
|
:facebook_handler, :instagram_handler, :youtube_handler, :github_handler, :badges_enabled,
|
10
|
-
:
|
11
|
-
:
|
12
|
+
:comments_max_length, :enable_machine_translations, :admin_terms_of_service_body,
|
13
|
+
:rich_text_editor_in_public_views, :enable_participatory_space_filters, :official_url,
|
14
|
+
:enable_omnipresent_banner, :omnipresent_banner_url, :omnipresent_banner_title,
|
15
|
+
:omnipresent_banner_short_description
|
12
16
|
|
13
17
|
private
|
14
18
|
|
@@ -16,6 +20,7 @@ module Decidim
|
|
16
20
|
super
|
17
21
|
.merge(welcome_notification_attributes)
|
18
22
|
.merge(machine_translation_attributes)
|
23
|
+
.merge(colors_attributes)
|
19
24
|
end
|
20
25
|
|
21
26
|
def welcome_notification_attributes
|
@@ -33,6 +38,16 @@ module Decidim
|
|
33
38
|
machine_translation_display_priority: form.machine_translation_display_priority
|
34
39
|
}
|
35
40
|
end
|
41
|
+
|
42
|
+
def colors_attributes
|
43
|
+
{
|
44
|
+
colors: {
|
45
|
+
primary: form.primary_color,
|
46
|
+
secondary: form.secondary_color,
|
47
|
+
tertiary: form.tertiary_color
|
48
|
+
}.compact_blank
|
49
|
+
}
|
50
|
+
end
|
36
51
|
end
|
37
52
|
end
|
38
53
|
end
|
@@ -55,7 +55,7 @@ module Decidim
|
|
55
55
|
redirect_to edit_resource_landing_page_path
|
56
56
|
end
|
57
57
|
on(:invalid) do
|
58
|
-
render "decidim/admin/shared/landing_page_content_blocks/edit"
|
58
|
+
render "decidim/admin/shared/landing_page_content_blocks/edit", status: :unprocessable_entity
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
@@ -34,7 +34,7 @@ module Decidim
|
|
34
34
|
|
35
35
|
on(:invalid) do
|
36
36
|
flash.now[:alert] = I18n.t("area_types.create.error", scope: "decidim.admin")
|
37
|
-
render :new
|
37
|
+
render :new, status: :unprocessable_entity
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
@@ -56,7 +56,7 @@ module Decidim
|
|
56
56
|
|
57
57
|
on(:invalid) do
|
58
58
|
flash.now[:alert] = I18n.t("area_types.update.error", scope: "decidim.admin")
|
59
|
-
render :edit
|
59
|
+
render :edit, status: :unprocessable_entity
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
@@ -35,7 +35,7 @@ module Decidim
|
|
35
35
|
|
36
36
|
on(:invalid) do
|
37
37
|
flash.now[:alert] = I18n.t("areas.create.error", scope: "decidim.admin")
|
38
|
-
render :new
|
38
|
+
render :new, status: :unprocessable_entity
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -57,7 +57,7 @@ module Decidim
|
|
57
57
|
|
58
58
|
on(:invalid) do
|
59
59
|
flash.now[:alert] = I18n.t("areas.update.error", scope: "decidim.admin")
|
60
|
-
render :edit
|
60
|
+
render :edit, status: :unprocessable_entity
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
@@ -27,7 +27,7 @@ module Decidim
|
|
27
27
|
|
28
28
|
on(:invalid) do
|
29
29
|
flash[:alert] = I18n.t("officializations.block.error", scope: "decidim.admin")
|
30
|
-
render :new
|
30
|
+
render :new, status: :unprocessable_entity
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
@@ -65,7 +65,7 @@ module Decidim
|
|
65
65
|
|
66
66
|
on(:invalid) do
|
67
67
|
flash.now[:alert] = I18n.t("officializations.bulk_action.block.invalid", scope: "decidim.admin")
|
68
|
-
render :bulk_new
|
68
|
+
render :bulk_new, status: :unprocessable_entity
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|
@@ -47,7 +47,7 @@ module Decidim
|
|
47
47
|
|
48
48
|
on(:invalid) do
|
49
49
|
flash.now[:alert] = I18n.t("components.create.error", scope: "decidim.admin")
|
50
|
-
render action: "new"
|
50
|
+
render action: "new", status: :unprocessable_entity
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
@@ -74,7 +74,7 @@ module Decidim
|
|
74
74
|
|
75
75
|
on(:invalid) do
|
76
76
|
flash[:alert] = I18n.t("components.update.error", scope: "decidim.admin")
|
77
|
-
render action: :edit
|
77
|
+
render action: :edit, status: :unprocessable_entity
|
78
78
|
end
|
79
79
|
end
|
80
80
|
end
|
@@ -39,7 +39,7 @@ module Decidim
|
|
39
39
|
|
40
40
|
on(:invalid) do
|
41
41
|
flash.now[:alert] = I18n.t("attachment_collections.create.error", scope: "decidim.admin")
|
42
|
-
render template: "decidim/admin/attachment_collections/new"
|
42
|
+
render template: "decidim/admin/attachment_collections/new", status: :unprocessable_entity
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
@@ -64,7 +64,7 @@ module Decidim
|
|
64
64
|
|
65
65
|
on(:invalid) do
|
66
66
|
flash.now[:alert] = I18n.t("attachment_collections.update.error", scope: "decidim.admin")
|
67
|
-
render template: "decidim/admin/attachment_collections/edit"
|
67
|
+
render template: "decidim/admin/attachment_collections/edit", status: :unprocessable_entity
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
@@ -39,7 +39,7 @@ module Decidim
|
|
39
39
|
|
40
40
|
on(:invalid) do
|
41
41
|
flash.now[:alert] = I18n.t("attachments.create.error", scope: "decidim.admin")
|
42
|
-
render template: "decidim/admin/attachments/new"
|
42
|
+
render template: "decidim/admin/attachments/new", status: :unprocessable_entity
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
@@ -64,7 +64,7 @@ module Decidim
|
|
64
64
|
|
65
65
|
on(:invalid) do
|
66
66
|
flash.now[:alert] = I18n.t("attachments.update.error", scope: "decidim.admin")
|
67
|
-
render template: "decidim/admin/attachments/edit"
|
67
|
+
render template: "decidim/admin/attachments/edit", status: :unprocessable_entity
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
@@ -51,7 +51,7 @@ module Decidim
|
|
51
51
|
|
52
52
|
on(:invalid) do
|
53
53
|
flash.now[:alert] = I18n.t("participatory_space_private_users.update.error", scope: "decidim.admin")
|
54
|
-
render template: "decidim/admin/participatory_space_private_users/edit"
|
54
|
+
render template: "decidim/admin/participatory_space_private_users/edit", status: :unprocessable_entity
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
@@ -68,7 +68,7 @@ module Decidim
|
|
68
68
|
|
69
69
|
on(:invalid) do
|
70
70
|
flash.now[:alert] = I18n.t("participatory_space_private_users.create.error", scope: "decidim.admin")
|
71
|
-
render template: "decidim/admin/participatory_space_private_users/new"
|
71
|
+
render template: "decidim/admin/participatory_space_private_users/new", status: :unprocessable_entity
|
72
72
|
end
|
73
73
|
end
|
74
74
|
end
|
@@ -84,7 +84,7 @@ module Decidim
|
|
84
84
|
|
85
85
|
on(:invalid) do
|
86
86
|
flash.now[:alert] = I18n.t("participatory_space_private_users.destroy.error", scope: "decidim.admin")
|
87
|
-
render template: "decidim/admin/participatory_space_private_users/index"
|
87
|
+
render template: "decidim/admin/participatory_space_private_users/index", status: :unprocessable_entity
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|
@@ -34,7 +34,7 @@ module Decidim
|
|
34
34
|
|
35
35
|
on(:invalid) do
|
36
36
|
flash[:alert] = I18n.t("participatory_space_private_users_csv_imports.create.invalid", scope: "decidim.admin")
|
37
|
-
render template: "decidim/admin/participatory_space_private_users_csv_imports/new"
|
37
|
+
render template: "decidim/admin/participatory_space_private_users_csv_imports/new", status: :unprocessable_entity
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
@@ -7,7 +7,6 @@ module Decidim
|
|
7
7
|
class DashboardController < Decidim::Admin::ApplicationController
|
8
8
|
helper_method :latest_action_logs
|
9
9
|
helper_method :users_counter
|
10
|
-
helper_method :metrics_presenter
|
11
10
|
helper_method :count_pending_moderations
|
12
11
|
|
13
12
|
def show
|
@@ -29,14 +28,6 @@ module Decidim
|
|
29
28
|
.first(5)
|
30
29
|
end
|
31
30
|
|
32
|
-
def metrics_presenter
|
33
|
-
@metrics_presenter ||= Decidim::Admin::DashboardMetricChartsPresenter.new(
|
34
|
-
summary: true,
|
35
|
-
organization: current_organization,
|
36
|
-
view_context:
|
37
|
-
)
|
38
|
-
end
|
39
|
-
|
40
31
|
def users_counter
|
41
32
|
last_day = Time.zone.yesterday
|
42
33
|
last_week = Time.zone.today.prev_week
|
@@ -56,7 +56,7 @@ module Decidim
|
|
56
56
|
on(:invalid) do |newsletter|
|
57
57
|
@newsletter = newsletter
|
58
58
|
flash.now[:error] = I18n.t("newsletters.create.error", scope: "decidim.admin")
|
59
|
-
render action: :new
|
59
|
+
render action: :new, status: :unprocessable_entity
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
@@ -80,7 +80,7 @@ module Decidim
|
|
80
80
|
on(:invalid) do |newsletter|
|
81
81
|
@newsletter = newsletter
|
82
82
|
flash.now[:error] = I18n.t("newsletters.update.error", scope: "decidim.admin")
|
83
|
-
render action: :edit
|
83
|
+
render action: :edit, status: :unprocessable_entity
|
84
84
|
end
|
85
85
|
end
|
86
86
|
end
|
@@ -128,12 +128,12 @@ module Decidim
|
|
128
128
|
|
129
129
|
on(:invalid) do
|
130
130
|
flash.now[:error] = I18n.t("newsletters.deliver.error", scope: "decidim.admin")
|
131
|
-
render action: :select_recipients_to_deliver
|
131
|
+
render action: :select_recipients_to_deliver, status: :unprocessable_entity
|
132
132
|
end
|
133
133
|
|
134
134
|
on(:no_recipients) do
|
135
135
|
flash.now[:error] = I18n.t("newsletters.send.no_recipients", scope: "decidim.admin")
|
136
|
-
render action: :select_recipients_to_deliver
|
136
|
+
render action: :select_recipients_to_deliver, status: :unprocessable_entity
|
137
137
|
end
|
138
138
|
end
|
139
139
|
end
|
@@ -8,8 +8,6 @@ module Decidim
|
|
8
8
|
|
9
9
|
add_breadcrumb_item_from_menu :admin_settings_menu
|
10
10
|
|
11
|
-
helper Decidim::Admin::UploaderImageDimensionsHelper
|
12
|
-
|
13
11
|
def edit
|
14
12
|
enforce_permission_to :update, :organization, organization: current_organization
|
15
13
|
@form = form(OrganizationAppearanceForm).from_model(current_organization)
|
@@ -27,7 +25,7 @@ module Decidim
|
|
27
25
|
|
28
26
|
on(:invalid) do
|
29
27
|
flash.now[:alert] = I18n.t("organization.update.error", scope: "decidim.admin")
|
30
|
-
render :edit
|
28
|
+
render :edit, status: :unprocessable_entity
|
31
29
|
end
|
32
30
|
end
|
33
31
|
end
|
@@ -7,6 +7,8 @@ module Decidim
|
|
7
7
|
class OrganizationController < Decidim::Admin::ApplicationController
|
8
8
|
layout "decidim/admin/settings"
|
9
9
|
|
10
|
+
helper Decidim::Admin::UploaderImageDimensionsHelper
|
11
|
+
|
10
12
|
add_breadcrumb_item_from_menu :admin_settings_menu
|
11
13
|
|
12
14
|
def edit
|
@@ -27,7 +29,7 @@ module Decidim
|
|
27
29
|
|
28
30
|
on(:invalid) do
|
29
31
|
flash.now[:alert] = I18n.t("organization.update.error", scope: "decidim.admin")
|
30
|
-
render :edit
|
32
|
+
render :edit, status: :unprocessable_entity
|
31
33
|
end
|
32
34
|
end
|
33
35
|
end
|
@@ -36,10 +38,6 @@ module Decidim
|
|
36
38
|
search(current_organization.users.available)
|
37
39
|
end
|
38
40
|
|
39
|
-
def user_entities
|
40
|
-
search(current_organization.user_entities.available)
|
41
|
-
end
|
42
|
-
|
43
41
|
private
|
44
42
|
|
45
43
|
def search(relation)
|
@@ -38,7 +38,7 @@ module Decidim
|
|
38
38
|
|
39
39
|
on(:invalid) do
|
40
40
|
flash[:alert] = I18n.t("create.error", scope: i18n_scope)
|
41
|
-
render :new
|
41
|
+
render :new, status: :unprocessable_entity
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
@@ -56,7 +56,7 @@ module Decidim
|
|
56
56
|
|
57
57
|
on(:invalid) do
|
58
58
|
flash.now[:alert] = I18n.t("update.error", scope: i18n_scope)
|
59
|
-
render :edit
|
59
|
+
render :edit, status: :unprocessable_entity
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
@@ -34,7 +34,7 @@ module Decidim
|
|
34
34
|
|
35
35
|
on(:invalid) do
|
36
36
|
flash.now[:alert] = I18n.t("scope_types.create.error", scope: "decidim.admin")
|
37
|
-
render :new
|
37
|
+
render :new, status: :unprocessable_entity
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
@@ -56,7 +56,7 @@ module Decidim
|
|
56
56
|
|
57
57
|
on(:invalid) do
|
58
58
|
flash.now[:alert] = I18n.t("scope_types.update.error", scope: "decidim.admin")
|
59
|
-
render :edit
|
59
|
+
render :edit, status: :unprocessable_entity
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
@@ -36,7 +36,7 @@ module Decidim
|
|
36
36
|
|
37
37
|
on(:invalid) do
|
38
38
|
flash.now[:alert] = I18n.t("scopes.create.error", scope: "decidim.admin")
|
39
|
-
render :new
|
39
|
+
render :new, status: :unprocessable_entity
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
@@ -58,7 +58,7 @@ module Decidim
|
|
58
58
|
|
59
59
|
on(:invalid) do
|
60
60
|
flash.now[:alert] = I18n.t("scopes.update.error", scope: "decidim.admin")
|
61
|
-
render :edit
|
61
|
+
render :edit, status: :unprocessable_entity
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
@@ -10,17 +10,17 @@ module Decidim
|
|
10
10
|
helper_method :current_token, :resource, :resource_title, :share_tokens_path
|
11
11
|
|
12
12
|
def index
|
13
|
-
enforce_permission_to :read, :
|
13
|
+
enforce_permission_to :read, :share_token
|
14
14
|
@share_tokens = filtered_collection
|
15
15
|
end
|
16
16
|
|
17
17
|
def new
|
18
|
-
enforce_permission_to :create, :
|
18
|
+
enforce_permission_to :create, :share_token
|
19
19
|
@form = form(ShareTokenForm).instance
|
20
20
|
end
|
21
21
|
|
22
22
|
def create
|
23
|
-
enforce_permission_to :create, :
|
23
|
+
enforce_permission_to :create, :share_token
|
24
24
|
@form = form(ShareTokenForm).from_params(params, resource:)
|
25
25
|
|
26
26
|
CreateShareToken.call(@form) do
|
@@ -31,18 +31,18 @@ module Decidim
|
|
31
31
|
|
32
32
|
on(:invalid) do
|
33
33
|
flash.now[:alert] = I18n.t("share_tokens.create.invalid", scope: "decidim.admin")
|
34
|
-
render action: "new"
|
34
|
+
render action: "new", status: :unprocessable_entity
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
39
|
def edit
|
40
|
-
enforce_permission_to(:update, :
|
40
|
+
enforce_permission_to(:update, :share_token, share_token: current_token)
|
41
41
|
@form = form(ShareTokenForm).from_model(current_token)
|
42
42
|
end
|
43
43
|
|
44
44
|
def update
|
45
|
-
enforce_permission_to(:update, :
|
45
|
+
enforce_permission_to(:update, :share_token, share_token: current_token)
|
46
46
|
@form = form(ShareTokenForm).from_params(params, resource:)
|
47
47
|
|
48
48
|
UpdateShareToken.call(@form, current_token) do
|
@@ -53,13 +53,13 @@ module Decidim
|
|
53
53
|
|
54
54
|
on(:invalid) do
|
55
55
|
flash.now[:alert] = I18n.t("share_tokens.update.error", scope: "decidim.admin")
|
56
|
-
render :edit
|
56
|
+
render :edit, status: :unprocessable_entity
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
61
|
def destroy
|
62
|
-
enforce_permission_to(:destroy, :
|
62
|
+
enforce_permission_to(:destroy, :share_token, share_token: current_token)
|
63
63
|
|
64
64
|
DestroyShareToken.call(current_token, current_user) do
|
65
65
|
on(:ok) do
|
@@ -30,7 +30,7 @@ module Decidim
|
|
30
30
|
|
31
31
|
on(:invalid) do
|
32
32
|
flash.now[:alert] = I18n.t("static_page_topics.create.error", scope: "decidim.admin")
|
33
|
-
render :new
|
33
|
+
render :new, status: :unprocessable_entity
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -52,7 +52,7 @@ module Decidim
|
|
52
52
|
|
53
53
|
on(:invalid) do
|
54
54
|
flash.now[:alert] = I18n.t("static_page_topics.update.error", scope: "decidim.admin")
|
55
|
-
render :edit
|
55
|
+
render :edit, status: :unprocessable_entity
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
@@ -62,7 +62,7 @@ module Decidim
|
|
62
62
|
|
63
63
|
on(:invalid) do
|
64
64
|
flash.now[:alert] = I18n.t("static_pages.create.error", scope: "decidim.admin")
|
65
|
-
render :new
|
65
|
+
render :new, status: :unprocessable_entity
|
66
66
|
end
|
67
67
|
end
|
68
68
|
end
|
@@ -85,7 +85,7 @@ module Decidim
|
|
85
85
|
|
86
86
|
on(:invalid) do
|
87
87
|
flash.now[:alert] = I18n.t("static_pages.update.error", scope: "decidim.admin")
|
88
|
-
render :edit
|
88
|
+
render :edit, status: :unprocessable_entity
|
89
89
|
end
|
90
90
|
end
|
91
91
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Admin
|
5
|
+
class StatisticsController < Decidim::Admin::ApplicationController
|
6
|
+
layout "decidim/admin/insights"
|
7
|
+
|
8
|
+
helper_method :statistics_presenter
|
9
|
+
|
10
|
+
before_action :set_statistic_breadcrumb_item
|
11
|
+
|
12
|
+
def index
|
13
|
+
enforce_permission_to :read, :statistics
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def statistics_presenter
|
19
|
+
@statistics_presenter ||= Decidim::Admin::DashboardStatisticChartsPresenter.new(
|
20
|
+
organization: current_organization,
|
21
|
+
view_context:
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
def set_statistic_breadcrumb_item
|
26
|
+
controller_breadcrumb_items << {
|
27
|
+
label: I18n.t("menu.statistics", scope: "decidim.admin"),
|
28
|
+
url: decidim_admin.statistics_path,
|
29
|
+
active: true
|
30
|
+
}
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -39,7 +39,7 @@ module Decidim
|
|
39
39
|
|
40
40
|
on(:invalid) do
|
41
41
|
flash.now[:alert] = I18n.t("create.invalid", scope: "decidim.admin.taxonomies")
|
42
|
-
render action: "new"
|
42
|
+
render action: "new", status: :unprocessable_entity
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
@@ -66,7 +66,7 @@ module Decidim
|
|
66
66
|
|
67
67
|
on(:invalid) do
|
68
68
|
flash.now[:alert] = I18n.t("update.invalid", scope: "decidim.admin.taxonomies")
|
69
|
-
render action: "edit"
|
69
|
+
render action: "edit", status: :unprocessable_entity
|
70
70
|
end
|
71
71
|
end
|
72
72
|
end
|
@@ -41,7 +41,7 @@ module Decidim
|
|
41
41
|
|
42
42
|
on(:invalid) do
|
43
43
|
flash.now[:alert] = I18n.t("create.error", scope: "decidim.admin.taxonomy_filters")
|
44
|
-
render :new
|
44
|
+
render :new, status: :unprocessable_entity
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
@@ -63,7 +63,7 @@ module Decidim
|
|
63
63
|
end
|
64
64
|
on(:invalid) do
|
65
65
|
flash.now[:alert] = I18n.t("update.error", scope: "decidim.admin.taxonomy_filters")
|
66
|
-
render :edit
|
66
|
+
render :edit, status: :unprocessable_entity
|
67
67
|
end
|
68
68
|
end
|
69
69
|
end
|