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
@@ -0,0 +1,87 @@
|
|
1
|
+
<% add_decidim_page_title(t(".title", taxonomy_name: translated_attribute(taxonomy.name))) %>
|
2
|
+
|
3
|
+
<div class="item_show__header">
|
4
|
+
<h1 class="item_show__header-title">
|
5
|
+
<%= t(".title", taxonomy_name: translated_attribute(taxonomy.name)) %>
|
6
|
+
<%= link_to :back, class: "button button__transparent-secondary button__sm" do %>
|
7
|
+
<%= t(".back") %>
|
8
|
+
<% end %>
|
9
|
+
</h1>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class="item__edit-form">
|
13
|
+
<%= decidim_form_for(@form, html: { class: "form-defaults form edit_taxonomy_" }) do |f| %>
|
14
|
+
<%= render partial: "form", object: f %>
|
15
|
+
<div class="item__edit-sticky">
|
16
|
+
<div class="item__edit-sticky-container">
|
17
|
+
<%= f.submit t(".update"), class: "button button__sm button__secondary" %>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<div class="item__edit-form">
|
24
|
+
<h2 class="item_show__header-title mb-4">
|
25
|
+
<%= t(".subtitle", taxonomy_name: translated_attribute(taxonomy.name)) %>
|
26
|
+
<%= link_to t(".new_item"), new_taxonomy_item_path(taxonomy), id: "new-item", class: "js-drawer-editor button button__sm button__secondary new" %>
|
27
|
+
</h2>
|
28
|
+
|
29
|
+
<% if collection.any? %>
|
30
|
+
<%= render "filters" %>
|
31
|
+
|
32
|
+
<% if @taxonomies.any? %>
|
33
|
+
<p class="help-text mt-4"><%= t(".description") %></p>
|
34
|
+
<%= render "table", collection: @taxonomies %>
|
35
|
+
<% else %>
|
36
|
+
<p class="mt-8"><%= t("no_items_found", scope: "decidim.admin.taxonomies.index") %></p>
|
37
|
+
<% end %>
|
38
|
+
<% else %>
|
39
|
+
<p class="mt-8"><%= t(".no_items") %></p>
|
40
|
+
<% end %>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<%= decidim_drawer id: "item-form" do %>
|
44
|
+
<div data-dialog-container class="layout-content"></div>
|
45
|
+
<% end %>
|
46
|
+
|
47
|
+
<script>
|
48
|
+
document.addEventListener("decidim:loaded", function() {
|
49
|
+
var drawer = window.Decidim.currentDialogs["item-form"];
|
50
|
+
var drawerButtons = document.querySelectorAll(".js-drawer-editor");
|
51
|
+
var container = drawer.dialog.querySelector("[data-dialog-container]");
|
52
|
+
|
53
|
+
function setDrawerContent(content) {
|
54
|
+
container.innerHTML = content;
|
55
|
+
|
56
|
+
var form = container.querySelector("#taxonomy-item-form");
|
57
|
+
if(!form) {
|
58
|
+
return location.reload();
|
59
|
+
}
|
60
|
+
window.initFoundation(container);
|
61
|
+
|
62
|
+
form.addEventListener("ajax:beforeSend", function(evt) {
|
63
|
+
form.classList.add("spinner-container");
|
64
|
+
});
|
65
|
+
|
66
|
+
form.addEventListener("ajax:success", function(evt) {
|
67
|
+
var [data, _status, xhr] = event.detail;
|
68
|
+
if(xhr.responseURL.indexOf(location.pathname) > -1) {
|
69
|
+
location.href = xhr.responseURL;
|
70
|
+
} else {
|
71
|
+
setDrawerContent(data.body.innerHTML)
|
72
|
+
}
|
73
|
+
});
|
74
|
+
}
|
75
|
+
|
76
|
+
drawerButtons.forEach(function(button) {
|
77
|
+
button.addEventListener("click", function(evt) {
|
78
|
+
evt.preventDefault();
|
79
|
+
container.innerHTML = '<div class="spinner-container"> </div>';
|
80
|
+
fetch(button.getAttribute("href"))
|
81
|
+
.then(function(response) { return response.text() })
|
82
|
+
.then(function(html) { setDrawerContent(html) });
|
83
|
+
drawer.open();
|
84
|
+
});
|
85
|
+
});
|
86
|
+
});
|
87
|
+
</script>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<% add_decidim_page_title(t("taxonomies", scope: "decidim.admin.titles")) %>
|
2
|
+
|
3
|
+
<div class="card" aria-labelledby="taxonomies-title">
|
4
|
+
<div class="item_show__header">
|
5
|
+
<div class="w-full">
|
6
|
+
<h1 class="item_show__header-title" id="taxonomies-title">
|
7
|
+
<%= t "decidim.admin.titles.taxonomies" %>
|
8
|
+
<% if allowed_to? :create, :taxonomy %>
|
9
|
+
<%= link_to t(".new_taxonomy"), new_taxonomy_path, class: "button button__sm button__secondary new" %>
|
10
|
+
<% end %>
|
11
|
+
</h1>
|
12
|
+
<p class="mt-2 text-gray-600">
|
13
|
+
<%= t(".description") %>
|
14
|
+
</p>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
<% if collection.any? %>
|
18
|
+
<%= render "filters" %>
|
19
|
+
|
20
|
+
<% if @taxonomies.any? %>
|
21
|
+
<%= render "table", collection: @taxonomies if @taxonomies %>
|
22
|
+
<% else %>
|
23
|
+
<p><%= t(".no_items_found") %></p>
|
24
|
+
<% end %>
|
25
|
+
<% else %>
|
26
|
+
<p><%= t("decidim.admin.taxonomies.no_taxonomies") %></p>
|
27
|
+
<% end %>
|
28
|
+
</div>
|
@@ -0,0 +1,16 @@
|
|
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
|
+
<div class="item__edit-form">
|
8
|
+
<%= decidim_form_for(@form, url: taxonomies_path, html: { class: "form-defaults form new_taxonomy_" }) do |f| %>
|
9
|
+
<%= render partial: "form", object: f %>
|
10
|
+
<div class="item__edit-sticky">
|
11
|
+
<div class="item__edit-sticky-container">
|
12
|
+
<%= f.submit t(".create"), class: "button button__sm button__secondary" %>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<%= form.collection_check_boxes :taxonomy_items, collection, :value, :name do |item| %>
|
2
|
+
<div>
|
3
|
+
<%= item.label { item.check_box(autocomplete: false) + item.text } %>
|
4
|
+
</div>
|
5
|
+
<% if item.object.children.any? %>
|
6
|
+
<div class="ml-4 js-taxonomy-children" data-parent="<%= item.object.value %>">
|
7
|
+
<%= render "decidim/admin/taxonomy_filters/check_boxes", form:, collection: item.object.children %>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
@@ -0,0 +1,96 @@
|
|
1
|
+
<div class="form__wrapper">
|
2
|
+
<div class="card pt-4">
|
3
|
+
<div class="card-section">
|
4
|
+
<div class="row column">
|
5
|
+
<%= form.text_field :root_taxonomy_id, value: translated_attribute(root_taxonomy.name), disabled: true, class: "w-full" %>
|
6
|
+
<%= form.hidden_field :root_taxonomy_id %>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
<div class="card-section">
|
10
|
+
<div class="row column">
|
11
|
+
<%= form.translated :text_field, :name, aria: { label: :name }, placeholder: translated_attribute(root_taxonomy.name), help_text: t(".name_help") %>
|
12
|
+
</div>
|
13
|
+
<div class="row column">
|
14
|
+
<%= form.translated :text_field, :internal_name, aria: { label: :internal_name }, placeholder: translated_attribute(root_taxonomy.name) %>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<div class="card">
|
20
|
+
<div class="card-section">
|
21
|
+
<% if root_taxonomy.children.any? %>
|
22
|
+
<div class="card-divider">
|
23
|
+
<h2><%= t(".items", count: "<strong class=\"js-filter-children-count\">#{root_taxonomy.all_children.count}</strong>").html_safe %></h2>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<div class="row column">
|
27
|
+
<div class="table-scroll half-vh">
|
28
|
+
<label><%= check_box_tag "selectAll" %> <%= t(".all") %></label>
|
29
|
+
<%= render "decidim/admin/taxonomy_filters/check_boxes", form:, collection: @form.items_collection %>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
<% else %>
|
33
|
+
<div class="card-divider">
|
34
|
+
<h2><%= t(".no_items") %></h2>
|
35
|
+
</div>
|
36
|
+
<% end %>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<div class="card">
|
41
|
+
<div class="card-section">
|
42
|
+
<div class="card-divider">
|
43
|
+
<h2><%= t(".space_filter") %></h2>
|
44
|
+
</div>
|
45
|
+
<div class="row column">
|
46
|
+
<%= form.collection_check_boxes :participatory_space_manifests, @form.available_participatory_space_manifests, :id, :name do |b| %>
|
47
|
+
<div>
|
48
|
+
<%= b.label { b.check_box + b.text } %>
|
49
|
+
</div>
|
50
|
+
<% end %>
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
</div>
|
54
|
+
</div>
|
55
|
+
|
56
|
+
<script>
|
57
|
+
document.addEventListener("DOMContentLoaded", function() {
|
58
|
+
var selectAll = document.querySelector("[name='selectAll']");
|
59
|
+
var checkBoxes = document.querySelectorAll("[type='checkbox'][name='taxonomy_filter[taxonomy_items][]']");
|
60
|
+
var notChecked = document.querySelectorAll("[type='checkbox'][name='taxonomy_filter[taxonomy_items][]']:not([checked])");
|
61
|
+
var count = document.querySelector(".js-filter-children-count");
|
62
|
+
|
63
|
+
var updateCounter = function() {
|
64
|
+
var checked = Array.from(checkBoxes).filter(function(checkbox) {
|
65
|
+
return checkbox.checked;
|
66
|
+
});
|
67
|
+
count.innerHTML = checked.length;
|
68
|
+
};
|
69
|
+
|
70
|
+
var toggleChildrenSelect = function(checkbox) {
|
71
|
+
var children = document.querySelectorAll(".js-taxonomy-children[data-parent='" + checkbox.value + "'] [type='checkbox'][name='taxonomy_filter[taxonomy_items][]']");
|
72
|
+
children.forEach(function(child) {
|
73
|
+
child.checked = checkbox.checked;
|
74
|
+
toggleChildrenSelect(child);
|
75
|
+
});
|
76
|
+
updateCounter();
|
77
|
+
}
|
78
|
+
|
79
|
+
selectAll.checked = notChecked.length === 0;
|
80
|
+
selectAll.addEventListener("change", function() {
|
81
|
+
checkBoxes.forEach(function(checkbox) {
|
82
|
+
checkbox.checked = selectAll.checked;
|
83
|
+
});
|
84
|
+
updateCounter();
|
85
|
+
});
|
86
|
+
|
87
|
+
checkBoxes.forEach(function(checkbox) {
|
88
|
+
checkbox.addEventListener("change", function() {
|
89
|
+
updateCounter();
|
90
|
+
toggleChildrenSelect(checkbox);
|
91
|
+
});
|
92
|
+
});
|
93
|
+
|
94
|
+
updateCounter();
|
95
|
+
});
|
96
|
+
</script>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<div class="table-scroll mt-8" role="table" aria-labelledby="taxonomies-title">
|
2
|
+
<table class="table-list">
|
3
|
+
<thead>
|
4
|
+
<tr role="row">
|
5
|
+
<th><%= t(".internal_name") %></th>
|
6
|
+
<th><%= t(".name") %></th>
|
7
|
+
<th><%= t(".components_count") %></th>
|
8
|
+
<th class="w-16"><%= t(".actions") %></th>
|
9
|
+
</tr>
|
10
|
+
</thead>
|
11
|
+
<tbody role="rowgroup">
|
12
|
+
<% collection.each do |taxonomy_filter| %>
|
13
|
+
<tr>
|
14
|
+
<td><%= translated_attribute(taxonomy_filter.internal_name) %></td>
|
15
|
+
<td><%= translated_attribute(taxonomy_filter.name) %></td>
|
16
|
+
<td><%= taxonomy_filter.components_count %></td>
|
17
|
+
<td>
|
18
|
+
<% if allowed_to? :update, :taxonomy_filter, taxonomy_filter: %>
|
19
|
+
<%= icon_link_to "pencil-line", edit_taxonomy_filter_path(root_taxonomy, taxonomy_filter), t(".edit"), class: "action-icon--edit" %>
|
20
|
+
<% else %>
|
21
|
+
<span class="action-space icon"></span>
|
22
|
+
<% end %>
|
23
|
+
<% if allowed_to? :destroy, :taxonomy_filter, taxonomy_filter: %>
|
24
|
+
<%= icon_link_to "delete-bin-line", taxonomy_filter_path(root_taxonomy, taxonomy_filter), t(".destroy"), class: "action-icon--remove", method: :delete, data: { confirm: t(".confirm_destroy", name: strip_tags(translated_attribute(taxonomy_filter.name))) } %>
|
25
|
+
<% else %>
|
26
|
+
<span class="action-space icon"></span>
|
27
|
+
<% end %>
|
28
|
+
</td>
|
29
|
+
</tr>
|
30
|
+
<% end %>
|
31
|
+
</tbody>
|
32
|
+
</table>
|
33
|
+
</div>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
2
|
+
|
3
|
+
<div class="item_show__header">
|
4
|
+
<h1 class="item_show__header-title">
|
5
|
+
<%= t(".title") %>
|
6
|
+
<%= link_to :back, class: "button button__transparent-secondary button__sm" do %>
|
7
|
+
<%= t(".back") %>
|
8
|
+
<% end %>
|
9
|
+
</h1>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class="item__edit-form">
|
13
|
+
<%= decidim_form_for(@form, url: taxonomy_filter_path(root_taxonomy, id: taxonomy_filter), html: { class: "form form-defaults new_taxonomy_filter_" }) do |f| %>
|
14
|
+
<%= render partial: "decidim/admin/taxonomy_filters/form", object: f %>
|
15
|
+
|
16
|
+
<div class="item__edit-sticky">
|
17
|
+
<div class="item__edit-sticky-container">
|
18
|
+
<%= f.submit t(".update"), class: "button button__sm button__secondary" %>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<% add_decidim_page_title(t("decidim.admin.titles.taxonomy_filters", taxonomy: translated_attribute(root_taxonomy.name))) %>
|
2
|
+
|
3
|
+
<div class="card" aria-labelledby="taxonomy_filters-title">
|
4
|
+
<div class="item_show__header">
|
5
|
+
<div class="w-full">
|
6
|
+
<h1 class="item_show__header-title" id="taxonomy_filters-title">
|
7
|
+
<%= t("decidim.admin.titles.taxonomy_filters", taxonomy: translated_attribute(root_taxonomy.name)) %>
|
8
|
+
<% if allowed_to? :create, :taxonomy %>
|
9
|
+
<%= link_to t(".new_filter"), new_taxonomy_filter_path(root_taxonomy), class: "button button__sm button__secondary new" %>
|
10
|
+
<% end %>
|
11
|
+
</h1>
|
12
|
+
|
13
|
+
<p class="mt-2 text-gray-600">
|
14
|
+
<%= t(".description") %>
|
15
|
+
</p>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<div class="card-section p-4">
|
20
|
+
<% if collection.any? %>
|
21
|
+
<%= render "decidim/admin/taxonomy_filters/table" %>
|
22
|
+
<% else %>
|
23
|
+
<p><%= t(".empty") %></p>
|
24
|
+
<% end %>
|
25
|
+
</div>
|
26
|
+
</div>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
2
|
+
|
3
|
+
<div class="item_show__header">
|
4
|
+
<h1 class="item_show__header-title">
|
5
|
+
<%= t(".title") %>
|
6
|
+
<%= link_to :back, class: "button button__transparent-secondary button__sm" do %>
|
7
|
+
<%= t(".back") %>
|
8
|
+
<% end %>
|
9
|
+
</h1>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class="item__edit-form">
|
13
|
+
<%= decidim_form_for(@form, url: taxonomy_filters_path(root_taxonomy), html: { class: "form form-defaults new_taxonomy_filter_" }) do |f| %>
|
14
|
+
<%= render partial: "decidim/admin/taxonomy_filters/form", object: f %>
|
15
|
+
|
16
|
+
<div class="item__edit-sticky">
|
17
|
+
<div class="item__edit-sticky-container">
|
18
|
+
<%= f.submit t(".create"), class: "button button__sm button__secondary" %>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<script>
|
25
|
+
document.addEventListener("DOMContentLoaded", function() {
|
26
|
+
var selectAll = document.querySelector("[name='selectAll']");
|
27
|
+
|
28
|
+
// check all checkboxes on load
|
29
|
+
selectAll.checked = true;
|
30
|
+
selectAll.dispatchEvent(new Event("change"));
|
31
|
+
});
|
32
|
+
</script>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<% taxonomy_items_options_for_filter(taxonomy_filter).each do |text, id| %>
|
2
|
+
<div class="ml-4">
|
3
|
+
<%= label_tag("checkbox-taxonomy-#{id}", style: "padding-left: #{text.split(" ").count / 5}em") do
|
4
|
+
check_box_tag("checkbox-taxonomy-#{id}", id, true, autocomplete: false, disabled: true) + text.gsub(" ", "")
|
5
|
+
end %>
|
6
|
+
</div>
|
7
|
+
<% end %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<table class="table-list w-full my-4">
|
2
|
+
<thead>
|
3
|
+
<tr>
|
4
|
+
<th><%= t("decidim.admin.taxonomy_filters.table.name") %></th>
|
5
|
+
<th><%= t("decidim.admin.taxonomy_filters.table.internal_name") %></th>
|
6
|
+
<th class="w-16"><%= t("decidim.admin.taxonomy_filters.table.actions") %></th>
|
7
|
+
</tr>
|
8
|
+
</thead>
|
9
|
+
<tbody>
|
10
|
+
<% component.available_taxonomy_filters.each do |taxonomy_filter| %>
|
11
|
+
<%= hidden_field_tag(field_name, taxonomy_filter.id) %>
|
12
|
+
<tr>
|
13
|
+
<td><%= taxonomy_filter.translated_name %></td>
|
14
|
+
<td><%= taxonomy_filter.translated_internal_name %></td>
|
15
|
+
<td>
|
16
|
+
<%= icon_link_to("pencil-line",
|
17
|
+
decidim_admin.taxonomy_filters_selector_path(component_id: component.id, taxonomy_id: taxonomy_filter.root_taxonomy_id, taxonomy_filter_id: taxonomy_filter.id),
|
18
|
+
t("decidim.admin.taxonomy_filters.table.edit"),
|
19
|
+
class: "js-edit-taxonomy-filter",
|
20
|
+
data: { drawer: "taxonomy_filters-dialog" }) %>
|
21
|
+
</td>
|
22
|
+
</tr>
|
23
|
+
<% end %>
|
24
|
+
</tbody>
|
25
|
+
</table>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<%= form_with url: new_taxonomy_filters_selector_path, method: :get, local: false, id: "select-taxonomy-filter-form" do |form| %>
|
2
|
+
<div class="form__wrapper">
|
3
|
+
<%= hidden_field_tag :component_id, component.id %>
|
4
|
+
<div class="item__edit-form js-drawer-taxonomy-select">
|
5
|
+
<%= label_tag("available-taxonomies-filter", t(".taxonomies")) %>
|
6
|
+
<%= select_tag "taxonomy_id", options_from_collection_for_select(current_organization.taxonomies.roots, "id", "translated_name", root_taxonomy&.id), include_blank: t(".select_taxonomy") %>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<% if root_taxonomy %>
|
10
|
+
<div class="item__edit-form js-drawer-filter-select">
|
11
|
+
<%= label_tag("available-filters-filter", t(".filters")) %>
|
12
|
+
<%= select_tag "taxonomy_filter_id", options_from_collection_for_select(root_taxonomy.taxonomy_filters, "id", "translated_internal_name", taxonomy_filter&.id), include_blank: t(".select_filter") %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render "decidim/admin/taxonomy_filters_selector/taxonomies_select" %>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<% content_for(:action_buttons) do %>
|
2
|
+
<% if taxonomy_filter %>
|
3
|
+
<%= button_tag class: "button button__secondary button__sm", id: "save-taxonomy-filter" do %>
|
4
|
+
<%= t(".save") %>
|
5
|
+
<% end %>
|
6
|
+
<% end %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<%= render "decidim/admin/taxonomy_filters_selector/taxonomies_select" %>
|
10
|
+
|
11
|
+
<%= form_with url: taxonomy_filters_selector_index_path, method: :post, local: false, id: "save-taxonomy-filter-form" do |form| %>
|
12
|
+
<%= hidden_field_tag :component_id, component.id %>
|
13
|
+
<%= hidden_field_tag :taxonomy_id, root_taxonomy&.id %>
|
14
|
+
<%= hidden_field_tag :taxonomy_filter_id, taxonomy_filter&.id %>
|
15
|
+
|
16
|
+
<% if taxonomy_filter %>
|
17
|
+
<div class="card">
|
18
|
+
<h3 class="mb-4">
|
19
|
+
<strong><%= taxonomy_filter.translated_name %></strong>
|
20
|
+
<span class="float-right"><%= t(".items_count", count: taxonomy_filter.filter_items_count) %></span>
|
21
|
+
</h3>
|
22
|
+
<%= render "decidim/admin/taxonomy_filters_selector/check_boxes", collection: taxonomy_filter.taxonomies %>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<%= cell("decidim/announcement", t(".add_new_items_html", url: decidim_admin.taxonomy_filters_path(taxonomy_id: root_taxonomy, taxonomy_filter_id: taxonomy_filter))) %>
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% content_for(:action_buttons) do %>
|
2
|
+
<% if taxonomy_filter %>
|
3
|
+
<%= link_to decidim_admin.taxonomy_filters_selector_path(taxonomy_filter_id: taxonomy_filter.id, taxonomy_id: root_taxonomy.id, component_id: component.id), remote: true, method: :delete, class: "button button__transparent-secondary button__sm", id: "remove-taxonomy-filter" do %>
|
4
|
+
<%= t(".remove") %>
|
5
|
+
<% end %>
|
6
|
+
<% end %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<h3 class="text-lg my-4"><%= root_taxonomy.translated_name %></h3>
|
10
|
+
<h4 class="text-xl my-4"><%= taxonomy_filter.translated_internal_name %></h4>
|
11
|
+
|
12
|
+
<div class="card">
|
13
|
+
<h3 class="mb-4">
|
14
|
+
<strong><%= taxonomy_filter.translated_name %></strong>
|
15
|
+
<span class="float-right"><%= t(".items_count", count: taxonomy_filter.filter_items_count) %></span>
|
16
|
+
</h3>
|
17
|
+
<%= render "decidim/admin/taxonomy_filters_selector/check_boxes", collection: taxonomy_filter.taxonomies %>
|
18
|
+
</div>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%= display_flash_messages %>
|
2
|
+
|
3
|
+
<div class="row column">
|
4
|
+
<%= form.translated :text_field, :item_name, autofocus: true, class: "js-hashtags", hashtaggable: true, aria: { label: :name } %>
|
5
|
+
</div>
|
6
|
+
<div class="row column">
|
7
|
+
<%= form.select :parent_id, options_for_select(parent_options, selected: selected_parent_id), {} %>
|
8
|
+
</div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<div class="form__wrapper">
|
2
|
+
<div class="item__edit-form">
|
3
|
+
<%= decidim_form_for(@form, url: taxonomy_item_path(taxonomy_id: taxonomy.id, id: taxonomy_item.id ), remote: true, html: { id: "taxonomy-item-form", class: "form-defaults form new_taxonomy_" }) do |f| %>
|
4
|
+
<h1>
|
5
|
+
<%= t ".title", taxonomy: translated_attribute(taxonomy.name) %>
|
6
|
+
<%= f.submit t(".update"), class: "button button__sm button__secondary" %>
|
7
|
+
</h1>
|
8
|
+
|
9
|
+
<%= render partial: "form", object: f %>
|
10
|
+
<% end %>
|
11
|
+
</div>
|
12
|
+
</div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<div class="form__wrapper">
|
2
|
+
<div class="item__edit-form">
|
3
|
+
<%= decidim_form_for(@form, url: taxonomy_items_path(taxonomy), remote: true, html: { id: "taxonomy-item-form", class: "form-defaults form new_taxonomy_" }) do |f| %>
|
4
|
+
<h1>
|
5
|
+
<%= t ".title", taxonomy: translated_attribute(taxonomy.name) %>
|
6
|
+
<%= f.submit t(".create"), class: "button button__sm button__secondary" %>
|
7
|
+
</h1>
|
8
|
+
|
9
|
+
<%= render partial: "form", object: f %>
|
10
|
+
<% end %>
|
11
|
+
</div>
|
12
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% content_for :breadcrumb_context_menu do %>
|
2
|
+
<div class="process-title-content-breadcrumb-container-right">
|
3
|
+
<% if allowed_to? :create, :taxonomy_filter %>
|
4
|
+
<%= link_to url_for(action: :new, controller: params[:controller]), class: "button button__sm button__transparent process-title-content-breadcrumb-container-right-link" do %>
|
5
|
+
<%= icon "add-line", class: "w-4 h-4" %>
|
6
|
+
<span>
|
7
|
+
<%= t("actions.new_taxonomy_filter", scope: "decidim.admin.taxonomy_filters") %>
|
8
|
+
</span>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
<%= render partial: breadcrumb_manage_partial if breadcrumb_manage_partial.present? %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%= render "layouts/decidim/admin/application" do %>
|
16
|
+
<%= yield %>
|
17
|
+
<% end %>
|