decidim-admin 0.23.0 → 0.24.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim-admin might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/config/decidim_admin_manifest.js +1 -0
- data/app/assets/javascripts/decidim/admin/application.js.es6 +2 -0
- data/app/assets/javascripts/decidim/admin/budget_rule_toggler.component.js.es6 +23 -20
- data/app/assets/javascripts/decidim/admin/bundle.js +10 -17
- data/app/assets/javascripts/decidim/admin/bundle.js.map +1 -1
- data/app/assets/javascripts/decidim/admin/form.js.es6 +1 -0
- data/app/assets/javascripts/decidim/admin/import_guidance.js.es6 +29 -0
- data/app/assets/javascripts/decidim/admin/moderations.js.es6 +24 -0
- data/app/assets/javascripts/decidim/admin/proposal_infinite_edit.js.es6 +20 -0
- data/app/assets/javascripts/decidim/admin/subform_multi_toggler.component.js.es6 +2 -2
- data/app/assets/javascripts/decidim/admin/subform_toggler.component.js.es6 +2 -2
- data/app/assets/javascripts/decidim/admin/user_moderations.js +2 -0
- data/app/assets/stylesheets/decidim/admin/_variables.scss +9 -0
- data/app/assets/stylesheets/decidim/admin/components/_dropdown-menu.scss +3 -0
- data/app/assets/stylesheets/decidim/admin/extra/_action-icon.scss +13 -0
- data/app/assets/stylesheets/decidim/admin/extra/_block_user.scss +5 -0
- data/app/assets/stylesheets/decidim/admin/extra/_title_bar.scss +1 -0
- data/app/assets/stylesheets/decidim/admin/modules/_buttons.scss +1 -0
- data/app/assets/stylesheets/decidim/admin/modules/_moderations.scss +39 -0
- data/app/assets/stylesheets/decidim/admin/modules/_modules.scss +2 -0
- data/app/assets/stylesheets/decidim/admin/modules/_reveal.scss +5 -0
- data/app/assets/stylesheets/decidim/admin/modules/_secondary-nav.scss +6 -3
- data/app/assets/stylesheets/decidim/admin/modules/_user-login.scss +2 -2
- data/app/assets/stylesheets/decidim/admin/user_moderations.scss +3 -0
- data/app/assets/stylesheets/decidim/admin/utils/_settings.scss +1 -0
- data/app/cells/decidim/admin/content_block/show.erb +1 -1
- data/app/cells/decidim/admin/content_block_cell.rb +4 -0
- data/app/commands/decidim/admin/block_user.rb +70 -0
- data/app/commands/decidim/admin/create_import.rb +29 -0
- data/app/commands/decidim/admin/create_participatory_space_admin_user_actions.rb +98 -0
- data/app/commands/decidim/admin/create_participatory_space_private_user.rb +1 -1
- data/app/commands/decidim/admin/create_static_page.rb +2 -1
- data/app/commands/decidim/admin/hide_resource.rb +21 -0
- data/app/commands/decidim/admin/impersonate_user.rb +17 -1
- data/app/commands/decidim/admin/promote_managed_user.rb +10 -0
- data/app/commands/decidim/admin/reorder_content_blocks.rb +6 -3
- data/app/commands/decidim/admin/transfer_user.rb +78 -0
- data/app/commands/decidim/admin/unblock_user.rb +48 -0
- data/app/commands/decidim/admin/unreport_user.rb +46 -0
- data/app/commands/decidim/admin/update_organization_appearance.rb +12 -4
- data/app/commands/decidim/admin/update_static_page.rb +2 -1
- data/app/commands/decidim/admin/verify_user_group.rb +1 -1
- data/app/controllers/concerns/decidim/admin/filterable.rb +1 -1
- data/app/controllers/concerns/decidim/admin/global_moderation_context.rb +51 -0
- data/app/controllers/concerns/decidim/admin/landing_page.rb +105 -0
- data/app/controllers/concerns/decidim/admin/landing_page_content_blocks.rb +118 -0
- data/app/controllers/concerns/decidim/moderations/admin/filterable.rb +54 -0
- data/app/controllers/decidim/admin/block_user_controller.rb +60 -0
- data/app/controllers/decidim/admin/components/base_controller.rb +1 -0
- data/app/controllers/decidim/admin/conflicts_controller.rb +46 -0
- data/app/controllers/decidim/admin/exports_controller.rb +1 -2
- data/app/controllers/decidim/admin/global_moderations/reports_controller.rb +18 -0
- data/app/controllers/decidim/admin/global_moderations_controller.rb +32 -0
- data/app/controllers/decidim/admin/impersonations_controller.rb +1 -1
- data/app/controllers/decidim/admin/imports_controller.rb +52 -0
- data/app/controllers/decidim/admin/moderated_users_controller.rb +44 -0
- data/app/controllers/decidim/admin/moderations/reports_controller.rb +39 -0
- data/app/controllers/decidim/admin/moderations_controller.rb +31 -7
- data/app/controllers/decidim/admin/officializations_controller.rb +3 -3
- data/app/controllers/decidim/admin/organization_homepage_controller.rb +6 -2
- data/app/controllers/decidim/admin/static_pages_controller.rb +7 -0
- data/app/events/decidim/resource_hidden_event.rb +37 -0
- data/app/forms/decidim/admin/block_user_form.rb +25 -0
- data/app/forms/decidim/admin/import_form.rb +85 -0
- data/app/forms/decidim/admin/organization_appearance_form.rb +1 -2
- data/app/forms/decidim/admin/participatory_space_private_user_csv_import_form.rb +4 -5
- data/app/forms/decidim/admin/participatory_space_private_user_form.rb +0 -5
- data/app/forms/decidim/admin/selective_newsletter_form.rb +6 -0
- data/app/forms/decidim/admin/static_page_form.rb +6 -1
- data/app/forms/decidim/admin/transfer_user_form.rb +19 -0
- data/app/helpers/decidim/admin/application_helper.rb +5 -4
- data/app/helpers/decidim/admin/exports_helper.rb +2 -2
- data/app/helpers/decidim/admin/filterable_helper.rb +3 -2
- data/app/helpers/decidim/admin/imports_helper.rb +43 -0
- data/app/helpers/decidim/admin/menu_helper.rb +10 -0
- data/app/helpers/decidim/admin/moderations/reports_helper.rb +40 -0
- data/app/helpers/decidim/admin/moderations_helper.rb +36 -0
- data/app/helpers/decidim/admin/newsletters_helper.rb +4 -10
- data/app/helpers/decidim/admin/settings_helper.rb +2 -1
- data/app/helpers/decidim/admin/sidebar_menu_helper.rb +13 -0
- data/app/helpers/decidim/admin/user_moderations_helper.rb +6 -0
- data/app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb +1 -1
- data/app/jobs/decidim/admin/verify_user_group_from_csv_job.rb +1 -1
- data/app/permissions/decidim/admin/permissions.rb +7 -6
- data/app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb +1 -1
- data/app/presenters/decidim/admin/secondary_menu_presenter.rb +26 -0
- data/app/queries/decidim/admin/active_users_counter.rb +1 -2
- data/app/queries/decidim/admin/newsletter_recipients.rb +0 -7
- data/app/queries/decidim/admin/user_filter.rb +1 -2
- data/app/views/decidim/admin/attachment_collections/index.html.erb +1 -1
- data/app/views/decidim/admin/attachments/index.html.erb +1 -1
- data/app/views/decidim/admin/block_user/new.html.erb +22 -0
- data/app/views/decidim/admin/categories/index.html.erb +1 -1
- data/app/views/decidim/admin/components/_component.html.erb +12 -0
- data/app/views/decidim/admin/conflicts/edit.html.erb +46 -0
- data/app/views/decidim/admin/conflicts/index.html.erb +34 -0
- data/app/views/decidim/admin/dashboard/show.html.erb +1 -0
- data/app/views/decidim/admin/exports/_dropdown.html.erb +1 -1
- data/app/views/decidim/admin/imports/_dropdown.html.erb +9 -0
- data/app/views/decidim/admin/imports/new.html.erb +57 -0
- data/app/views/decidim/admin/moderated_users/_report.html.erb +10 -0
- data/app/views/decidim/admin/moderated_users/index.html.erb +78 -0
- data/app/views/decidim/admin/moderations/_report.html.erb +1 -1
- data/app/views/decidim/admin/moderations/index.html.erb +27 -9
- data/app/views/decidim/admin/moderations/reports/index.html.erb +102 -0
- data/app/views/decidim/admin/moderations/reports/show.html.erb +62 -0
- data/app/views/decidim/admin/newsletters/index.html.erb +1 -1
- data/app/views/decidim/admin/newsletters/select_recipients_to_deliver.html.erb +2 -2
- data/app/views/decidim/admin/officializations/index.html.erb +13 -4
- data/app/views/decidim/admin/organization_appearance/_form.html.erb +0 -4
- data/app/views/decidim/admin/organization_appearance/form/_colors.html.erb +1 -1
- data/app/views/decidim/admin/organization_appearance/form/_images.html.erb +4 -4
- data/app/views/decidim/admin/participatory_space_private_users/index.html.erb +1 -1
- data/app/views/decidim/admin/shared/_gallery.html.erb +1 -1
- data/app/views/decidim/admin/shared/landing_page/edit.html.erb +47 -0
- data/app/views/decidim/admin/shared/landing_page_content_blocks/edit.html.erb +15 -0
- data/app/views/decidim/admin/static_pages/_form.html.erb +6 -0
- data/app/views/decidim/admin/users/index.html.erb +1 -1
- data/app/views/layouts/decidim/admin/_application.html.erb +5 -1
- data/app/views/layouts/decidim/admin/_title_bar.html.erb +2 -2
- data/app/views/layouts/decidim/admin/global_moderations.html.erb +7 -0
- data/app/views/layouts/decidim/admin/newsletters.erb +1 -1
- data/app/views/layouts/decidim/admin/settings.html.erb +2 -33
- data/app/views/layouts/decidim/admin/users.html.erb +11 -0
- data/config/locales/ar.yml +0 -9
- data/config/locales/bg.yml +0 -5
- data/config/locales/ca.yml +33 -9
- data/config/locales/cs.yml +193 -50
- data/config/locales/de.yml +172 -28
- data/config/locales/el.yml +62 -9
- data/config/locales/en.yml +152 -9
- data/config/locales/es-MX.yml +42 -9
- data/config/locales/es-PY.yml +42 -9
- data/config/locales/es.yml +42 -9
- data/config/locales/eu.yml +18 -21
- data/config/locales/fi-plain.yml +150 -7
- data/config/locales/fi.yml +150 -7
- data/config/locales/fr-CA.yml +141 -8
- data/config/locales/fr.yml +148 -15
- data/config/locales/gl.yml +225 -4
- data/config/locales/hu.yml +13 -9
- data/config/locales/id-ID.yml +0 -3
- data/config/locales/is-IS.yml +36 -6
- data/config/locales/it.yml +74 -9
- data/config/locales/ja.yml +43 -12
- data/config/locales/lv.yml +0 -9
- data/config/locales/nl.yml +120 -11
- data/config/locales/no.yml +16 -9
- data/config/locales/pl.yml +159 -15
- data/config/locales/pt-BR.yml +0 -3
- data/config/locales/pt.yml +0 -9
- data/config/locales/ro-RO.yml +8 -9
- data/config/locales/ru.yml +0 -7
- data/config/locales/si-LK.yml +1 -0
- data/config/locales/sk.yml +0 -9
- data/config/locales/sl.yml +0 -5
- data/config/locales/sr-CS.yml +0 -7
- data/config/locales/sv.yml +59 -9
- data/config/locales/sw-KE.yml +1 -0
- data/config/locales/tr-TR.yml +206 -11
- data/config/locales/uk.yml +0 -3
- data/config/locales/zh-CN.yml +0 -9
- data/config/routes.rb +21 -1
- data/lib/decidim/admin.rb +6 -0
- data/lib/decidim/admin/engine.rb +76 -1
- data/lib/decidim/admin/import.rb +12 -0
- data/lib/decidim/admin/import/creator.rb +82 -0
- data/lib/decidim/admin/import/importer.rb +82 -0
- data/lib/decidim/admin/import/importer_factory.rb +17 -0
- data/lib/decidim/admin/import/readers.rb +39 -0
- data/lib/decidim/admin/import/readers/base.rb +31 -0
- data/lib/decidim/admin/import/readers/csv.rb +23 -0
- data/lib/decidim/admin/import/readers/json.rb +25 -0
- data/lib/decidim/admin/import/readers/xls.rb +25 -0
- data/lib/decidim/admin/test/commands/create_attachment_collection_examples.rb +6 -6
- data/lib/decidim/admin/test/commands/create_category_examples.rb +6 -6
- data/lib/decidim/admin/test/filterable_examples.rb +1 -8
- data/lib/decidim/admin/test/manage_moderations_examples.rb +49 -4
- data/lib/decidim/admin/version.rb +1 -1
- metadata +78 -19
@@ -0,0 +1,57 @@
|
|
1
|
+
<%= decidim_form_for(@form, url: component_imports_path, class: "form grid-container") do |form| %>
|
2
|
+
<div class="card">
|
3
|
+
<div class="card-divider">
|
4
|
+
<h2 class="card-title flex--sbc">
|
5
|
+
<div class="flex--cc flex-gap--1">
|
6
|
+
<div id="js-other-actions-wrapper">
|
7
|
+
<%= link_to t(".actions.back"), manage_component_path(@current_component), class: "button hollow tiny button--simple" %>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
</h2>
|
11
|
+
</div>
|
12
|
+
<div class="card-section">
|
13
|
+
<div class="row column">
|
14
|
+
<%=
|
15
|
+
form.select :creator,
|
16
|
+
@form.creators.map { |m| [t("decidim.admin.imports.creators.#{m[:name]}"), m[:creator]] },
|
17
|
+
{ prompt: true }
|
18
|
+
%>
|
19
|
+
</div>
|
20
|
+
<% if current_organization.user_groups_enabled? && Decidim::UserGroups::ManageableUserGroups.for(current_user).verified.any? %>
|
21
|
+
<div class="field">
|
22
|
+
<%=
|
23
|
+
form.select(
|
24
|
+
:user_group_id,
|
25
|
+
user_groups.map { |g| [g.name, g.id] },
|
26
|
+
include_blank: current_user.name
|
27
|
+
)
|
28
|
+
%>
|
29
|
+
</div>
|
30
|
+
<% end %>
|
31
|
+
<div class="grid-x">
|
32
|
+
<div class="cell">
|
33
|
+
<fieldset>
|
34
|
+
<legend>
|
35
|
+
<%= t(".file_legend", valid_mime_types: mime_types).html_safe %>
|
36
|
+
<div class="creator-guidances">
|
37
|
+
<% @form.creators.each do |creator| %>
|
38
|
+
<%= content_tag :div, class: "guidance creator-#{creator[:name]}" do %>
|
39
|
+
<% t("decidim.admin.imports.help.#{creator[:name]}") %>
|
40
|
+
<% end %>
|
41
|
+
<% end %>
|
42
|
+
</div>
|
43
|
+
</legend>
|
44
|
+
<div class="row column">
|
45
|
+
<%= form.upload :file, optional: false, help_i18n_scope: "decidim.admin.forms.file_help.import" %>
|
46
|
+
</div>
|
47
|
+
</fieldset>
|
48
|
+
</div>
|
49
|
+
</div>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
<div class="grid-x align-center mt-sm">
|
53
|
+
<%= form.submit t(".import") %>
|
54
|
+
</div>
|
55
|
+
<% end -%>
|
56
|
+
|
57
|
+
<%= javascript_include_tag "decidim/admin/import_guidance" %>
|
@@ -0,0 +1,78 @@
|
|
1
|
+
<div class="card">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title">
|
4
|
+
<%= t(".title") %>
|
5
|
+
</h2>
|
6
|
+
|
7
|
+
<h2 class="card-title">
|
8
|
+
<div class="inline-block" style="float: right; text-align: right">
|
9
|
+
<table>
|
10
|
+
<tbody>
|
11
|
+
<tr>
|
12
|
+
<td>
|
13
|
+
<%= link_to moderated_users_path(blocked: false), class: "btn btn-small" do %>
|
14
|
+
<%= t("decidim.admin.moderated_users.tabs.unblocked") %>
|
15
|
+
<% end %>
|
16
|
+
</td>
|
17
|
+
<td>|</td>
|
18
|
+
<td>
|
19
|
+
<%= link_to moderated_users_path(blocked: true), class: "btn btn-small" do %>
|
20
|
+
<%= t("decidim.admin.moderated_users.tabs.blocked") %>
|
21
|
+
<% end %>
|
22
|
+
</td>
|
23
|
+
</tr>
|
24
|
+
</tbody>
|
25
|
+
</table>
|
26
|
+
</div>
|
27
|
+
</h2>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<div class="card-section">
|
31
|
+
<div class="table-scroll">
|
32
|
+
<table class="table-list">
|
33
|
+
<thead>
|
34
|
+
<tr>
|
35
|
+
<th><%= t(".name") %></th>
|
36
|
+
<th><%= t(".nickname") %></th>
|
37
|
+
<th><%= t(".reason") %></th>
|
38
|
+
<th><%= sort_link(query, :report_count, t(".reports"), default_order: :desc) %></th>
|
39
|
+
<th class="actions"><%= t(".actions.title") %></th>
|
40
|
+
</tr>
|
41
|
+
</thead>
|
42
|
+
<tbody>
|
43
|
+
<% @moderated_users.each do |moderation| %>
|
44
|
+
<tr data-id="<%= moderation.id %>">
|
45
|
+
<% if moderation.user.nickname.present? %>
|
46
|
+
<td><%= link_to moderation.user.name, decidim.profile_path(moderation.user.nickname) %></td>
|
47
|
+
<td><%= link_to moderation.user.nickname, decidim.profile_path(moderation.user.nickname) %></td>
|
48
|
+
<% else %>
|
49
|
+
<td><%= moderation.user.name %></td>
|
50
|
+
<td><%= moderation.user.nickname %></td>
|
51
|
+
<% end %>
|
52
|
+
<td> <%#= moderation.reason %>
|
53
|
+
<% reports = moderation.reports.map { |report| render "report", report: report } %>
|
54
|
+
<%= safe_join(reports, ",") %>
|
55
|
+
</td>
|
56
|
+
<td>
|
57
|
+
<%= moderation.report_count %>
|
58
|
+
</td>
|
59
|
+
|
60
|
+
<td class="actions">
|
61
|
+
<% if allowed_to?(:unreport, :moderate_users) %>
|
62
|
+
<%= icon_link_to "action-undo", ignore_moderated_user_path(id: moderation), t(".actions.unreport"), class: "action-icon--unreport", method: :put %>
|
63
|
+
<% end %>
|
64
|
+
<% if allowed_to?(:block, :moderate_users) %>
|
65
|
+
<% if moderation.user.blocked? %>
|
66
|
+
<%= icon_link_to "ban", user_block_path(user_id: moderation.user.id), t(".actions.unblock"), class: "action-icon action-icon--disabled", method: :delete %>
|
67
|
+
<% else %>
|
68
|
+
<%= icon_link_to "ban", new_user_block_path(user_id: moderation.user.id), t(".actions.block"), class: "action-icon action-icon" %>
|
69
|
+
<% end %>
|
70
|
+
<% end %>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
<% end %>
|
74
|
+
</tbody>
|
75
|
+
</table>
|
76
|
+
</div>
|
77
|
+
</div>
|
78
|
+
</div>
|
@@ -10,16 +10,21 @@
|
|
10
10
|
</div>
|
11
11
|
</h2>
|
12
12
|
</div>
|
13
|
-
|
13
|
+
<%= admin_filter_selector(:moderations) %>
|
14
14
|
<div class="card-section">
|
15
15
|
<div class="table-scroll">
|
16
16
|
<table class="table-list">
|
17
17
|
<thead>
|
18
18
|
<tr>
|
19
|
-
<th><%= t("models.moderation.fields.
|
19
|
+
<th><%= t("models.moderation.fields.reportable_id", scope: "decidim.moderations") %></th>
|
20
|
+
<th><%= t("models.moderation.fields.reportable_type", scope: "decidim.moderations") %></th>
|
21
|
+
<% if !respond_to?(:current_participatory_space) %>
|
22
|
+
<th><%= t("models.moderation.fields.participatory_space", scope: "decidim.moderations") %></th>
|
23
|
+
<% end %>
|
24
|
+
<th><%= sort_link(query, :report_count, t("models.moderation.fields.report_count", scope: "decidim.moderations")) %></th>
|
20
25
|
<th><%= t("models.moderation.fields.reported_content_url", scope: "decidim.moderations") %></th>
|
21
26
|
<th><%= t("models.moderation.fields.reports", scope: "decidim.moderations") %></th>
|
22
|
-
<th><%= t("models.moderation.fields.
|
27
|
+
<th><%= sort_link(query, :created_at, t("models.moderation.fields.created_at", scope: "decidim.moderations")) %></th>
|
23
28
|
<% if params[:hidden] %>
|
24
29
|
<th><%= t("models.moderation.fields.hidden_at", scope: "decidim.moderations") %></th>
|
25
30
|
<% end %>
|
@@ -29,12 +34,21 @@
|
|
29
34
|
<tbody>
|
30
35
|
<% moderations.each do |moderation| %>
|
31
36
|
<tr data-id="<%= moderation.id %>">
|
37
|
+
<td><%= moderation.reportable.id %></td>
|
32
38
|
<td>
|
33
39
|
<%= moderation.reportable.class.name.demodulize %>
|
34
40
|
</td>
|
41
|
+
<% if !respond_to?(:current_participatory_space) %>
|
42
|
+
<td>
|
43
|
+
<%= participatory_space_title_for(moderation.reportable) %>
|
44
|
+
</td>
|
45
|
+
<% end %>
|
46
|
+
<td>
|
47
|
+
<%= moderation.report_count %>
|
48
|
+
</td>
|
35
49
|
<td>
|
36
50
|
<%=
|
37
|
-
link_to t("models.moderation.fields.visit_url", scope: "decidim.moderations"), moderation.reportable.reported_content_url
|
51
|
+
link_to t("models.moderation.fields.visit_url", scope: "decidim.moderations"), moderation.reportable.reported_content_url, data: { tooltip: true }, aria: { haspopup: true }, title: strip_tags(reported_content_excerpt_for(moderation.reportable, limit: 250))
|
38
52
|
%>
|
39
53
|
</td>
|
40
54
|
<td>
|
@@ -42,7 +56,7 @@
|
|
42
56
|
<%= safe_join(reports, ",") %>
|
43
57
|
</td>
|
44
58
|
<td>
|
45
|
-
<%= moderation.
|
59
|
+
<%= l(moderation.created_at, format: :long) %>
|
46
60
|
</td>
|
47
61
|
<% if params[:hidden] %>
|
48
62
|
<td>
|
@@ -50,22 +64,25 @@
|
|
50
64
|
</td>
|
51
65
|
<% end %>
|
52
66
|
<td class="actions">
|
53
|
-
|
54
|
-
|
67
|
+
<%= icon_link_to "fullscreen-enter",
|
68
|
+
moderation_reports_path(moderation_id: moderation),
|
69
|
+
t("actions.expand", scope: "decidim.moderations"),
|
70
|
+
class: "action-icon--expand" %>
|
71
|
+
<% if !moderation.reportable.hidden? && allowed_to?(:unreport, permission_resource) %>
|
55
72
|
<%= icon_link_to "action-undo",
|
56
73
|
unreport_moderation_path(id: moderation),
|
57
74
|
t("actions.unreport", scope: "decidim.moderations"),
|
58
75
|
class: "action-icon--unreport",
|
59
76
|
method: :put %>
|
60
77
|
<% end %>
|
61
|
-
<% if !moderation.reportable.hidden? && allowed_to?(:hide,
|
78
|
+
<% if !moderation.reportable.hidden? && allowed_to?(:hide, permission_resource) %>
|
62
79
|
<%= icon_link_to "eye",
|
63
80
|
hide_moderation_path(id: moderation),
|
64
81
|
t("actions.hide", scope: "decidim.moderations"),
|
65
82
|
class: "action-icon--hide",
|
66
83
|
method: :put %>
|
67
84
|
<% end %>
|
68
|
-
<% if moderation.reportable.hidden? && allowed_to?(:unhide,
|
85
|
+
<% if moderation.reportable.hidden? && allowed_to?(:unhide, permission_resource) %>
|
69
86
|
<%= icon_link_to "eye",
|
70
87
|
unhide_moderation_path(id: moderation),
|
71
88
|
t("actions.unhide", scope: "decidim.moderations"),
|
@@ -77,6 +94,7 @@
|
|
77
94
|
<% end %>
|
78
95
|
</tbody>
|
79
96
|
</table>
|
97
|
+
<%= paginate moderations, theme: "decidim" %>
|
80
98
|
</div>
|
81
99
|
</div>
|
82
100
|
</div>
|
@@ -0,0 +1,102 @@
|
|
1
|
+
<div class="card">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title">
|
4
|
+
<%= link_to "#{t("title", scope: "decidim.admin.moderations.index")} > ", moderations_path %>
|
5
|
+
<%= t(".title") %>
|
6
|
+
</h2>
|
7
|
+
</div>
|
8
|
+
<div class="card-section moderation-details">
|
9
|
+
<div class="callout warning">
|
10
|
+
<%= icon "info" %>
|
11
|
+
<span class="callout-text"><%= t(".callout_html", icon: icon("flag")) %></span>
|
12
|
+
</div>
|
13
|
+
<dl>
|
14
|
+
<dt><%= t("models.moderation.fields.reported_content_url", scope: "decidim.moderations") %></dt>
|
15
|
+
<dd><%= link_to moderation.reportable.reported_content_url, moderation.reportable.reported_content_url, target: "_blank" %></dd>
|
16
|
+
|
17
|
+
<dt><%= t("models.moderation.fields.reportable_id", scope: "decidim.moderations") %></dt>
|
18
|
+
<dd><%= moderation.reportable.id %></dd>
|
19
|
+
|
20
|
+
<% if translatable_resource?(moderation.reportable) %>
|
21
|
+
<dt><%= t(".content_original_language") %></dt>
|
22
|
+
<dd><%= locale_name moderation.reportable.content_original_language %> </dd>
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
<dt>
|
26
|
+
<%= t(".reported_content") %>
|
27
|
+
<% if translatable_resource?(moderation.reportable) %>
|
28
|
+
<button
|
29
|
+
class="toggle-content"
|
30
|
+
data-see-original-button-label="<%= t(".see_original") %>"
|
31
|
+
data-see-current-button-label="<%= t(".see_current") %>">
|
32
|
+
<%= t(".see_original") %>
|
33
|
+
</button>
|
34
|
+
<% end %>
|
35
|
+
</dt>
|
36
|
+
<dd class="reported-content">
|
37
|
+
<div class="current">
|
38
|
+
<%= reported_content_for moderation.reportable %>
|
39
|
+
</div>
|
40
|
+
<% if translatable_resource?(moderation.reportable) %>
|
41
|
+
<div class="original">
|
42
|
+
<%= reported_content_for moderation.reportable, locale: moderation.reportable.content_original_language %>
|
43
|
+
</div>
|
44
|
+
<% end %>
|
45
|
+
</dd>
|
46
|
+
|
47
|
+
<dt><%= t(".author") %></dt>
|
48
|
+
<dd>
|
49
|
+
<%= reportable_author_name(moderation.reportable) %>
|
50
|
+
</dd>
|
51
|
+
|
52
|
+
<dt><%= t("models.moderation.fields.reportable_type", scope: "decidim.moderations") %></dt>
|
53
|
+
<dd><%= moderation.reportable.class.name.demodulize %></dd>
|
54
|
+
|
55
|
+
<dt><%= t("models.moderation.fields.created_at", scope: "decidim.moderations") %></dt>
|
56
|
+
<dd><%= l(moderation.created_at, format: :long) %></dd>
|
57
|
+
|
58
|
+
<dt><%= t(".participatory_space") %></dt>
|
59
|
+
<dd><%= translated_attribute moderation.participatory_space.title %></dd>
|
60
|
+
</div>
|
61
|
+
</dl>
|
62
|
+
<div class="table-scroll">
|
63
|
+
<table class="table-list">
|
64
|
+
<thead>
|
65
|
+
<tr>
|
66
|
+
<th><%= t("models.report.fields.reason", scope: "decidim.moderations") %></th>
|
67
|
+
<th><%= t("models.report.fields.locale", scope: "decidim.moderations") %></th>
|
68
|
+
<th><%= t("models.report.fields.details", scope: "decidim.moderations") %></th>
|
69
|
+
<th class="actions"><%= t("actions.title", scope: "decidim.moderations") %></th>
|
70
|
+
</tr>
|
71
|
+
</thead>
|
72
|
+
<tbody>
|
73
|
+
<% reports.each do |report| %>
|
74
|
+
<tr data-id="<%= report.id %>">
|
75
|
+
<td><%= t("decidim.admin.moderations.report.reasons.#{report.reason}") %></td>
|
76
|
+
<td><%= report.locale.present? ? locale_name(report.locale) : "" %></td>
|
77
|
+
<td><%= report.details&.truncate(250) %></td>
|
78
|
+
<td class="actions">
|
79
|
+
<%= icon_link_to "fullscreen-enter",
|
80
|
+
moderation_report_path(moderation_id: moderation, id: report.id),
|
81
|
+
t("actions.expand", scope: "decidim.moderations"),
|
82
|
+
class: "action-icon--expand" %>
|
83
|
+
</td>
|
84
|
+
</tr>
|
85
|
+
<% end %>
|
86
|
+
</tbody>
|
87
|
+
</table>
|
88
|
+
</div>
|
89
|
+
</div>
|
90
|
+
</div>
|
91
|
+
|
92
|
+
<div class="button--double form-general-submit">
|
93
|
+
<% if !moderation.reportable.hidden? && allowed_to?(:unreport, permission_resource) %>
|
94
|
+
<%= link_to t("actions.unreport", scope: "decidim.moderations"), unreport_moderation_path(id: moderation), method: :put, class: "button" %>
|
95
|
+
<% end %>
|
96
|
+
<% if !moderation.reportable.hidden? && allowed_to?(:hide, permission_resource) %>
|
97
|
+
<%= link_to t("actions.hide", scope: "decidim.moderations"), hide_moderation_path(id: moderation), method: :put, class: "button alert" %>
|
98
|
+
<% end %>
|
99
|
+
<% if moderation.reportable.hidden? && allowed_to?(:unhide, permission_resource) %>
|
100
|
+
<%= link_to t("actions.unhide", scope: "decidim.moderations"), unhide_moderation_path(id: moderation), method: :put, class: "button alert" %>
|
101
|
+
<% end %>
|
102
|
+
</div>
|
@@ -0,0 +1,62 @@
|
|
1
|
+
<div class="card">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title">
|
4
|
+
<%= link_to "#{t("title", scope: "decidim.admin.moderations.index")} > ", moderations_path %>
|
5
|
+
<%= link_to "#{t("title", scope: "decidim.admin.moderations.reports.index")} > ", moderation_reports_path %>
|
6
|
+
<%= t(".title") %>
|
7
|
+
</h2>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="card-section moderation-details">
|
11
|
+
<dl>
|
12
|
+
<dt><%= t(".report_language") %></dt>
|
13
|
+
<dd><%= locale_name @report.locale %></dd>
|
14
|
+
|
15
|
+
<% if translatable_resource?(moderation.reportable) %>
|
16
|
+
<dt><%= t("content_original_language", scope: "decidim.admin.moderations.reports.index") %></dt>
|
17
|
+
<dd><%= locale_name moderation.reportable.content_original_language %> </dd>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
<dt>
|
21
|
+
<%= t("reported_content", scope: "decidim.admin.moderations.reports.index") %>
|
22
|
+
<% if translatable_resource?(moderation.reportable) %>
|
23
|
+
<button
|
24
|
+
class="toggle-content"
|
25
|
+
data-see-original-button-label="<%= t("see_original", scope: "decidim.admin.moderations.reports.index") %>"
|
26
|
+
data-see-current-button-label="<%= t("see_current", scope: "decidim.admin.moderations.reports.index") %>">
|
27
|
+
<%= t("see_original", scope: "decidim.admin.moderations.reports.index") %>
|
28
|
+
</button>
|
29
|
+
<% end %>
|
30
|
+
</dt>
|
31
|
+
<dd class="reported-content">
|
32
|
+
<div class="current">
|
33
|
+
<%= reported_content_for moderation.reportable, locale: @report.locale %>
|
34
|
+
</div>
|
35
|
+
<% if translatable_resource?(moderation.reportable) %>
|
36
|
+
<div class="original">
|
37
|
+
<%= reported_content_for moderation.reportable, locale: moderation.reportable.content_original_language %>
|
38
|
+
</div>
|
39
|
+
<% end %>
|
40
|
+
</dd>
|
41
|
+
|
42
|
+
<dt><%= t(".report_reason") %></dt>
|
43
|
+
<dd><%= t("decidim.admin.moderations.report.reasons.#{@report.reason}") %></dd>
|
44
|
+
|
45
|
+
<dt><%= t(".report_details") %></dt>
|
46
|
+
<dd><%= @report.details %>
|
47
|
+
</div>
|
48
|
+
</dl>
|
49
|
+
</div>
|
50
|
+
</div>
|
51
|
+
|
52
|
+
<div class="button--double form-general-submit">
|
53
|
+
<% if !moderation.reportable.hidden? && allowed_to?(:unreport, permission_resource) %>
|
54
|
+
<%= link_to t("actions.unreport", scope: "decidim.moderations"), unreport_moderation_path(id: moderation), method: :put, class: "button" %>
|
55
|
+
<% end %>
|
56
|
+
<% if !moderation.reportable.hidden? && allowed_to?(:hide, permission_resource) %>
|
57
|
+
<%= link_to t("actions.hide", scope: "decidim.moderations"), hide_moderation_path(id: moderation), method: :put, class: "button alert" %>
|
58
|
+
<% end %>
|
59
|
+
<% if moderation.reportable.hidden? && allowed_to?(:unhide, permission_resource) %>
|
60
|
+
<%= link_to t("actions.unhide", scope: "decidim.moderations"), unhide_moderation_path(id: moderation), method: :put, class: "button alert" %>
|
61
|
+
<% end %>
|
62
|
+
</div>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<strong class="subscribed_title"><%= t("newsletters.index.subscribed_count", scope: "decidim.admin") %></strong>
|
9
9
|
<span class="subscribed_count"><%= recipients_count_query %></span>
|
10
10
|
<% if allowed_to? :create, :newsletter %>
|
11
|
-
<%= link_to t("actions.
|
11
|
+
<%= link_to t("actions.newsletter.new", scope: "decidim.admin"), ["newsletter_templates"], class: "button tiny button--title new" %>
|
12
12
|
<% end %>
|
13
13
|
</div>
|
14
14
|
</div>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<h2 class="card-title"><%= t ".title" %></h2>
|
6
6
|
</div>
|
7
7
|
<div class="card-section">
|
8
|
-
<%= cell("decidim/announcement",
|
8
|
+
<%= cell("decidim/announcement", newsletter_attention_callout_announcement, callout_class: "warning") %>
|
9
9
|
|
10
10
|
<div class="card">
|
11
11
|
<div class="card-divider">
|
@@ -61,7 +61,7 @@
|
|
61
61
|
</div>
|
62
62
|
<% end %>
|
63
63
|
|
64
|
-
<%= cell("decidim/announcement",
|
64
|
+
<%= cell("decidim/announcement", newsletter_recipients_count_callout_announcement, callout_class: "warning") %>
|
65
65
|
|
66
66
|
<div class="button--double form-general-submit">
|
67
67
|
<% if allowed_to?(:update, :newsletter, newsletter: @newsletter) && !@newsletter.sent? %>
|