decidim-admin 0.23.3 → 0.24.1
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 +4 -1
- 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/_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 +47 -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/static_page_form.rb +6 -1
- data/app/forms/decidim/admin/transfer_user_form.rb +19 -0
- data/app/helpers/decidim/admin/admin_terms_helper.rb +0 -7
- 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/user_filter.rb +1 -2
- data/app/views/decidim/admin/admin_terms/show.html.erb +1 -1
- 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/components/_form.html.erb +1 -1
- 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 +2 -1
- 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 +28 -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/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 +6 -1
- data/app/views/layouts/decidim/admin/_js_configuration.html.erb +26 -0
- 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 -5
- data/config/locales/bg.yml +0 -1
- data/config/locales/ca.yml +150 -4
- data/config/locales/cs.yml +155 -9
- data/config/locales/de.yml +150 -5
- data/config/locales/el.yml +55 -5
- data/config/locales/en.yml +151 -5
- data/config/locales/es-MX.yml +148 -3
- data/config/locales/es-PY.yml +148 -3
- data/config/locales/es.yml +148 -3
- data/config/locales/eu.yml +0 -3
- data/config/locales/fi-plain.yml +149 -3
- data/config/locales/fi.yml +149 -3
- data/config/locales/fr-CA.yml +139 -4
- data/config/locales/fr.yml +139 -4
- data/config/locales/gl.yml +127 -5
- data/config/locales/hu.yml +13 -5
- data/config/locales/id-ID.yml +0 -3
- data/config/locales/is-IS.yml +19 -3
- data/config/locales/it.yml +59 -5
- data/config/locales/ja.yml +46 -5
- data/config/locales/lv.yml +0 -5
- data/config/locales/nl.yml +120 -4
- data/config/locales/no.yml +13 -7
- data/config/locales/pl.yml +166 -20
- data/config/locales/pt-BR.yml +0 -3
- data/config/locales/pt.yml +0 -5
- data/config/locales/ro-RO.yml +232 -120
- data/config/locales/ru.yml +0 -3
- data/config/locales/sk.yml +0 -5
- data/config/locales/sl.yml +0 -1
- data/config/locales/sr-CS.yml +0 -3
- data/config/locales/sv.yml +150 -5
- data/config/locales/tr-TR.yml +81 -4
- data/config/locales/uk.yml +0 -3
- data/config/locales/zh-CN.yml +0 -5
- 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 +68 -4
- data/lib/decidim/admin/version.rb +1 -1
- metadata +72 -15
- data/app/assets/javascripts/decidim/admin/gallery.js.es6 +0 -5
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Admin
|
5
|
+
# This module includes helpers to show moderation in admin
|
6
|
+
module ModerationsHelper
|
7
|
+
# Public: Renders an extract of the content reported in a text format.
|
8
|
+
def reported_content_excerpt_for(reportable, options = {})
|
9
|
+
I18n.with_locale(options.fetch(:locale, I18n.locale)) do
|
10
|
+
reportable_content = reportable.reported_attributes.map do |attribute_name|
|
11
|
+
attribute_value = reportable.attributes.with_indifferent_access[attribute_name]
|
12
|
+
next translated_attribute(attribute_value) if attribute_value.is_a? Hash
|
13
|
+
|
14
|
+
attribute_value
|
15
|
+
end
|
16
|
+
reportable_content.filter(&:present?).join(". ").truncate(options.fetch(:limit, 100))
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# Public: Finds the type and name of the participatory space the given
|
21
|
+
# `reportable` object is associated to.
|
22
|
+
#
|
23
|
+
# Returns a String, or `nil` if the space is not found.
|
24
|
+
def participatory_space_title_for(reportable, options = {})
|
25
|
+
space = reportable.try(:participatory_space)
|
26
|
+
return unless space
|
27
|
+
|
28
|
+
I18n.with_locale(options.fetch(:locale, I18n.locale)) do
|
29
|
+
title = translated_attribute(space.try(:title) || space.try(:name))
|
30
|
+
type = space.class.model_name.human
|
31
|
+
[type, title].compact.join(": ").truncate(options.fetch(:limit, 100))
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -131,23 +131,17 @@ module Decidim
|
|
131
131
|
]
|
132
132
|
end
|
133
133
|
|
134
|
-
def
|
134
|
+
def newsletter_attention_callout_announcement
|
135
135
|
{
|
136
|
-
|
137
|
-
body: t("warning", scope: "decidim.admin.newsletters.select_recipients_to_deliver").html_safe
|
138
|
-
},
|
139
|
-
callout_class: "warning"
|
136
|
+
body: t("warning", scope: "decidim.admin.newsletters.select_recipients_to_deliver").html_safe
|
140
137
|
}
|
141
138
|
end
|
142
139
|
|
143
|
-
def
|
140
|
+
def newsletter_recipients_count_callout_announcement
|
144
141
|
spinner = "<span id='recipients_count_spinner' class='loading-spinner hide'></span>"
|
145
142
|
body = "#{t("recipients_count", scope: "decidim.admin.newsletters.select_recipients_to_deliver", count: recipients_count_query)} #{spinner}"
|
146
143
|
{
|
147
|
-
|
148
|
-
body: body
|
149
|
-
},
|
150
|
-
callout_class: "warning"
|
144
|
+
body: body
|
151
145
|
}
|
152
146
|
end
|
153
147
|
end
|
@@ -13,7 +13,8 @@ module Decidim
|
|
13
13
|
string: :text_field,
|
14
14
|
text: :text_area,
|
15
15
|
scope: :scope_field,
|
16
|
-
enum: :collection_radio_buttons
|
16
|
+
enum: :collection_radio_buttons,
|
17
|
+
time: :datetime_field
|
17
18
|
}.freeze
|
18
19
|
|
19
20
|
# Public: Renders a form field that matches a settings attribute's
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Admin
|
5
|
+
module SidebarMenuHelper
|
6
|
+
protected
|
7
|
+
|
8
|
+
def sidebar_menu(target_menu)
|
9
|
+
::Decidim::Admin::SecondaryMenuPresenter.new(target_menu, self, active_class: "is-active")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -20,7 +20,7 @@ module Decidim
|
|
20
20
|
current_particiaptory_space: privatable_to
|
21
21
|
)
|
22
22
|
|
23
|
-
Decidim::Admin::CreateParticipatorySpacePrivateUser.call(private_user_form, current_user, privatable_to, true)
|
23
|
+
Decidim::Admin::CreateParticipatorySpacePrivateUser.call(private_user_form, current_user, privatable_to, via_csv: true)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -29,6 +29,8 @@ module Decidim
|
|
29
29
|
read_admin_dashboard_action?
|
30
30
|
apply_newsletter_permissions_for_admin!
|
31
31
|
|
32
|
+
allow! if permission_action.subject == :global_moderation
|
33
|
+
|
32
34
|
if user.admin? && admin_terms_accepted?
|
33
35
|
allow! if read_admin_log_action?
|
34
36
|
allow! if read_metrics_action?
|
@@ -47,6 +49,7 @@ module Decidim
|
|
47
49
|
allow! if permission_action.subject == :area_type
|
48
50
|
allow! if permission_action.subject == :user_group
|
49
51
|
allow! if permission_action.subject == :officialization
|
52
|
+
allow! if permission_action.subject == :moderate_users
|
50
53
|
allow! if permission_action.subject == :authorization
|
51
54
|
allow! if permission_action.subject == :authorization_workflow
|
52
55
|
allow! if permission_action.subject == :static_page_topic
|
@@ -82,9 +85,9 @@ module Decidim
|
|
82
85
|
|
83
86
|
case permission_action.action
|
84
87
|
when :index, :create
|
85
|
-
|
88
|
+
allow!
|
86
89
|
when :read, :update, :destroy
|
87
|
-
|
90
|
+
toggle_allow(user == newsletter.author)
|
88
91
|
end
|
89
92
|
end
|
90
93
|
|
@@ -174,14 +177,12 @@ module Decidim
|
|
174
177
|
return unless permission_action.action == :enter &&
|
175
178
|
permission_action.subject == :space_area
|
176
179
|
|
177
|
-
space_allows_admin_access_to_current_action?(args)
|
180
|
+
space_allows_admin_access_to_current_action?(**args)
|
178
181
|
end
|
179
182
|
|
180
183
|
def space_allows_admin_access_to_current_action?(require_admin_terms_accepted: false)
|
181
184
|
Decidim.participatory_space_manifests.any? do |manifest|
|
182
|
-
if manifest.name != :initiatives && require_admin_terms_accepted
|
183
|
-
next unless admin_terms_accepted?
|
184
|
-
end
|
185
|
+
next if manifest.name != :initiatives && require_admin_terms_accepted && !admin_terms_accepted?
|
185
186
|
|
186
187
|
new_permission_action = Decidim::PermissionAction.new(
|
187
188
|
action: permission_action.action,
|
@@ -31,7 +31,7 @@ module Decidim
|
|
31
31
|
highlight: false,
|
32
32
|
scope: "home"
|
33
33
|
).select do |registry|
|
34
|
-
%w(comments meetings accepted_proposals results).include? registry.metric_name
|
34
|
+
%w(comments meetings accepted_proposals results blocked_users user_reports reported_users).include? registry.metric_name
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Admin
|
5
|
+
class SecondaryMenuPresenter < Decidim::MenuPresenter
|
6
|
+
def render(render_options = {}, &block)
|
7
|
+
styles = %w(secondary-nav)
|
8
|
+
styles.push "secondary-nav--subnav" unless render_options.fetch(:title, false)
|
9
|
+
content_tag :div, class: styles.join(" ") do
|
10
|
+
output = []
|
11
|
+
output.push render_title(render_options) if render_options.fetch(:title, false)
|
12
|
+
output.push render_menu(&block)
|
13
|
+
safe_join(output)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
protected
|
18
|
+
|
19
|
+
def render_title(render_options)
|
20
|
+
content_tag :div, class: "secondary-nav__title" do
|
21
|
+
render_options.fetch(:title)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -23,8 +23,7 @@ module Decidim
|
|
23
23
|
|
24
24
|
query = Decidim::User.left_outer_joins(:organization).where(decidim_organizations: { id: organization.id })
|
25
25
|
query = query.where("#{Decidim::User.table_name}.current_sign_in_at >= ?", date)
|
26
|
-
query
|
27
|
-
query
|
26
|
+
query.where(admin: admin)
|
28
27
|
end
|
29
28
|
|
30
29
|
private
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= cell("decidim/announcement",
|
1
|
+
<%= cell("decidim/announcement", announcement_body, callout_class: current_user.admin_terms_accepted? ? "success" : "warning" ) %>
|
2
2
|
|
3
3
|
<article class="card">
|
4
4
|
<div class="card-section grid-x grid-margin-x">
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<h2 class='card-title'>
|
4
4
|
<%= t("attachment_collections.index.attachment_collections_title", scope: "decidim.admin") %>
|
5
5
|
<% if allowed_to? :create, :attachment_collection %>
|
6
|
-
<%= link_to t("actions.
|
6
|
+
<%= link_to t("actions.attachment_collection.new", scope: "decidim.admin"), url_for(action: :new), class: "button tiny button--title new" %>
|
7
7
|
<% end %>
|
8
8
|
</h2>
|
9
9
|
</div>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<h2 class="card-title">
|
4
4
|
<%= t(".attachments_title") %>
|
5
5
|
<% if allowed_to? :create, :attachment %>
|
6
|
-
<%= link_to t("actions.
|
6
|
+
<%= link_to t("actions.attachment.new", scope: "decidim.admin"), url_for(action: :new), class: "button tiny button--title new" %>
|
7
7
|
<% end %>
|
8
8
|
</h2>
|
9
9
|
</div>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<h2 class="process-title-summary">
|
2
|
+
<%= t(".title", name: user.name) %>
|
3
|
+
</h2>
|
4
|
+
|
5
|
+
<%= decidim_form_for(@form, html: { class: "form new_user_block" }, url: user_block_path(user_id: user.id), method: :post) do |f| %>
|
6
|
+
<div class="card">
|
7
|
+
<div class="card-section">
|
8
|
+
<div class="row column">
|
9
|
+
<%= t(".description") %>
|
10
|
+
</div>
|
11
|
+
<br>
|
12
|
+
<div class="row column">
|
13
|
+
<%= f.hidden_field :user_id %>
|
14
|
+
<%= f.text_area :justification, required: true, label: t(".justification") %>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<div class="button--double form-general-submit">
|
20
|
+
<%= f.submit t(".action") %>
|
21
|
+
</div>
|
22
|
+
<% end %>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<h2 class='card-title'>
|
4
4
|
<%= t("categories.index.categories_title", scope: "decidim.admin") %>
|
5
5
|
<% if allowed_to? :create, :category %>
|
6
|
-
<%= link_to t("actions.
|
6
|
+
<%= link_to t("actions.category.new", scope: "decidim.admin"), new_category_path(current_participatory_space), class: "button tiny button--title new" %>
|
7
7
|
<% end %>
|
8
8
|
</h2>
|
9
9
|
</div>
|
@@ -12,6 +12,8 @@
|
|
12
12
|
<td class="table-list__actions">
|
13
13
|
<% if component.manifest.admin_engine %>
|
14
14
|
<%= icon_link_to "pencil", manage_component_path(component), t("actions.manage", scope: "decidim.admin"), class: "action-icon--manage" %>
|
15
|
+
<% else %>
|
16
|
+
<span class="action-space icon"></span>
|
15
17
|
<% end %>
|
16
18
|
|
17
19
|
<% if allowed_to?(:update, :component, component: component) %>
|
@@ -20,10 +22,14 @@
|
|
20
22
|
<% else %>
|
21
23
|
<%= icon_link_to "check", url_for(action: :publish, id: component, controller: "components"), t("actions.publish", scope: "decidim.admin"), class: "action-icon--publish", method: :put %>
|
22
24
|
<% end %>
|
25
|
+
<% else %>
|
26
|
+
<span class="action-space icon"></span>
|
23
27
|
<% end %>
|
24
28
|
|
25
29
|
<% if allowed_to? :update, :component, component: component %>
|
26
30
|
<%= icon_link_to "cog", url_for(action: :edit, id: component, controller: "components"), t("actions.configure", scope: "decidim.admin"), class: "action-icon--configure" %>
|
31
|
+
<% else %>
|
32
|
+
<span class="action-space icon"></span>
|
27
33
|
<% end %>
|
28
34
|
|
29
35
|
<% if allowed_to? :update, :component, component: component %>
|
@@ -32,14 +38,20 @@
|
|
32
38
|
<% else %>
|
33
39
|
<%= icon_link_to "key", url_for(action: :edit, component_id: component, controller: "component_permissions"), t("actions.permissions", scope: "decidim.admin"), class: "action-icon--permissions" %>
|
34
40
|
<% end %>
|
41
|
+
<% else %>
|
42
|
+
<span class="action-space icon"></span>
|
35
43
|
<% end %>
|
36
44
|
|
37
45
|
<% if allowed_to? :share, :component, component: component %>
|
38
46
|
<%= icon_link_to "share", url_for(action: :share, id: component, controller: "components"), t("actions.share", scope: "decidim.admin"), class: "action-icon--share", target: "_blank" %>
|
47
|
+
<% else %>
|
48
|
+
<span class="action-space icon"></span>
|
39
49
|
<% end %>
|
40
50
|
|
41
51
|
<% if allowed_to? :destroy, :component, component: component %>
|
42
52
|
<%= icon_link_to "circle-x", url_for(action: :destroy, id: component, controller: "components"), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete %>
|
53
|
+
<% else %>
|
54
|
+
<span class="action-space icon"></span>
|
43
55
|
<% end %>
|
44
56
|
</td>
|
45
57
|
</tr>
|
@@ -78,7 +78,7 @@
|
|
78
78
|
</fieldset>
|
79
79
|
<% end %>
|
80
80
|
|
81
|
-
<%
|
81
|
+
<% if component && component.persisted? && !component.published? %>
|
82
82
|
<%= render partial: "decidim/admin/share_tokens/share_tokens", locals: { share_tokens: form.object.share_tokens } %>
|
83
83
|
<% end %>
|
84
84
|
</div>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<div class="card">
|
2
|
+
<div class="card-divider">
|
3
|
+
<div class="card-title">Transfer User</div>
|
4
|
+
</div>
|
5
|
+
<div class="card-section">
|
6
|
+
<div class="table-scroll">
|
7
|
+
<table class="table-list">
|
8
|
+
<thead>
|
9
|
+
<tr>
|
10
|
+
<th></th>
|
11
|
+
<th><%= t("user_name", scope: "decidim.admin.conflicts") %></th>
|
12
|
+
<th><%= t("managed_user_name", scope: "decidim.admin.conflicts") %></th>
|
13
|
+
</tr>
|
14
|
+
</thead>
|
15
|
+
<tbody>
|
16
|
+
<tr>
|
17
|
+
<td><%= t("name", scope: "decidim.admin.conflicts.transfer") %></td>
|
18
|
+
<td><%= @form.conflict.current_user.name %></td>
|
19
|
+
<td><%= @form.conflict.managed_user.name %></td>
|
20
|
+
</tr>
|
21
|
+
<tr>
|
22
|
+
<td><%= t("email", scope: "decidim.admin.conflicts.transfer") %></td>
|
23
|
+
<td><%= @form.conflict.current_user.email %></td>
|
24
|
+
<td><%= @form.conflict.managed_user.email.present? ? @form.conflict.managed_user.email : "-" %></td>
|
25
|
+
</tr>
|
26
|
+
</tbody>
|
27
|
+
</table>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<%= decidim_form_for(@form, url: conflict_path, method: :put, html: { class: "form" }) do |f| %>
|
33
|
+
<div class="card">
|
34
|
+
<div class="card-section">
|
35
|
+
<div class="row column">
|
36
|
+
<%= f.text_field :reason, label: t("reason", scope: "decidim.admin.conflicts.transfer") %>
|
37
|
+
|
38
|
+
<%= f.text_field :email, label: t("email", scope: "decidim.admin.conflicts.transfer") %>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div class="button--double form-general-submit">
|
44
|
+
<%= f.submit t("title", scope: "decidim.admin.conflicts.transfer") %>
|
45
|
+
</div>
|
46
|
+
<% end %>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<div class="card">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title">
|
4
|
+
<%= t("title", scope: "decidim.admin.conflicts") %>
|
5
|
+
</h2>
|
6
|
+
</div>
|
7
|
+
<div class="card-section">
|
8
|
+
<div class="table-scroll">
|
9
|
+
<table class="table-list">
|
10
|
+
<thead>
|
11
|
+
<tr>
|
12
|
+
<th><%= t("user_name", scope: "decidim.admin.conflicts") %></th>
|
13
|
+
<th><%= t("managed_user_name", scope: "decidim.admin.conflicts") %></th>
|
14
|
+
<th><%= t("attempts", scope: "decidim.admin.conflicts") %></th>
|
15
|
+
<th><%= t("solved", scope: "decidim.admin.conflicts") %></th>
|
16
|
+
<th class="table-list__actions"><%= t("title", scope: "decidim.admin.conflicts.transfer") %></h1>
|
17
|
+
|
18
|
+
</tr>
|
19
|
+
</thead>
|
20
|
+
<tbody>
|
21
|
+
<% @conflicts.each do |conflict| %>
|
22
|
+
<tr>
|
23
|
+
<td><%= conflict.current_user.name %></td>
|
24
|
+
<td><%= conflict.managed_user.name %></td>
|
25
|
+
<td><%= conflict.times %></td>
|
26
|
+
<td><%= t(conflict.solved, scope: "decidim.admin.conflicts") %></td>
|
27
|
+
<td><%= icon_link_to "transfer", decidim_admin.edit_conflict_path(conflict), t("title", scope: "decidim.admin.conflicts.transfer") %></td>
|
28
|
+
</tr>
|
29
|
+
<% end %>
|
30
|
+
</tbody>
|
31
|
+
</table>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
</div>
|
@@ -1,3 +1,4 @@
|
|
1
|
+
<% add_decidim_page_title(t("decidim.admin.titles.dashboard")) %>
|
1
2
|
|
2
3
|
<h2 class="card-title">
|
3
4
|
<%= t "decidim.admin.titles.dashboard" %>
|
@@ -7,7 +8,7 @@
|
|
7
8
|
<p><%= t ".welcome" %></p>
|
8
9
|
|
9
10
|
<% unless current_user.admin_terms_accepted? %>
|
10
|
-
<%= cell("decidim/announcement",
|
11
|
+
<%= cell("decidim/announcement", announcement_body, callout_class: current_user.admin_terms_accepted? ? "success" : "warning" ) %>
|
11
12
|
<% end %>
|
12
13
|
|
13
14
|
<div class="grid-x grid-margin-x">
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<% manifest.formats.each do |format| %>
|
6
6
|
<li class="exports--format--<%= format.downcase %> exports--<%= manifest.name %>">
|
7
7
|
<%= link_to t("decidim.admin.exports.export_as", name: t("decidim.#{component.manifest.name}.admin.exports.#{manifest.name}"), export_format: t("decidim.admin.exports.formats.#{format}")),
|
8
|
-
exports_path(component, id: manifest.name, format: format),
|
8
|
+
exports_path(component, id: manifest.name, format: format, resource_id: resource_id),
|
9
9
|
method: :post %>
|
10
10
|
</li>
|
11
11
|
<% end %>
|