decidim-admin 0.23.3 → 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.

Files changed (173) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/decidim_admin_manifest.js +1 -0
  3. data/app/assets/javascripts/decidim/admin/application.js.es6 +2 -0
  4. data/app/assets/javascripts/decidim/admin/budget_rule_toggler.component.js.es6 +23 -20
  5. data/app/assets/javascripts/decidim/admin/bundle.js +10 -17
  6. data/app/assets/javascripts/decidim/admin/bundle.js.map +1 -1
  7. data/app/assets/javascripts/decidim/admin/form.js.es6 +1 -0
  8. data/app/assets/javascripts/decidim/admin/import_guidance.js.es6 +29 -0
  9. data/app/assets/javascripts/decidim/admin/moderations.js.es6 +24 -0
  10. data/app/assets/javascripts/decidim/admin/proposal_infinite_edit.js.es6 +20 -0
  11. data/app/assets/javascripts/decidim/admin/subform_multi_toggler.component.js.es6 +2 -2
  12. data/app/assets/javascripts/decidim/admin/subform_toggler.component.js.es6 +2 -2
  13. data/app/assets/javascripts/decidim/admin/user_moderations.js +2 -0
  14. data/app/assets/stylesheets/decidim/admin/_variables.scss +9 -0
  15. data/app/assets/stylesheets/decidim/admin/components/_dropdown-menu.scss +3 -0
  16. data/app/assets/stylesheets/decidim/admin/extra/_action-icon.scss +13 -0
  17. data/app/assets/stylesheets/decidim/admin/extra/_block_user.scss +5 -0
  18. data/app/assets/stylesheets/decidim/admin/extra/_title_bar.scss +1 -0
  19. data/app/assets/stylesheets/decidim/admin/modules/_moderations.scss +39 -0
  20. data/app/assets/stylesheets/decidim/admin/modules/_modules.scss +2 -0
  21. data/app/assets/stylesheets/decidim/admin/modules/_reveal.scss +5 -0
  22. data/app/assets/stylesheets/decidim/admin/modules/_secondary-nav.scss +6 -3
  23. data/app/assets/stylesheets/decidim/admin/modules/_user-login.scss +2 -2
  24. data/app/assets/stylesheets/decidim/admin/user_moderations.scss +3 -0
  25. data/app/assets/stylesheets/decidim/admin/utils/_settings.scss +1 -0
  26. data/app/cells/decidim/admin/content_block/show.erb +1 -1
  27. data/app/cells/decidim/admin/content_block_cell.rb +4 -0
  28. data/app/commands/decidim/admin/block_user.rb +70 -0
  29. data/app/commands/decidim/admin/create_import.rb +29 -0
  30. data/app/commands/decidim/admin/create_participatory_space_admin_user_actions.rb +98 -0
  31. data/app/commands/decidim/admin/create_participatory_space_private_user.rb +1 -1
  32. data/app/commands/decidim/admin/create_static_page.rb +2 -1
  33. data/app/commands/decidim/admin/hide_resource.rb +21 -0
  34. data/app/commands/decidim/admin/impersonate_user.rb +17 -1
  35. data/app/commands/decidim/admin/promote_managed_user.rb +10 -0
  36. data/app/commands/decidim/admin/reorder_content_blocks.rb +6 -3
  37. data/app/commands/decidim/admin/transfer_user.rb +78 -0
  38. data/app/commands/decidim/admin/unblock_user.rb +48 -0
  39. data/app/commands/decidim/admin/unreport_user.rb +46 -0
  40. data/app/commands/decidim/admin/update_organization_appearance.rb +12 -4
  41. data/app/commands/decidim/admin/update_static_page.rb +2 -1
  42. data/app/commands/decidim/admin/verify_user_group.rb +1 -1
  43. data/app/controllers/concerns/decidim/admin/filterable.rb +1 -1
  44. data/app/controllers/concerns/decidim/admin/global_moderation_context.rb +51 -0
  45. data/app/controllers/concerns/decidim/admin/landing_page.rb +105 -0
  46. data/app/controllers/concerns/decidim/admin/landing_page_content_blocks.rb +118 -0
  47. data/app/controllers/concerns/decidim/moderations/admin/filterable.rb +54 -0
  48. data/app/controllers/decidim/admin/block_user_controller.rb +60 -0
  49. data/app/controllers/decidim/admin/components/base_controller.rb +1 -0
  50. data/app/controllers/decidim/admin/conflicts_controller.rb +46 -0
  51. data/app/controllers/decidim/admin/exports_controller.rb +1 -2
  52. data/app/controllers/decidim/admin/global_moderations/reports_controller.rb +18 -0
  53. data/app/controllers/decidim/admin/global_moderations_controller.rb +32 -0
  54. data/app/controllers/decidim/admin/impersonations_controller.rb +1 -1
  55. data/app/controllers/decidim/admin/imports_controller.rb +52 -0
  56. data/app/controllers/decidim/admin/moderated_users_controller.rb +44 -0
  57. data/app/controllers/decidim/admin/moderations/reports_controller.rb +39 -0
  58. data/app/controllers/decidim/admin/moderations_controller.rb +31 -7
  59. data/app/controllers/decidim/admin/officializations_controller.rb +3 -3
  60. data/app/controllers/decidim/admin/organization_homepage_controller.rb +6 -2
  61. data/app/controllers/decidim/admin/static_pages_controller.rb +7 -0
  62. data/app/events/decidim/resource_hidden_event.rb +37 -0
  63. data/app/forms/decidim/admin/block_user_form.rb +25 -0
  64. data/app/forms/decidim/admin/import_form.rb +85 -0
  65. data/app/forms/decidim/admin/organization_appearance_form.rb +1 -2
  66. data/app/forms/decidim/admin/static_page_form.rb +6 -1
  67. data/app/forms/decidim/admin/transfer_user_form.rb +19 -0
  68. data/app/helpers/decidim/admin/application_helper.rb +5 -4
  69. data/app/helpers/decidim/admin/exports_helper.rb +2 -2
  70. data/app/helpers/decidim/admin/filterable_helper.rb +3 -2
  71. data/app/helpers/decidim/admin/imports_helper.rb +43 -0
  72. data/app/helpers/decidim/admin/menu_helper.rb +10 -0
  73. data/app/helpers/decidim/admin/moderations/reports_helper.rb +40 -0
  74. data/app/helpers/decidim/admin/moderations_helper.rb +36 -0
  75. data/app/helpers/decidim/admin/newsletters_helper.rb +4 -10
  76. data/app/helpers/decidim/admin/settings_helper.rb +2 -1
  77. data/app/helpers/decidim/admin/sidebar_menu_helper.rb +13 -0
  78. data/app/helpers/decidim/admin/user_moderations_helper.rb +6 -0
  79. data/app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb +1 -1
  80. data/app/jobs/decidim/admin/verify_user_group_from_csv_job.rb +1 -1
  81. data/app/permissions/decidim/admin/permissions.rb +7 -6
  82. data/app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb +1 -1
  83. data/app/presenters/decidim/admin/secondary_menu_presenter.rb +26 -0
  84. data/app/queries/decidim/admin/active_users_counter.rb +1 -2
  85. data/app/queries/decidim/admin/user_filter.rb +1 -2
  86. data/app/views/decidim/admin/attachment_collections/index.html.erb +1 -1
  87. data/app/views/decidim/admin/attachments/index.html.erb +1 -1
  88. data/app/views/decidim/admin/block_user/new.html.erb +22 -0
  89. data/app/views/decidim/admin/categories/index.html.erb +1 -1
  90. data/app/views/decidim/admin/components/_component.html.erb +12 -0
  91. data/app/views/decidim/admin/conflicts/edit.html.erb +46 -0
  92. data/app/views/decidim/admin/conflicts/index.html.erb +34 -0
  93. data/app/views/decidim/admin/dashboard/show.html.erb +1 -0
  94. data/app/views/decidim/admin/exports/_dropdown.html.erb +1 -1
  95. data/app/views/decidim/admin/imports/_dropdown.html.erb +9 -0
  96. data/app/views/decidim/admin/imports/new.html.erb +57 -0
  97. data/app/views/decidim/admin/moderated_users/_report.html.erb +10 -0
  98. data/app/views/decidim/admin/moderated_users/index.html.erb +78 -0
  99. data/app/views/decidim/admin/moderations/_report.html.erb +1 -1
  100. data/app/views/decidim/admin/moderations/index.html.erb +27 -9
  101. data/app/views/decidim/admin/moderations/reports/index.html.erb +102 -0
  102. data/app/views/decidim/admin/moderations/reports/show.html.erb +62 -0
  103. data/app/views/decidim/admin/newsletters/index.html.erb +1 -1
  104. data/app/views/decidim/admin/newsletters/select_recipients_to_deliver.html.erb +2 -2
  105. data/app/views/decidim/admin/officializations/index.html.erb +13 -4
  106. data/app/views/decidim/admin/organization_appearance/_form.html.erb +0 -4
  107. data/app/views/decidim/admin/organization_appearance/form/_colors.html.erb +1 -1
  108. data/app/views/decidim/admin/organization_appearance/form/_images.html.erb +4 -4
  109. data/app/views/decidim/admin/participatory_space_private_users/index.html.erb +1 -1
  110. data/app/views/decidim/admin/shared/landing_page/edit.html.erb +47 -0
  111. data/app/views/decidim/admin/shared/landing_page_content_blocks/edit.html.erb +15 -0
  112. data/app/views/decidim/admin/static_pages/_form.html.erb +6 -0
  113. data/app/views/decidim/admin/users/index.html.erb +1 -1
  114. data/app/views/layouts/decidim/admin/_application.html.erb +5 -1
  115. data/app/views/layouts/decidim/admin/_title_bar.html.erb +2 -2
  116. data/app/views/layouts/decidim/admin/global_moderations.html.erb +7 -0
  117. data/app/views/layouts/decidim/admin/newsletters.erb +1 -1
  118. data/app/views/layouts/decidim/admin/settings.html.erb +2 -33
  119. data/app/views/layouts/decidim/admin/users.html.erb +11 -0
  120. data/config/locales/ar.yml +0 -5
  121. data/config/locales/bg.yml +0 -1
  122. data/config/locales/ca.yml +33 -7
  123. data/config/locales/cs.yml +150 -5
  124. data/config/locales/de.yml +150 -5
  125. data/config/locales/el.yml +55 -5
  126. data/config/locales/en.yml +150 -5
  127. data/config/locales/es-MX.yml +42 -7
  128. data/config/locales/es-PY.yml +42 -7
  129. data/config/locales/es.yml +42 -7
  130. data/config/locales/eu.yml +0 -3
  131. data/config/locales/fi-plain.yml +148 -3
  132. data/config/locales/fi.yml +148 -3
  133. data/config/locales/fr-CA.yml +139 -4
  134. data/config/locales/fr.yml +139 -4
  135. data/config/locales/gl.yml +83 -5
  136. data/config/locales/hu.yml +13 -5
  137. data/config/locales/id-ID.yml +0 -3
  138. data/config/locales/is-IS.yml +19 -3
  139. data/config/locales/it.yml +59 -5
  140. data/config/locales/ja.yml +38 -5
  141. data/config/locales/lv.yml +0 -5
  142. data/config/locales/nl.yml +117 -4
  143. data/config/locales/no.yml +11 -5
  144. data/config/locales/pl.yml +157 -11
  145. data/config/locales/pt-BR.yml +0 -3
  146. data/config/locales/pt.yml +0 -5
  147. data/config/locales/ro-RO.yml +8 -5
  148. data/config/locales/ru.yml +0 -3
  149. data/config/locales/sk.yml +0 -5
  150. data/config/locales/sl.yml +0 -1
  151. data/config/locales/sr-CS.yml +0 -3
  152. data/config/locales/sv.yml +50 -4
  153. data/config/locales/tr-TR.yml +81 -4
  154. data/config/locales/uk.yml +0 -3
  155. data/config/locales/zh-CN.yml +0 -5
  156. data/config/routes.rb +21 -1
  157. data/lib/decidim/admin.rb +6 -0
  158. data/lib/decidim/admin/engine.rb +76 -1
  159. data/lib/decidim/admin/import.rb +12 -0
  160. data/lib/decidim/admin/import/creator.rb +82 -0
  161. data/lib/decidim/admin/import/importer.rb +82 -0
  162. data/lib/decidim/admin/import/importer_factory.rb +17 -0
  163. data/lib/decidim/admin/import/readers.rb +39 -0
  164. data/lib/decidim/admin/import/readers/base.rb +31 -0
  165. data/lib/decidim/admin/import/readers/csv.rb +23 -0
  166. data/lib/decidim/admin/import/readers/json.rb +25 -0
  167. data/lib/decidim/admin/import/readers/xls.rb +25 -0
  168. data/lib/decidim/admin/test/commands/create_attachment_collection_examples.rb +6 -6
  169. data/lib/decidim/admin/test/commands/create_category_examples.rb +6 -6
  170. data/lib/decidim/admin/test/filterable_examples.rb +1 -8
  171. data/lib/decidim/admin/test/manage_moderations_examples.rb +49 -4
  172. data/lib/decidim/admin/version.rb +1 -1
  173. metadata +73 -16
@@ -131,23 +131,17 @@ module Decidim
131
131
  ]
132
132
  end
133
133
 
134
- def newsletter_attention_callout_args
134
+ def newsletter_attention_callout_announcement
135
135
  {
136
- announcement: {
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 newsletter_recipients_count_callout_args
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
- announcement: {
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
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim::Admin
4
+ module UserModerationsHelper
5
+ end
6
+ 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
@@ -14,7 +14,7 @@ module Decidim
14
14
  return if email.blank?
15
15
  return unless user_group
16
16
 
17
- Decidim::Admin::VerifyUserGroup.call(user_group, verifier, true)
17
+ Decidim::Admin::VerifyUserGroup.call(user_group, verifier, via_csv: true)
18
18
  end
19
19
 
20
20
  private
@@ -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
- return allow!
88
+ allow!
86
89
  when :read, :update, :destroy
87
- return toggle_allow(user == newsletter.author)
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 = query.where(admin: admin)
27
- query
26
+ query.where(admin: admin)
28
27
  end
29
28
 
30
29
  private
@@ -36,8 +36,7 @@ module Decidim
36
36
  def query
37
37
  users = scope
38
38
  users = filter_by_search(users)
39
- users = filter_by_state(users)
40
- users
39
+ filter_by_state(users)
41
40
  end
42
41
 
43
42
  private
@@ -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.new", scope: "decidim.admin", name: t("models.attachment_collection.name", scope: "decidim.admin")), url_for(action: :new), class: "button tiny button--title new" %>
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.new", scope: "decidim.admin", name: t("models.attachment.name", scope: "decidim.admin")), url_for(action: :new), class: "button tiny button--title new" %>
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.new", scope: "decidim.admin", name: t("models.category.name", scope: "decidim.admin")), new_category_path(current_participatory_space), class: "button tiny button--title new" %>
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>
@@ -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" %>
@@ -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 %>
@@ -0,0 +1,9 @@
1
+ <span class="imports dropdown tiny button button--simple" data-toggle="import-dropdown"><%= t "actions.import", scope: "decidim.admin" %></span>
2
+ <div class="dropdown-pane" id="import-dropdown" data-dropdown data-position=bottom data-alignment=right data-auto-focus="true" data-close-on-click="true">
3
+ <ul class="vertical menu add-components">
4
+ <%= block if defined?(block) %>
5
+ <li class="imports--file imports--<%= component.manifest.name %>">
6
+ <%= link_to t("decidim.admin.imports.import_from_file"), admin_imports_path(component, resource_id: resource_id) %>
7
+ </li>
8
+ </ul>
9
+ </div>
@@ -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" %>