decidim-admin 0.26.7 → 0.26.8
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/block_user.rb +7 -2
- data/app/controllers/concerns/decidim/admin/needs_admin_tos_accepted.rb +42 -0
- data/app/controllers/decidim/admin/admin_terms_controller.rb +1 -1
- data/app/controllers/decidim/admin/application_controller.rb +1 -0
- data/app/controllers/decidim/admin/space_publications_controller.rb +63 -0
- data/app/controllers/decidim/admin/static_page_topics_controller.rb +1 -3
- data/app/views/decidim/admin/area_types/edit.html.erb +1 -0
- data/app/views/decidim/admin/area_types/index.html.erb +1 -0
- data/app/views/decidim/admin/area_types/new.html.erb +1 -0
- data/app/views/decidim/admin/areas/edit.html.erb +1 -0
- data/app/views/decidim/admin/areas/index.html.erb +1 -0
- data/app/views/decidim/admin/areas/new.html.erb +1 -0
- data/app/views/decidim/admin/attachment_collections/edit.html.erb +1 -0
- data/app/views/decidim/admin/attachment_collections/index.html.erb +1 -0
- data/app/views/decidim/admin/attachment_collections/new.html.erb +1 -0
- data/app/views/decidim/admin/attachments/edit.html.erb +1 -0
- data/app/views/decidim/admin/attachments/index.html.erb +1 -0
- data/app/views/decidim/admin/attachments/new.html.erb +1 -0
- data/app/views/decidim/admin/authorization_workflows/index.html.erb +1 -0
- data/app/views/decidim/admin/categories/edit.html.erb +1 -0
- data/app/views/decidim/admin/categories/index.html.erb +1 -0
- data/app/views/decidim/admin/categories/new.html.erb +1 -0
- data/app/views/decidim/admin/components/edit.html.erb +1 -0
- data/app/views/decidim/admin/components/index.html.erb +1 -0
- data/app/views/decidim/admin/components/new.html.erb +1 -1
- data/app/views/decidim/admin/conflicts/index.html.erb +1 -0
- data/app/views/decidim/admin/help_sections/show.erb +1 -0
- data/app/views/decidim/admin/impersonatable_users/index.html.erb +1 -0
- data/app/views/decidim/admin/impersonations/new.html.erb +1 -0
- data/app/views/decidim/admin/logs/index.html.erb +1 -0
- data/app/views/decidim/admin/moderated_users/index.html.erb +1 -0
- data/app/views/decidim/admin/moderations/index.html.erb +1 -0
- data/app/views/decidim/admin/newsletter_templates/index.html.erb +1 -0
- data/app/views/decidim/admin/newsletter_templates/show.html.erb +1 -0
- data/app/views/decidim/admin/newsletters/index.html.erb +1 -0
- data/app/views/decidim/admin/newsletters/new.html.erb +1 -0
- data/app/views/decidim/admin/newsletters/show.html.erb +1 -0
- data/app/views/decidim/admin/officializations/index.html.erb +1 -0
- data/app/views/decidim/admin/officializations/new.html.erb +1 -0
- data/app/views/decidim/admin/organization/edit.html.erb +1 -0
- data/app/views/decidim/admin/organization_appearance/edit.html.erb +1 -0
- data/app/views/decidim/admin/organization_external_domain_whitelist/edit.html.erb +1 -0
- data/app/views/decidim/admin/scope_types/edit.html.erb +1 -0
- data/app/views/decidim/admin/scope_types/index.html.erb +1 -0
- data/app/views/decidim/admin/scope_types/new.html.erb +1 -0
- data/app/views/decidim/admin/scopes/edit.html.erb +1 -0
- data/app/views/decidim/admin/scopes/index.html.erb +1 -0
- data/app/views/decidim/admin/scopes/new.html.erb +1 -0
- data/app/views/decidim/admin/shared/landing_page_content_blocks/edit.html.erb +1 -0
- data/app/views/decidim/admin/static_page_topics/edit.html.erb +1 -0
- data/app/views/decidim/admin/static_page_topics/new.html.erb +1 -0
- data/app/views/decidim/admin/static_pages/edit.html.erb +1 -0
- data/app/views/decidim/admin/static_pages/index.html.erb +1 -0
- data/app/views/decidim/admin/static_pages/new.html.erb +1 -0
- data/app/views/decidim/admin/user_groups/index.html.erb +1 -0
- data/app/views/decidim/admin/user_groups_csv_verifications/new.html.erb +1 -0
- data/app/views/decidim/admin/users/index.html.erb +1 -0
- data/app/views/decidim/admin/users/new.html.erb +1 -0
- data/app/views/layouts/decidim/admin/global_moderations.html.erb +1 -0
- data/config/environment.rb +1 -0
- data/config/locales/ca.yml +3 -0
- data/config/locales/cs.yml +3 -0
- data/config/locales/de.yml +8 -1
- data/config/locales/el.yml +62 -0
- data/config/locales/en.yml +4 -1
- data/config/locales/es-MX.yml +3 -0
- data/config/locales/es-PY.yml +3 -0
- data/config/locales/es.yml +3 -0
- data/config/locales/eu.yml +5 -4
- data/config/locales/fi-plain.yml +3 -0
- data/config/locales/fi.yml +4 -1
- data/config/locales/fr-CA.yml +3 -0
- data/config/locales/fr.yml +4 -1
- data/config/locales/hu.yml +1 -0
- data/config/locales/ja.yml +4 -1
- data/config/locales/kaa.yml +199 -0
- data/config/locales/pt-BR.yml +64 -0
- data/config/locales/tr-TR.yml +3 -0
- data/lib/decidim/admin/form_builder.rb +1 -2
- data/lib/decidim/admin/test/needs_admin_tos_accepted_examples.rb +9 -0
- data/lib/decidim/admin/test.rb +1 -0
- data/lib/decidim/admin/version.rb +1 -1
- metadata +12 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7ae3bb30016e22eb88e8cdf9118dbe1c1c58702539d2a68ce4863eaf17d40099
|
|
4
|
+
data.tar.gz: b319929c123442784d3416426d3b2cd30cf7a84a06ee15ecc40822270946782c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d56cddac04cded212214f8f962171db9b0940650d338c9da3645ce15cf678cfca72ff58c6192b365a38da11b47773483daf59d4e51ae58f5b6e807a0def34907
|
|
7
|
+
data.tar.gz: 7c060e1ba90c6a94afc4a26d0c94c0706bc8aab1db866045d3b7df7bb78f45fc5a80da36a530205ff8415328a53f27e9d8e772eef3b897f5ee3643f87dcefc93
|
|
@@ -20,8 +20,9 @@ module Decidim
|
|
|
20
20
|
return broadcast(:invalid) unless form.valid?
|
|
21
21
|
|
|
22
22
|
transaction do
|
|
23
|
-
|
|
23
|
+
find_or_create_moderation!
|
|
24
24
|
register_justification!
|
|
25
|
+
block!
|
|
25
26
|
notify_user!
|
|
26
27
|
end
|
|
27
28
|
|
|
@@ -32,6 +33,10 @@ module Decidim
|
|
|
32
33
|
|
|
33
34
|
attr_reader :form
|
|
34
35
|
|
|
36
|
+
def find_or_create_moderation!
|
|
37
|
+
Decidim::UserModeration.create_or_find_by!(user: form.user)
|
|
38
|
+
end
|
|
39
|
+
|
|
35
40
|
def register_justification!
|
|
36
41
|
@current_blocking = UserBlock.create!(
|
|
37
42
|
justification: form.justification,
|
|
@@ -65,7 +70,7 @@ module Decidim
|
|
|
65
70
|
) do
|
|
66
71
|
form.user.blocked = true
|
|
67
72
|
form.user.blocked_at = Time.current
|
|
68
|
-
form.user.
|
|
73
|
+
form.user.block_id = @current_blocking.id
|
|
69
74
|
form.user.extended_data["user_name"] = form.user.name
|
|
70
75
|
form.user.name = "Blocked user"
|
|
71
76
|
form.user.save!
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module Admin
|
|
5
|
+
# Shared behaviour for signed_in admins that require the latest TOS accepted
|
|
6
|
+
module NeedsAdminTosAccepted
|
|
7
|
+
extend ActiveSupport::Concern
|
|
8
|
+
|
|
9
|
+
included do
|
|
10
|
+
before_action :tos_accepted_by_admin
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
private
|
|
14
|
+
|
|
15
|
+
def tos_accepted_by_admin
|
|
16
|
+
return unless request.format.html?
|
|
17
|
+
return unless current_user
|
|
18
|
+
return if current_user.admin_terms_accepted?
|
|
19
|
+
return if permitted_paths?
|
|
20
|
+
|
|
21
|
+
store_location_for(
|
|
22
|
+
current_user,
|
|
23
|
+
request.path
|
|
24
|
+
)
|
|
25
|
+
redirect_to admin_tos_path
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def permitted_paths?
|
|
29
|
+
# ensure that path with or without query string pass
|
|
30
|
+
permitted_paths.find { |el| el.split("?").first == request.path }
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def permitted_paths
|
|
34
|
+
[admin_tos_path, decidim_admin.admin_terms_accept_path]
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def admin_tos_path
|
|
38
|
+
decidim_admin.admin_terms_show_path
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -9,7 +9,7 @@ module Decidim
|
|
|
9
9
|
current_user.admin_terms_accepted_at = Time.current
|
|
10
10
|
if current_user.save!
|
|
11
11
|
flash[:notice] = t("accept.success", scope: "decidim.admin.admin_terms_of_use")
|
|
12
|
-
redirect_to decidim_admin.root_path
|
|
12
|
+
redirect_to stored_location_for(current_user) || decidim_admin.root_path
|
|
13
13
|
else
|
|
14
14
|
flash[:alert] = t("accept.error", scope: "decidim.admin.admin_terms_of_use")
|
|
15
15
|
redirect_to decidim_admin.admin_terms_show_path
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module Admin
|
|
5
|
+
# Base controller that can be inherited by other spaces to publish and unpublish the Space
|
|
6
|
+
#
|
|
7
|
+
class SpacePublicationsController < Decidim::Assemblies::Admin::ApplicationController
|
|
8
|
+
def create
|
|
9
|
+
enforce_permission_to_publish
|
|
10
|
+
|
|
11
|
+
publish_command.call(current_assembly, current_user) do
|
|
12
|
+
on(:ok) do
|
|
13
|
+
flash[:notice] = I18n.t("create.success", scope: i18n_scope)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
on(:invalid) do
|
|
17
|
+
flash.now[:alert] = I18n.t("create.error", scope: i18n_scope)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
redirect_back(fallback_location: assemblies_path)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def destroy
|
|
25
|
+
enforce_permission_to_publish
|
|
26
|
+
|
|
27
|
+
unpublish_command.call(current_assembly, current_user) do
|
|
28
|
+
on(:ok) do
|
|
29
|
+
flash[:notice] = I18n.t("destroy.success", scope: i18n_scope)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
on(:invalid) do
|
|
33
|
+
flash.now[:alert] = I18n.t("destroy.error", scope: i18n_scope)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
redirect_back(fallback_location: assemblies_path)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
private
|
|
41
|
+
|
|
42
|
+
def current_participatory_space
|
|
43
|
+
raise "Not implemented"
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def enforce_permission_to_publish
|
|
47
|
+
raise "Not implemented"
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def publish_command
|
|
51
|
+
raise "Not implemented"
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def unpublish_command
|
|
55
|
+
raise "Not implemented"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def i18n_scope
|
|
59
|
+
raise "Not implemented"
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<% add_decidim_page_title(t("attachment_collections.edit.title", scope: "decidim.admin")) %>
|
|
1
2
|
<%= decidim_form_for(@form, url: url_for([@attachment_collection.collection_for, @attachment_collection]), html: { class: "form edit_attachment_collection" }) do |f| %>
|
|
2
3
|
<%= render partial: "decidim/admin/attachment_collections/form", object: f, locals: { title: t("attachment_collections.edit.title", scope: "decidim.admin") } %>
|
|
3
4
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<% add_decidim_page_title(t("attachment_collections.new.title", scope: "decidim.admin")) %>
|
|
1
2
|
<%= decidim_form_for(@form, url: url_for([collection_for, @form]), html: { class: "form new_attachment_collection" }) do |f| %>
|
|
2
3
|
<%= render partial: "decidim/admin/attachment_collections/form", object: f, locals: { title: t("attachment_collections.new.title", scope: "decidim.admin") } %>
|
|
3
4
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
|
1
2
|
<%= decidim_form_for(@form, url: url_for([@attachment.attached_to, @attachment]), html: { class: "form edit_attachment" }) do |f| %>
|
|
2
3
|
<%= render partial: "decidim/admin/attachments/form", object: f, locals: { title: t(".title") } %>
|
|
3
4
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<% add_decidim_page_title(t("categories.new.title", scope: "decidim.admin")) %>
|
|
1
2
|
<%= decidim_form_for(@form, url: categories_path(current_participatory_space), html: { class: "form new_category" }) do |f| %>
|
|
2
3
|
<%= render partial: "form", object: f, locals: { title: t("categories.new.title", scope: "decidim.admin") } %>
|
|
3
4
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<% add_decidim_page_title(t(".title", name: t("#{@component.manifest.name}.name", scope: "decidim.components"))) %>
|
|
1
2
|
<%= decidim_form_for([current_participatory_space, @form], url: component_path(current_participatory_space, @component), method: "put", html: { class: "form edit_component" }) do |form| %>
|
|
2
3
|
<%= render partial: "form", object: form, locals: { component: @component, title: t(".title", name: t("#{@component.manifest.name}.name", scope: "decidim.components")) } %>
|
|
3
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
<% add_decidim_page_title(t(".title", name: t("#{manifest.name}.name", scope: "decidim.components"))) %>
|
|
2
2
|
<%= decidim_form_for([current_participatory_space, @form], url: components_path(type: params[:type]), method: "post", html: { class: "form new_component" }) do |form| %>
|
|
3
3
|
<%= render partial: "form", object: form, locals: { component: @component, title: t(".title", name: t("#{manifest.name}.name", scope: "decidim.components")) } %>
|
|
4
4
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<% add_decidim_page_title(t("edit_organization_appearance", scope: "decidim.admin.titles")) %>
|
|
1
2
|
<%= decidim_form_for(@form, html: { class: "form edit_organization_appearance" }, url: organization_appearance_path, method: :put) do |f| %>
|
|
2
3
|
<%= render partial: "form", object: f %>
|
|
3
4
|
<div class="button--double form-general-submit">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<% add_decidim_page_title(t("edit_external_domains", scope: "decidim.admin.titles")) %>
|
|
1
2
|
<%= decidim_form_for(@form, html: { class: "form edit_organization_external_domain_whitelist" }, url: organization_external_domain_whitelist_path, method: :patch) do |f| %>
|
|
2
3
|
<%= render partial: "form", object: f %>
|
|
3
4
|
<div class="button--double form-general-submit">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
data/config/locales/ca.yml
CHANGED
|
@@ -956,9 +956,12 @@ ca:
|
|
|
956
956
|
areas: Àrees
|
|
957
957
|
authorization_workflows: Mètodes de verificació
|
|
958
958
|
dashboard: Tauler de control
|
|
959
|
+
edit_external_domains: Llistat de dominis externs permesos
|
|
960
|
+
edit_organization_appearance: Edita l'aparença de la pàgina d'inici
|
|
959
961
|
impersonatable_users: Participants que es poden gestionar
|
|
960
962
|
impersonations: Gestió de participants
|
|
961
963
|
metrics: Mètriques
|
|
964
|
+
pages: Pàgines
|
|
962
965
|
panel: Administradora
|
|
963
966
|
participants: Participants
|
|
964
967
|
scope_types: Tipus d'àmbit
|
data/config/locales/cs.yml
CHANGED
|
@@ -964,9 +964,12 @@ cs:
|
|
|
964
964
|
areas: Oblasti
|
|
965
965
|
authorization_workflows: Metody ověření
|
|
966
966
|
dashboard: Ovládací panel
|
|
967
|
+
edit_external_domains: Seznam externích povolených domén
|
|
968
|
+
edit_organization_appearance: Upravit vzhled domovské stránky
|
|
967
969
|
impersonatable_users: Spravovatelní účastníci
|
|
968
970
|
impersonations: Správa účastníků
|
|
969
971
|
metrics: Metriky
|
|
972
|
+
pages: Stránky
|
|
970
973
|
panel: Admin
|
|
971
974
|
participants: Uživatelé
|
|
972
975
|
scope_types: Typy oblastí působnosti
|
data/config/locales/de.yml
CHANGED
|
@@ -331,7 +331,7 @@ de:
|
|
|
331
331
|
success: Die Komponente wurde erfolgreich veröffentlicht.
|
|
332
332
|
title: Komponenten
|
|
333
333
|
unpublish:
|
|
334
|
-
success: Die Komponente wurde erfolgreich
|
|
334
|
+
success: Die Veröffentlichung der Komponente wurde erfolgreich zurückgezogen.
|
|
335
335
|
update:
|
|
336
336
|
error: Beim Aktualisieren dieser Komponente ist ein Fehler aufgetreten.
|
|
337
337
|
success: Die Komponente wurde erfolgreich aktualisiert.
|
|
@@ -643,6 +643,7 @@ de:
|
|
|
643
643
|
nickname: Spitzname
|
|
644
644
|
reason: Grund
|
|
645
645
|
reports: Anzahl Meldungen
|
|
646
|
+
title: Gemeldete Teilnehmende
|
|
646
647
|
report:
|
|
647
648
|
reasons:
|
|
648
649
|
does_not_belong: Gehört nicht zu
|
|
@@ -652,6 +653,8 @@ de:
|
|
|
652
653
|
blocked: Blockiert
|
|
653
654
|
unblocked: Nicht blockiert
|
|
654
655
|
moderations:
|
|
656
|
+
index:
|
|
657
|
+
title: Gemeldeter Inhalt
|
|
655
658
|
report:
|
|
656
659
|
reasons:
|
|
657
660
|
does_not_belong: Gehört nicht
|
|
@@ -953,9 +956,12 @@ de:
|
|
|
953
956
|
areas: Bereiche
|
|
954
957
|
authorization_workflows: Verifizierungsmethoden
|
|
955
958
|
dashboard: Instrumententafel
|
|
959
|
+
edit_external_domains: Externe Domain-Whitelist
|
|
960
|
+
edit_organization_appearance: Homepage-Erscheinungsbild bearbeiten
|
|
956
961
|
impersonatable_users: Überschaubare Benutzer
|
|
957
962
|
impersonations: Benutzerverwaltung
|
|
958
963
|
metrics: Kriterien
|
|
964
|
+
pages: Seiten
|
|
959
965
|
panel: Admin
|
|
960
966
|
participants: Benutzer
|
|
961
967
|
scope_types: Bereichstypen
|
|
@@ -1047,6 +1053,7 @@ de:
|
|
|
1047
1053
|
moderation:
|
|
1048
1054
|
fields:
|
|
1049
1055
|
created_at: Erstellungsdatum
|
|
1056
|
+
deleted_resource: Gelöschte Ressource
|
|
1050
1057
|
hidden_at: Versteckt bei
|
|
1051
1058
|
participatory_space: Beteiligungsbereich
|
|
1052
1059
|
report_count: Anzahl
|