decidim-admin 0.29.1 → 0.30.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/admin/multi_select_picker/show.erb +10 -0
- data/app/cells/decidim/admin/multi_select_picker_cell.rb +38 -0
- data/app/commands/decidim/admin/block_user.rb +1 -0
- data/app/commands/decidim/admin/bulk_action.rb +92 -0
- data/app/commands/decidim/admin/bulk_block_users.rb +75 -0
- data/app/commands/decidim/admin/bulk_unblock_users.rb +66 -0
- data/app/commands/decidim/admin/bulk_unreport_users.rb +69 -0
- data/app/commands/decidim/admin/content_blocks/update_content_block.rb +1 -1
- data/app/commands/decidim/admin/create_participatory_space_private_user.rb +3 -1
- data/app/commands/decidim/admin/create_share_token.rb +39 -0
- data/app/commands/decidim/admin/create_taxonomy.rb +23 -0
- data/app/commands/decidim/admin/create_taxonomy_filter.rb +24 -0
- data/app/commands/decidim/admin/destroy_share_token.rb +22 -0
- data/app/commands/decidim/admin/destroy_taxonomy.rb +18 -0
- data/app/commands/decidim/admin/destroy_taxonomy_filter.rb +20 -0
- data/app/commands/decidim/admin/hide_menu_component.rb +37 -0
- data/app/commands/decidim/admin/hide_resource.rb +4 -2
- data/app/commands/decidim/admin/publish_all_participatory_space_private_users.rb +50 -0
- data/app/commands/decidim/admin/publish_component.rb +3 -0
- data/app/commands/decidim/admin/reorder_components.rb +47 -0
- data/app/commands/decidim/admin/reorder_taxonomies.rb +76 -0
- data/app/commands/decidim/admin/unhide_resource.rb +11 -3
- data/app/commands/decidim/admin/unpublish_all_participatory_space_private_users.rb +50 -0
- data/app/commands/decidim/admin/unreport_resource.rb +11 -3
- data/app/commands/decidim/admin/update_component_permissions.rb +53 -13
- data/app/commands/decidim/admin/update_participatory_space_private_user.rb +11 -0
- data/app/commands/decidim/admin/update_share_token.rb +24 -0
- data/app/commands/decidim/admin/update_taxonomy.rb +20 -0
- data/app/commands/decidim/admin/update_taxonomy_filter.rb +28 -0
- data/app/controllers/concerns/decidim/admin/component_taxonomies_helper.rb +19 -0
- data/app/controllers/concerns/decidim/admin/filterable.rb +15 -18
- data/app/controllers/concerns/decidim/admin/has_trashable_resources.rb +170 -0
- data/app/controllers/concerns/decidim/admin/needs_admin_tos_accepted.rb +2 -29
- data/app/controllers/concerns/decidim/admin/participatory_space_admin_context.rb +12 -2
- data/app/controllers/concerns/decidim/admin/taxonomies/filterable.rb +27 -0
- data/app/controllers/decidim/admin/application_controller.rb +1 -2
- data/app/controllers/decidim/admin/areas_controller.rb +1 -0
- data/app/controllers/decidim/admin/block_user_controller.rb +43 -1
- data/app/controllers/decidim/admin/component_permissions_controller.rb +2 -4
- data/app/controllers/decidim/admin/components_controller.rb +50 -9
- data/app/controllers/decidim/admin/concerns/has_private_users.rb +59 -2
- data/app/controllers/decidim/admin/conflicts_controller.rb +1 -1
- data/app/controllers/decidim/admin/global_moderations_controller.rb +4 -0
- data/app/controllers/decidim/admin/impersonations_controller.rb +1 -0
- data/app/controllers/decidim/admin/moderated_users_controller.rb +26 -0
- data/app/controllers/decidim/admin/moderations_controller.rb +18 -0
- data/app/controllers/decidim/admin/newsletters_controller.rb +50 -6
- data/app/controllers/decidim/admin/resource_permissions_controller.rb +1 -1
- data/app/controllers/decidim/admin/scopes_controller.rb +1 -0
- data/app/controllers/decidim/admin/share_tokens_controller.rb +109 -7
- data/app/controllers/decidim/admin/taxonomies_controller.rb +129 -0
- data/app/controllers/decidim/admin/taxonomy_filters_controller.rb +112 -0
- data/app/controllers/decidim/admin/taxonomy_filters_selector_controller.rb +81 -0
- data/app/controllers/decidim/admin/taxonomy_items_controller.rb +91 -0
- data/app/forms/concerns/decidim/has_taxonomy_form_attributes.rb +57 -0
- data/app/forms/decidim/admin/block_users_form.rb +21 -0
- data/app/forms/decidim/admin/help_section_form.rb +1 -1
- data/app/forms/decidim/admin/impersonate_user_form.rb +5 -0
- data/app/forms/decidim/admin/import_example_form.rb +1 -1
- data/app/forms/decidim/admin/newsletter_form.rb +1 -1
- data/app/forms/decidim/admin/organization_appearance_form.rb +2 -2
- data/app/forms/decidim/admin/organization_form.rb +2 -2
- data/app/forms/decidim/admin/participatory_space_private_user_form.rb +5 -0
- data/app/forms/decidim/admin/selective_newsletter_form.rb +46 -11
- data/app/forms/decidim/admin/share_token_form.rb +55 -0
- data/app/forms/decidim/admin/static_page_form.rb +1 -1
- data/app/forms/decidim/admin/taxonomy_filter_form.rb +85 -0
- data/app/forms/decidim/admin/taxonomy_form.rb +20 -0
- data/app/forms/decidim/admin/taxonomy_item_form.rb +54 -0
- data/app/forms/decidim/admin/transfer_user_form.rb +15 -0
- data/app/helpers/decidim/admin/application_helper.rb +0 -1
- data/app/helpers/decidim/admin/bulk_actions_helper.rb +0 -31
- data/app/helpers/decidim/admin/moderations/reports_helper.rb +1 -1
- data/app/helpers/decidim/admin/moderations_helper.rb +1 -1
- data/app/helpers/decidim/admin/newsletters_helper.rb +57 -27
- data/app/helpers/decidim/admin/scopes_helper.rb +0 -6
- data/app/helpers/decidim/admin/search_form_helper.rb +1 -1
- data/app/helpers/decidim/admin/settings_helper.rb +85 -11
- data/app/jobs/decidim/admin/newsletter_job.rb +3 -1
- data/app/packs/entrypoints/decidim_admin.js +4 -0
- data/app/packs/src/decidim/admin/application.js +2 -0
- data/app/packs/src/decidim/admin/draggable-table.js +33 -0
- data/app/packs/src/decidim/admin/form.js +0 -1
- data/app/packs/src/decidim/admin/global_moderations.js +186 -0
- data/app/packs/src/decidim/admin/managed_moderated_users.js +186 -0
- data/app/packs/src/decidim/admin/newsletters.js +164 -73
- data/app/packs/src/decidim/admin/proposal_infinite_edit.js +3 -6
- data/app/packs/src/decidim/admin/sortable.js +28 -16
- data/app/packs/src/decidim/admin/taxonomy_filters.js +93 -0
- data/app/packs/stylesheets/decidim/admin/_component-show.scss +66 -5
- data/app/packs/stylesheets/decidim/admin/_legacy_foundation.scss +13 -0
- data/app/packs/stylesheets/decidim/admin/_moderations.scss +8 -0
- data/app/packs/stylesheets/decidim/admin/_select_picker.scss +20 -0
- data/app/packs/stylesheets/decidim/admin/_table-list.scss +22 -0
- data/app/packs/stylesheets/decidim/admin/_taxonomies.scss +74 -0
- data/app/packs/stylesheets/decidim/admin/application.scss +3 -0
- data/app/permissions/decidim/admin/permissions.rb +32 -1
- data/app/queries/decidim/admin/newsletter_recipients.rb +59 -19
- data/app/views/decidim/admin/areas/index.html.erb +3 -0
- data/app/views/decidim/admin/block_user/bulk_new.html.erb +45 -0
- data/app/views/decidim/admin/components/_actions.html.erb +50 -33
- data/app/views/decidim/admin/components/{_component.html.erb → _component_row.html.erb} +10 -5
- data/app/views/decidim/admin/components/_components_table.html.erb +18 -0
- data/app/views/decidim/admin/components/_form.html.erb +0 -12
- data/app/views/decidim/admin/components/_taxonomy_filters_drawer.html.erb +2 -0
- data/app/views/decidim/admin/components/_visibility_label.html.erb +9 -0
- data/app/views/decidim/admin/components/index.html.erb +12 -14
- data/app/views/decidim/admin/components/manage_trash.html.erb +11 -0
- data/app/views/decidim/admin/conflicts/edit.html.erb +21 -11
- data/app/views/decidim/admin/moderated_users/_bulk-actions.html.erb +6 -0
- data/app/views/decidim/admin/moderated_users/bulk_actions/_block.html.erb +20 -0
- data/app/views/decidim/admin/moderated_users/bulk_actions/_dropdown.html.erb +40 -0
- data/app/views/decidim/admin/moderated_users/bulk_actions/_unblock.html.erb +20 -0
- data/app/views/decidim/admin/moderated_users/bulk_actions/_unreport.html.erb +20 -0
- data/app/views/decidim/admin/moderated_users/index.html.erb +15 -7
- data/app/views/decidim/admin/moderations/_bulk-actions.html.erb +7 -0
- data/app/views/decidim/admin/moderations/_moderation-tr.html.erb +50 -0
- data/app/views/decidim/admin/moderations/_moderations-thead.html.erb +18 -0
- data/app/views/decidim/admin/moderations/bulk_actions/_dropdown.html.erb +43 -0
- data/app/views/decidim/admin/moderations/bulk_actions/_hide.html.erb +20 -0
- data/app/views/decidim/admin/moderations/bulk_actions/_unhide.html.erb +20 -0
- data/app/views/decidim/admin/moderations/bulk_actions/_unreport.html.erb +20 -0
- data/app/views/decidim/admin/moderations/index.html.erb +13 -81
- data/app/views/decidim/admin/newsletter_templates/index.html.erb +0 -1
- data/app/views/decidim/admin/newsletters/confirm_recipients.html.erb +64 -0
- data/app/views/decidim/admin/newsletters/select_recipients_to_deliver.html.erb +44 -20
- data/app/views/decidim/admin/participatory_space_private_users/_form.html.erb +6 -0
- data/app/views/decidim/admin/participatory_space_private_users/edit.html.erb +19 -0
- data/app/views/decidim/admin/participatory_space_private_users/index.html.erb +15 -1
- data/app/views/decidim/admin/resource_permissions/_options_form.html.erb +5 -0
- data/app/views/decidim/admin/resource_permissions/edit.html.erb +2 -2
- data/app/views/decidim/admin/scope_types/index.html.erb +3 -0
- data/app/views/decidim/admin/scopes/index.html.erb +3 -0
- data/app/views/decidim/admin/share_tokens/_form.html.erb +52 -0
- data/app/views/decidim/admin/share_tokens/edit.html.erb +33 -0
- data/app/views/decidim/admin/share_tokens/index.html.erb +47 -0
- data/app/views/decidim/admin/share_tokens/new.html.erb +69 -0
- data/app/views/decidim/admin/shared/landing_page_content_blocks/edit.html.erb +1 -1
- data/app/views/decidim/admin/taxonomies/_filters.html.erb +19 -0
- data/app/views/decidim/admin/taxonomies/_form.html.erb +5 -0
- data/app/views/decidim/admin/taxonomies/_row.html.erb +40 -0
- data/app/views/decidim/admin/taxonomies/_row_children.html.erb +8 -0
- data/app/views/decidim/admin/taxonomies/_table.html.erb +86 -0
- data/app/views/decidim/admin/taxonomies/_taxonomy_actions.html.erb +15 -0
- data/app/views/decidim/admin/taxonomies/edit.html.erb +87 -0
- data/app/views/decidim/admin/taxonomies/index.html.erb +28 -0
- data/app/views/decidim/admin/taxonomies/new.html.erb +16 -0
- data/app/views/decidim/admin/taxonomy_filters/_check_boxes.html.erb +10 -0
- data/app/views/decidim/admin/taxonomy_filters/_form.html.erb +96 -0
- data/app/views/decidim/admin/taxonomy_filters/_table.html.erb +33 -0
- data/app/views/decidim/admin/taxonomy_filters/edit.html.erb +22 -0
- data/app/views/decidim/admin/taxonomy_filters/index.html.erb +26 -0
- data/app/views/decidim/admin/taxonomy_filters/new.html.erb +32 -0
- data/app/views/decidim/admin/taxonomy_filters_selector/_check_boxes.html.erb +7 -0
- data/app/views/decidim/admin/taxonomy_filters_selector/_component_table.html.erb +25 -0
- data/app/views/decidim/admin/taxonomy_filters_selector/_taxonomies_select.html.erb +16 -0
- data/app/views/decidim/admin/taxonomy_filters_selector/index.html.erb +1 -0
- data/app/views/decidim/admin/taxonomy_filters_selector/new.html.erb +27 -0
- data/app/views/decidim/admin/taxonomy_filters_selector/show.html.erb +18 -0
- data/app/views/decidim/admin/taxonomy_items/_form.html.erb +8 -0
- data/app/views/decidim/admin/taxonomy_items/edit.html.erb +12 -0
- data/app/views/decidim/admin/taxonomy_items/new.html.erb +12 -0
- data/app/views/layouts/decidim/admin/taxonomy_filters.html.erb +17 -0
- data/app/views/layouts/decidim/admin/taxonomy_filters_selector.html.erb +10 -0
- data/config/locales/ar.yml +91 -36
- data/config/locales/bg.yml +48 -51
- data/config/locales/bn-BD.yml +1 -0
- data/config/locales/bs-BA.yml +499 -0
- data/config/locales/ca.yml +300 -50
- data/config/locales/cs.yml +298 -46
- data/config/locales/de.yml +300 -50
- data/config/locales/el.yml +1 -50
- data/config/locales/en.yml +300 -50
- data/config/locales/es-MX.yml +298 -48
- data/config/locales/es-PY.yml +298 -48
- data/config/locales/es.yml +298 -48
- data/config/locales/eu.yml +433 -171
- data/config/locales/fi-plain.yml +298 -48
- data/config/locales/fi.yml +315 -65
- data/config/locales/fr-CA.yml +183 -47
- data/config/locales/fr.yml +183 -47
- data/config/locales/ga-IE.yml +0 -23
- data/config/locales/gl.yml +1 -46
- data/config/locales/hu.yml +1 -51
- data/config/locales/id-ID.yml +0 -20
- data/config/locales/is-IS.yml +0 -18
- data/config/locales/it.yml +1 -46
- data/config/locales/ja.yml +303 -55
- data/config/locales/kaa.yml +0 -10
- data/config/locales/ko.yml +0 -50
- data/config/locales/lb.yml +1 -46
- data/config/locales/lt.yml +1 -50
- data/config/locales/lv.yml +1 -27
- data/config/locales/nl.yml +1 -46
- data/config/locales/no.yml +1 -46
- data/config/locales/pl.yml +3 -51
- data/config/locales/pt-BR.yml +38 -50
- data/config/locales/pt.yml +30 -46
- data/config/locales/ro-RO.yml +35 -50
- data/config/locales/ru.yml +1 -22
- data/config/locales/sk.yml +1 -27
- data/config/locales/sl.yml +0 -7
- data/config/locales/sq-AL.yml +0 -25
- data/config/locales/sr-CS.yml +1 -27
- data/config/locales/sv.yml +297 -47
- data/config/locales/tr-TR.yml +1 -44
- data/config/locales/uk.yml +0 -20
- data/config/locales/zh-CN.yml +0 -44
- data/config/locales/zh-TW.yml +1 -50
- data/config/routes.rb +14 -13
- data/decidim-admin.gemspec +2 -2
- data/lib/decidim/admin/engine.rb +3 -1
- data/lib/decidim/admin/import/creator.rb +2 -6
- data/lib/decidim/admin/import/readers/json.rb +1 -1
- data/lib/decidim/admin/menu.rb +9 -1
- data/lib/decidim/admin/search_form_builder.rb +1 -1
- data/lib/decidim/admin/test/destroy_admin_examples.rb +2 -2
- data/lib/decidim/admin/test/filterable_examples.rb +100 -9
- data/lib/decidim/admin/test/forms/attachment_collection_form_examples.rb +1 -1
- data/lib/decidim/admin/test/forms/attachment_form_examples.rb +1 -1
- data/lib/decidim/admin/test/invite_participatory_space_admins_shared_examples.rb +2 -4
- data/lib/decidim/admin/test/manage_component_permissions_examples.rb +5 -5
- data/lib/decidim/admin/test/manage_hide_content_examples.rb +0 -1
- data/lib/decidim/admin/test/manage_moderations_examples.rb +3 -3
- data/lib/decidim/admin/test/manage_resource_soft_deletion_examples.rb +113 -0
- data/lib/decidim/admin/test/manage_taxonomy_filters_examples.rb +127 -0
- data/lib/decidim/admin/test/taxonomy_filters_examples.rb +32 -0
- data/lib/decidim/admin/test.rb +3 -1
- data/lib/decidim/admin/version.rb +1 -1
- metadata +106 -30
- data/app/commands/decidim/admin/create_category.rb +0 -15
- data/app/commands/decidim/admin/destroy_category.rb +0 -15
- data/app/commands/decidim/admin/destroy_component.rb +0 -19
- data/app/commands/decidim/admin/update_category.rb +0 -11
- data/app/controllers/decidim/admin/categories_controller.rb +0 -98
- data/app/forms/decidim/admin/category_form.rb +0 -32
- data/app/helpers/decidim/admin/resource_scope_helper.rb +0 -52
- data/app/packs/src/decidim/admin/scope_picker_enabler.component.js +0 -12
- data/app/views/decidim/admin/categories/_form.html.erb +0 -18
- data/app/views/decidim/admin/categories/edit.html.erb +0 -19
- data/app/views/decidim/admin/categories/index.html.erb +0 -65
- data/app/views/decidim/admin/categories/new.html.erb +0 -19
- data/app/views/decidim/admin/share_tokens/_share_tokens.html.erb +0 -45
- data/lib/decidim/admin/test/commands/create_category_examples.rb +0 -74
- data/lib/decidim/admin/test/commands/destroy_category_examples.rb +0 -83
- data/lib/decidim/admin/test/commands/update_category_examples.rb +0 -76
- data/lib/decidim/admin/test/forms/category_form_examples.rb +0 -70
- data/lib/decidim/admin/test/manage_categories_examples.rb +0 -128
@@ -388,6 +388,19 @@ li.opens-left > .is-dropdown-submenu {
|
|
388
388
|
color: var(--secondary);
|
389
389
|
}
|
390
390
|
|
391
|
+
.dropdown-pane.dropdown-pane--buttons {
|
392
|
+
li {
|
393
|
+
padding: 0;
|
394
|
+
}
|
395
|
+
|
396
|
+
li button {
|
397
|
+
width: 100%;
|
398
|
+
height: 100%;
|
399
|
+
text-align: left;
|
400
|
+
padding: 1rem;
|
401
|
+
}
|
402
|
+
}
|
403
|
+
|
391
404
|
.dropdown-pane li:hover {
|
392
405
|
color: #fff;
|
393
406
|
background-color: var(--secondary);
|
@@ -0,0 +1,20 @@
|
|
1
|
+
@import "tom-select/dist/scss/tom-select";
|
2
|
+
|
3
|
+
/* overwrite tom-select defaults */
|
4
|
+
.ts {
|
5
|
+
&-control {
|
6
|
+
@apply border-gray text-md min-h-[40px];
|
7
|
+
|
8
|
+
input {
|
9
|
+
@apply font-normal text-black text-md;
|
10
|
+
}
|
11
|
+
}
|
12
|
+
|
13
|
+
&-dropdown {
|
14
|
+
@apply text-md text-gray-2 font-normal;
|
15
|
+
|
16
|
+
.active {
|
17
|
+
@apply text-white bg-secondary;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
@@ -1,6 +1,10 @@
|
|
1
1
|
.table-scroll {
|
2
2
|
@apply overflow-x-auto;
|
3
3
|
|
4
|
+
&.half-vh {
|
5
|
+
@apply max-h-[50vh];
|
6
|
+
}
|
7
|
+
|
4
8
|
table {
|
5
9
|
border-collapse: unset;
|
6
10
|
|
@@ -108,6 +112,20 @@
|
|
108
112
|
.icon-active {
|
109
113
|
@apply bg-[#5dc560] inline-block w-3 h-3 align-middle mr-2 rounded-[50%];
|
110
114
|
}
|
115
|
+
|
116
|
+
.draggable-table {
|
117
|
+
&.dragging {
|
118
|
+
@apply border-dashed border-y-2 border-gray;
|
119
|
+
}
|
120
|
+
|
121
|
+
.dragging-handle {
|
122
|
+
@apply cursor-ns-resize align-top p-3;
|
123
|
+
|
124
|
+
.dragger {
|
125
|
+
@apply text-2xl;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
}
|
111
129
|
}
|
112
130
|
|
113
131
|
.table-list__actions {
|
@@ -153,3 +171,7 @@
|
|
153
171
|
@apply inline-block;
|
154
172
|
}
|
155
173
|
}
|
174
|
+
|
175
|
+
.table-list__title-ellipsis {
|
176
|
+
@apply whitespace-nowrap overflow-hidden text-ellipsis max-w-[200px] sm:max-w-sm md:max-w-md lg:max-w-lg xl:max-w-2xl inline-block align-middle;
|
177
|
+
}
|
@@ -0,0 +1,74 @@
|
|
1
|
+
.spinner-container {
|
2
|
+
&::before {
|
3
|
+
@apply absolute -mt-2 -ml-4 top-1/2 left-1/2;
|
4
|
+
}
|
5
|
+
}
|
6
|
+
|
7
|
+
.draggable-taxonomy {
|
8
|
+
&.change-page {
|
9
|
+
@apply bg-gray-3 italic;
|
10
|
+
}
|
11
|
+
|
12
|
+
.dragger {
|
13
|
+
@apply text-2xl;
|
14
|
+
}
|
15
|
+
|
16
|
+
td {
|
17
|
+
@apply align-top cursor-ns-resize;
|
18
|
+
|
19
|
+
&.js-drag-handle .dragger {
|
20
|
+
@apply mt-1;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
ul.taxonomy {
|
26
|
+
@apply flex;
|
27
|
+
|
28
|
+
li {
|
29
|
+
@apply flex-none text-center w-20 mt-2 mb-2;
|
30
|
+
|
31
|
+
&:first-child {
|
32
|
+
@apply flex-initial text-left flex-grow;
|
33
|
+
}
|
34
|
+
|
35
|
+
&:nth-child(2),
|
36
|
+
&:last-child {
|
37
|
+
@apply w-36;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
.taxonomy-list__actions {
|
42
|
+
span {
|
43
|
+
@apply ml-1;
|
44
|
+
}
|
45
|
+
|
46
|
+
svg {
|
47
|
+
@apply inline-block fill-secondary w-5 h-5;
|
48
|
+
}
|
49
|
+
|
50
|
+
.action-space {
|
51
|
+
@apply w-5 h-5;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
[data-dialog]#item-form {
|
57
|
+
@apply bottom-0 sm:top-[5.5rem] top-[8.55rem];
|
58
|
+
|
59
|
+
[data-dialog-container] > :last-child {
|
60
|
+
grid-column: span 1 / span 1;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
#item-form-content {
|
65
|
+
@apply p-6 rounded-r-none py-0;
|
66
|
+
|
67
|
+
h1 {
|
68
|
+
@apply mt-6 mx-0;
|
69
|
+
}
|
70
|
+
|
71
|
+
.row {
|
72
|
+
@apply px-0;
|
73
|
+
}
|
74
|
+
}
|
@@ -24,12 +24,14 @@
|
|
24
24
|
@import "stylesheets/decidim/admin/_logs.scss";
|
25
25
|
@import "stylesheets/decidim/admin/_filters.scss";
|
26
26
|
@import "stylesheets/decidim/admin/_table-list.scss";
|
27
|
+
@import "stylesheets/decidim/admin/_taxonomies.scss";
|
27
28
|
@import "stylesheets/decidim/admin/_dropdown.scss";
|
28
29
|
@import "stylesheets/decidim/admin/_item_show.scss";
|
29
30
|
@import "stylesheets/decidim/admin/_item_edit.scss";
|
30
31
|
@import "stylesheets/decidim/admin/_tabs.scss";
|
31
32
|
@import "stylesheets/decidim/admin/_component-show.scss";
|
32
33
|
@import "stylesheets/decidim/admin/_moderations.scss";
|
34
|
+
@import "stylesheets/decidim/admin/_select_picker.scss";
|
33
35
|
@import "stylesheets/decidim/admin/_show_email.scss";
|
34
36
|
@import "stylesheets/decidim/admin/_bulk_actions.scss";
|
35
37
|
@import "stylesheets/decidim/admin/_data_picker.scss";
|
@@ -38,3 +40,4 @@
|
|
38
40
|
@import "stylesheets/decidim/admin/_datepicker.scss";
|
39
41
|
@import "stylesheets/decidim/admin/_minimap.scss";
|
40
42
|
@import "stylesheets/decidim/admin/_proposal_status.scss";
|
43
|
+
@import "stylesheets/decidim/_tribute.scss";
|
@@ -41,7 +41,6 @@ module Decidim
|
|
41
41
|
allow! if user_action?
|
42
42
|
allow! if admin_user_action?
|
43
43
|
|
44
|
-
allow! if permission_action.subject == :category
|
45
44
|
allow! if permission_action.subject == :component
|
46
45
|
allow! if permission_action.subject == :attachment
|
47
46
|
allow! if permission_action.subject == :editor_image
|
@@ -59,6 +58,22 @@ module Decidim
|
|
59
58
|
allow! if permission_action.subject == :help_sections
|
60
59
|
allow! if permission_action.subject == :share_token
|
61
60
|
allow! if permission_action.subject == :reminder
|
61
|
+
|
62
|
+
if permission_action.action.in? [:manage_trash, :restore, :soft_delete]
|
63
|
+
if permission_action.action == :soft_delete
|
64
|
+
toggle_allow(trashable_deleted_resource.respond_to?(:deleted?) && !trashable_deleted_resource.deleted?)
|
65
|
+
elsif permission_action.action == :restore
|
66
|
+
toggle_allow(trashable_deleted_resource&.deleted?)
|
67
|
+
else
|
68
|
+
allow!
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
if permission_action.subject == :taxonomy
|
73
|
+
permission_action.action == :destroy ? allow_destroy_taxonomy? : allow!
|
74
|
+
end
|
75
|
+
allow! if permission_action.subject == :taxonomy_filter
|
76
|
+
allow! if permission_action.subject == :taxonomy_item
|
62
77
|
end
|
63
78
|
|
64
79
|
permission_action
|
@@ -66,6 +81,10 @@ module Decidim
|
|
66
81
|
|
67
82
|
private
|
68
83
|
|
84
|
+
def trashable_deleted_resource
|
85
|
+
context.fetch(:trashable_deleted_resource, nil)
|
86
|
+
end
|
87
|
+
|
69
88
|
def user_manager?
|
70
89
|
user && !user.admin? && user.role?("user_manager")
|
71
90
|
end
|
@@ -253,6 +272,18 @@ module Decidim
|
|
253
272
|
def available_authorization_handlers?
|
254
273
|
user.organization.available_authorization_handlers.any?
|
255
274
|
end
|
275
|
+
|
276
|
+
def allow_destroy_taxonomy?
|
277
|
+
return unless permission_action.action == :destroy
|
278
|
+
|
279
|
+
taxonomy = context.fetch(:taxonomy, nil)
|
280
|
+
|
281
|
+
toggle_allow(taxonomy&.removable?)
|
282
|
+
end
|
283
|
+
|
284
|
+
def component
|
285
|
+
context.fetch(:component, nil)
|
286
|
+
end
|
256
287
|
end
|
257
288
|
end
|
258
289
|
end
|
@@ -20,47 +20,74 @@ module Decidim
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def query
|
23
|
-
recipients =
|
24
|
-
.where.not(newsletter_notifications_at: nil)
|
25
|
-
.where.not(email: nil)
|
26
|
-
.where.not(confirmed_at: nil)
|
27
|
-
.not_deleted
|
23
|
+
recipients = recipients_base_query
|
28
24
|
|
29
|
-
|
25
|
+
return recipients if @form.send_to_all_users
|
26
|
+
return verified_users if @form.send_to_verified_users
|
30
27
|
|
31
|
-
|
28
|
+
if filters_present?
|
29
|
+
filtered_recipients = apply_filters(recipients)
|
30
|
+
return recipients.none if filtered_recipients.empty?
|
32
31
|
|
33
|
-
|
34
|
-
|
35
|
-
recipients = participants if @form.send_to_participants
|
36
|
-
recipients = followers if @form.send_to_followers
|
37
|
-
recipients = (followers + participants).uniq if @form.send_to_followers && @form.send_to_participants
|
32
|
+
return filtered_recipients
|
33
|
+
end
|
38
34
|
|
39
35
|
recipients
|
40
36
|
end
|
41
37
|
|
42
38
|
private
|
43
39
|
|
40
|
+
def recipients_base_query
|
41
|
+
Decidim::User.available
|
42
|
+
.where(organization: @form.current_organization)
|
43
|
+
.where.not(newsletter_notifications_at: nil)
|
44
|
+
.where.not(email: nil)
|
45
|
+
.confirmed
|
46
|
+
end
|
47
|
+
|
48
|
+
def filters_present?
|
49
|
+
@form.send_to_followers || @form.send_to_participants || @form.send_to_private_members
|
50
|
+
end
|
51
|
+
|
52
|
+
def apply_filters(recipients)
|
53
|
+
filters = [
|
54
|
+
user_id_of_followers,
|
55
|
+
participant_ids,
|
56
|
+
private_member_ids
|
57
|
+
].compact.flatten.uniq
|
58
|
+
|
59
|
+
filters.empty? ? recipients.none : recipients.where(id: filters)
|
60
|
+
end
|
61
|
+
|
44
62
|
# Return the ids of the ParticipatorySpace selected
|
45
63
|
# in form, grouped by type
|
46
64
|
# This will be used to take followers and
|
47
65
|
# participants of each ParticipatorySpace
|
48
66
|
def spaces
|
49
|
-
return if @form.participatory_space_types.blank?
|
67
|
+
return [] if @form.participatory_space_types.blank?
|
50
68
|
|
51
69
|
@spaces ||= @form.participatory_space_types.map do |type|
|
52
70
|
next if type.ids.blank?
|
53
71
|
|
72
|
+
ids = type.ids
|
73
|
+
|
54
74
|
object_class = Decidim.participatory_space_registry.find(type.manifest_name).model_class_name.constantize
|
55
75
|
|
56
|
-
|
57
|
-
object_class.where(organization: @organization)
|
58
|
-
else
|
59
|
-
object_class.where(id: type.ids.compact_blank)
|
60
|
-
end
|
76
|
+
ids.include?("all") ? object_class.where(organization: @form.organization) : object_class.where(id: ids.compact_blank)
|
61
77
|
end.flatten.compact
|
62
78
|
end
|
63
79
|
|
80
|
+
def verified_users
|
81
|
+
users = recipients_base_query
|
82
|
+
|
83
|
+
verified_users = Decidim::Authorization.select(:decidim_user_id)
|
84
|
+
.where(decidim_user_id: users.select(:id))
|
85
|
+
.where.not(granted_at: nil)
|
86
|
+
.where(name: @form.verification_types)
|
87
|
+
.distinct
|
88
|
+
users.where(id: verified_users)
|
89
|
+
end
|
90
|
+
|
64
91
|
# Return the ids of Users that are following
|
65
92
|
# the spaces selected in form
|
66
93
|
def user_id_of_followers
|
@@ -70,7 +97,7 @@ module Decidim
|
|
70
97
|
Decidim::Follow.user_follower_ids_for_participatory_spaces(spaces)
|
71
98
|
end
|
72
99
|
|
73
|
-
# Return the ids of Users that have
|
100
|
+
# Return the ids of Users that have participated in
|
74
101
|
# the spaces selected in form
|
75
102
|
def participant_ids
|
76
103
|
return if spaces.blank?
|
@@ -91,6 +118,19 @@ module Decidim
|
|
91
118
|
|
92
119
|
participant_ids.flatten.compact.uniq
|
93
120
|
end
|
121
|
+
|
122
|
+
def private_spaces
|
123
|
+
return [] if spaces.blank?
|
124
|
+
|
125
|
+
spaces.select { |space| space.try(:private_space?) }
|
126
|
+
end
|
127
|
+
|
128
|
+
def private_member_ids
|
129
|
+
return unless @form.send_to_private_members
|
130
|
+
return [] if private_spaces.blank?
|
131
|
+
|
132
|
+
Decidim::ParticipatorySpacePrivateUser.private_user_ids_for_participatory_spaces(private_spaces)
|
133
|
+
end
|
94
134
|
end
|
95
135
|
end
|
96
136
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
2
|
+
<div class="item_show__header">
|
3
|
+
<h1 class="item_show__header-title">
|
4
|
+
<%= t(".title") %>
|
5
|
+
</h1>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<div class="item__edit item__edit-1col">
|
9
|
+
<div class="item__edit-form">
|
10
|
+
<%= decidim_form_for(@form, url: bulk_create_moderated_users_path, method: :post, html: { class: "form-defaults form import_participatory_process" }) do |f| %>
|
11
|
+
<div class="form__wrapper">
|
12
|
+
<div class="card pt-4">
|
13
|
+
<div class="card-section">
|
14
|
+
<div class="row column">
|
15
|
+
<%= t(".description") %>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<% if @form.hide %>
|
19
|
+
<%= cell("decidim/announcement", t(".already_reported_html"), callout_class: "alert" ) %>
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
<% if Decidim.module_installed?(:templates) %>
|
23
|
+
<%= render "decidim/templates/admin/block_user_templates/template_chooser", form: f %>
|
24
|
+
<% end %>
|
25
|
+
|
26
|
+
<div class="row column">
|
27
|
+
|
28
|
+
<% @form.user_ids.each do |id| %>
|
29
|
+
<%= hidden_field_tag "user_ids[]", id %>
|
30
|
+
<% end %>
|
31
|
+
<%= f.hidden_field :hide %>
|
32
|
+
<%= f.text_area :justification, required: true, label: t(".justification") %>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div class="item__edit-sticky">
|
39
|
+
<div class="item__edit-sticky-container">
|
40
|
+
<%= f.submit t(".action"), class: "button button__sm button__secondary" %>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
<% end %>
|
44
|
+
</div>
|
45
|
+
</div>
|
@@ -1,44 +1,61 @@
|
|
1
|
-
<% if
|
2
|
-
|
1
|
+
<% if view == :deleted %>
|
2
|
+
<% if allowed_to? :restore, :component, trashable_deleted_resource: component %>
|
3
|
+
<%= icon_link_to "refresh-line", url_for(action: :restore, id: component, controller: "components"), t("decidim.admin.actions.restore"), method: :patch, class: "action-icon--restore" %>
|
4
|
+
<% end %>
|
3
5
|
<% else %>
|
4
|
-
|
5
|
-
|
6
|
+
<% if component.manifest.admin_engine %>
|
7
|
+
<%= icon_link_to "pencil-line", manage_component_path(component), t("actions.manage", scope: "decidim.admin"), class: "action-icon--manage" %>
|
8
|
+
<% else %>
|
9
|
+
<span class="action-space icon"></span>
|
10
|
+
<% end %>
|
6
11
|
|
7
|
-
<% if allowed_to?
|
8
|
-
|
9
|
-
<% else %>
|
10
|
-
|
11
|
-
<% end %>
|
12
|
-
<% if allowed_to? :update, :component, component: component %>
|
13
|
-
<%= icon_link_to "settings-4-line", url_for(action: :edit, id: component, controller: "components"), t("actions.configure", scope: "decidim.admin"), class: "action-icon--configure" %>
|
14
|
-
<% else %>
|
15
|
-
<span class="action-space icon"></span>
|
16
|
-
<% end %>
|
12
|
+
<% if component.manifest.admin_engine && allowed_to?(:share, :component, component: component) %>
|
13
|
+
<%= icon_link_to "share-line", component_share_tokens_path(component_id: component), t("actions.share_tokens", scope: "decidim.admin"), class: "action-icon--share" %>
|
14
|
+
<% else %>
|
15
|
+
<span class="action-space icon"></span>
|
16
|
+
<% end %>
|
17
17
|
|
18
|
-
<% if allowed_to?
|
19
|
-
|
20
|
-
<%= icon_link_to "close-circle-line", url_for(action: :unpublish, id: component, controller: "components"), t("actions.unpublish", scope: "decidim.admin"), class: "action-icon--unpublish", method: :put %>
|
18
|
+
<% if allowed_to? :update, :component, component: component %>
|
19
|
+
<%= icon_link_to "settings-4-line", url_for(action: :edit, id: component, controller: "components"), t("actions.configure", scope: "decidim.admin"), class: "action-icon--configure" %>
|
21
20
|
<% else %>
|
22
|
-
|
21
|
+
<span class="action-space icon"></span>
|
23
22
|
<% end %>
|
24
|
-
<% else %>
|
25
|
-
<span class="action-space icon"></span>
|
26
|
-
<% end %>
|
27
23
|
|
28
|
-
|
24
|
+
<% if allowed_to?(:update, :component, component: component) %>
|
25
|
+
<% if component.published? %>
|
26
|
+
<% if component.visible? %>
|
27
|
+
<%= icon_link_to "eye-close", url_for(action: :hide, id: component, controller: "components"), t("actions.menu_hidden", scope: "decidim.admin"), class: "action-icon--unpublish", method: :put %>
|
28
|
+
<% else %>
|
29
|
+
<%= icon_link_to "close-circle-line", url_for(action: :unpublish, id: component, controller: "components"), t("actions.unpublish", scope: "decidim.admin"), class: "action-icon--menu-hidden", method: :put %>
|
30
|
+
<% end %>
|
31
|
+
<% else %>
|
32
|
+
<%= icon_link_to "check-line", url_for(action: :publish, id: component, controller: "components"), t("actions.publish", scope: "decidim.admin"), class: "action-icon--publish", method: :put %>
|
33
|
+
<% end %>
|
34
|
+
<% else %>
|
35
|
+
<span class="action-space icon"></span>
|
36
|
+
<% end %>
|
29
37
|
|
30
|
-
|
31
|
-
|
32
|
-
|
38
|
+
<%= icon_link_to "eye-line", main_component_path(component), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview", target: :blank, data: { "external-link": false } %>
|
39
|
+
|
40
|
+
<% if allowed_to? :update, :component, component: component %>
|
41
|
+
<% if component.manifest.actions.empty? %>
|
42
|
+
<%= icon "key-2-line", class: "action-icon action-icon--disabled" %>
|
43
|
+
<% else %>
|
44
|
+
<%= icon_link_to "key-2-line", url_for(action: :edit, component_id: component, controller: "component_permissions"), t("actions.permissions", scope: "decidim.admin"), class: "action-icon--permissions" %>
|
45
|
+
<% end %>
|
33
46
|
<% else %>
|
34
|
-
|
47
|
+
<span class="action-space icon"></span>
|
35
48
|
<% end %>
|
36
|
-
<% else %>
|
37
|
-
<span class="action-space icon"></span>
|
38
|
-
<% end %>
|
39
49
|
|
40
|
-
<% if allowed_to?
|
41
|
-
|
42
|
-
|
43
|
-
|
50
|
+
<% if allowed_to?(:soft_delete, :component, trashable_deleted_resource: component) %>
|
51
|
+
<% resources_count = component.primary_stat || 0 %>
|
52
|
+
|
53
|
+
<% if component.published? %>
|
54
|
+
<%= icon "delete-bin-line", class: "action-icon action-icon--disabled", role: "img", aria_label: t("actions.soft_delete", scope: "decidim.admin") %>
|
55
|
+
<% else %>
|
56
|
+
<%= icon_link_to "delete-bin-line", url_for(action: :soft_delete, id: component, controller: "components"), t("actions.soft_delete", scope: "decidim.admin", resources_count:), method: :patch, class: "action-icon--delete", data: { confirm: (t("actions.confirm_delete_component", scope: "decidim.admin", resources_count:)) } %>
|
57
|
+
<% end %>
|
58
|
+
<% else %>
|
59
|
+
<span class="action-space icon"></span>
|
60
|
+
<% end %>
|
44
61
|
<% end %>
|
@@ -1,6 +1,9 @@
|
|
1
1
|
<% if user_role_config.component_is_accessible?(component.manifest_name) %>
|
2
|
-
<tr class="component-<%= component.id %>">
|
3
|
-
<td>
|
2
|
+
<tr class="draggable-content component-<%= component.id %>" draggable="true" data-record-id="<%= component.id %>">
|
3
|
+
<td class="text-center dragging-handle">
|
4
|
+
<%= icon("draggable", class: "dragger") %>
|
5
|
+
</td>
|
6
|
+
<td class="!text-left">
|
4
7
|
<% if component.manifest.admin_engine %>
|
5
8
|
<%= link_to translated_attribute(component.name), manage_component_path(component) %><br>
|
6
9
|
<% else %>
|
@@ -10,12 +13,14 @@
|
|
10
13
|
<td>
|
11
14
|
<%= t "decidim.components.#{component.manifest.name}.name" %>
|
12
15
|
</td>
|
13
|
-
|
16
|
+
<td>
|
17
|
+
<%= render partial: "decidim/admin/components/visibility_label", locals: { component: } %>
|
18
|
+
</td>
|
14
19
|
<td class="table-list__actions">
|
15
20
|
<% if lookup_context.find_all("decidim/#{component.manifest_name}/admin/component/_actions").any? %>
|
16
|
-
<%= render partial: "decidim/#{component.manifest_name}/admin/component/actions", locals: { component: } %>
|
21
|
+
<%= render partial: "decidim/#{component.manifest_name}/admin/component/actions", locals: { component:, view: } %>
|
17
22
|
<% else %>
|
18
|
-
<%= render partial: "actions", locals: { component: } %>
|
23
|
+
<%= render partial: "actions", locals: { component:, view: } %>
|
19
24
|
<% end %>
|
20
25
|
</td>
|
21
26
|
</tr>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<div class="table-scroll">
|
2
|
+
<table class="table-list">
|
3
|
+
<thead>
|
4
|
+
<tr>
|
5
|
+
<th></th>
|
6
|
+
<th class="!text-left"><%= t("index.headers.name", scope: "decidim.admin.components") %></th>
|
7
|
+
<th><%= t("index.headers.type", scope: "decidim.admin.components") %></th>
|
8
|
+
<th><%= t("index.headers.visibility", scope: "decidim.admin.components") %></th>
|
9
|
+
<th><%= t("index.headers.actions", scope: "decidim.admin.components") %></th>
|
10
|
+
</tr>
|
11
|
+
</thead>
|
12
|
+
<tbody class="draggable-table" data-sort-url="<%= reorder_components_path %>" data-draggable-table>
|
13
|
+
<% components.each do |component| %>
|
14
|
+
<%= render partial: "component_row", locals: { component:, view: } %>
|
15
|
+
<% end %>
|
16
|
+
</tbody>
|
17
|
+
</table>
|
18
|
+
</div>
|
@@ -13,9 +13,6 @@
|
|
13
13
|
<div class="row column">
|
14
14
|
<%= form.translated :text_field, :name, autofocus: true, aria: { label: :name } %>
|
15
15
|
</div>
|
16
|
-
<div class="row column">
|
17
|
-
<%= form.number_field :weight %>
|
18
|
-
</div>
|
19
16
|
</div>
|
20
17
|
</div>
|
21
18
|
<% if form.object.settings? %>
|
@@ -114,13 +111,4 @@
|
|
114
111
|
</div>
|
115
112
|
</div>
|
116
113
|
<% end %>
|
117
|
-
<% if component && component.persisted? && !component.published? %>
|
118
|
-
<div class="card" data-component="accordion" id="accordion-share_tokens">
|
119
|
-
<div id="panel-share_tokens" class="card-section">
|
120
|
-
<div class="row column">
|
121
|
-
<%= render partial: "decidim/admin/share_tokens/share_tokens", locals: { share_tokens: form.object.share_tokens } %>
|
122
|
-
</div>
|
123
|
-
</div>
|
124
|
-
</div>
|
125
|
-
<% end %>
|
126
114
|
</div>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% if component.published? %>
|
2
|
+
<% if component.visible? %>
|
3
|
+
<strong class="label success"><%= t(".published") %></strong>
|
4
|
+
<% else %>
|
5
|
+
<strong class="label warning"><%= t(".menu_hidden") %></strong>
|
6
|
+
<% end %>
|
7
|
+
<% else %>
|
8
|
+
<strong class="label alert"><%= t(".unpublished") %></strong>
|
9
|
+
<% end %>
|
@@ -27,18 +27,16 @@
|
|
27
27
|
</h1>
|
28
28
|
</div>
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
<%=
|
36
|
-
<
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
</table>
|
43
|
-
</div>
|
30
|
+
<%= render partial: "components_table", locals: { components: @components, view: :index } %>
|
31
|
+
<% if allowed_to?(:manage_trash, :component, participatory_space: current_participatory_space) %>
|
32
|
+
<div class="card mt-4">
|
33
|
+
<%= link_to manage_trash_components_path, class: "flex items-center underline text-secondary" do %>
|
34
|
+
<%= icon "delete-bin-2-line", class: "mr-2 fill-current text-secondary", role: "img" %>
|
35
|
+
<%= t("actions.view_deleted_components", scope: "decidim.admin") %>
|
36
|
+
<span class="ml-2">
|
37
|
+
<%= icon_with_tooltip("information-line", t("tooltips.deleted_component_info", scope: "decidim.admin")) %>
|
38
|
+
</span>
|
39
|
+
<% end %>
|
40
|
+
</div>
|
41
|
+
<% end %>
|
44
42
|
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% add_decidim_page_title(t("components.manage_trash.title", scope: "decidim.admin")) %>
|
2
|
+
|
3
|
+
<div class="card">
|
4
|
+
<div class="item_show__header">
|
5
|
+
<h1 class="item_show__header-title">
|
6
|
+
<%= t("components.manage_trash.title", scope: "decidim.admin") %>
|
7
|
+
</h1>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<%= render partial: "components_table", locals: { components: trashable_deleted_collection, view: :deleted } %>
|