decidim-admin 0.21.0 → 0.23.2

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 (197) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/decidim/admin/application.js.es6 +7 -0
  3. data/app/assets/javascripts/decidim/admin/budget_rule_toggler.component.js.es6 +52 -0
  4. data/app/assets/javascripts/decidim/admin/bundle.js +26 -32
  5. data/app/assets/javascripts/decidim/admin/bundle.js.map +1 -1
  6. data/app/assets/javascripts/decidim/admin/choose_language.js +12 -0
  7. data/app/assets/javascripts/decidim/admin/dynamic_fields.component.js.es6 +24 -5
  8. data/app/assets/javascripts/decidim/admin/form.js.es6 +24 -10
  9. data/app/assets/javascripts/decidim/admin/gallery.js.es6 +5 -0
  10. data/app/assets/javascripts/decidim/admin/newsletters.js.es6 +4 -0
  11. data/app/assets/javascripts/decidim/admin/officializations.js.es6 +20 -0
  12. data/app/assets/javascripts/decidim/admin/scope_picker_enabler.component.js.es6 +14 -0
  13. data/app/assets/stylesheets/decidim/admin/_decidim.scss +2 -0
  14. data/app/assets/stylesheets/decidim/admin/_variables.scss +1 -1
  15. data/app/assets/stylesheets/decidim/admin/extra/_newsletter-templates-gallery.scss +3 -0
  16. data/app/assets/stylesheets/decidim/admin/extra/_organization-appearance.scss +141 -0
  17. data/app/assets/stylesheets/decidim/admin/extra/_show_email.scss +31 -0
  18. data/app/assets/stylesheets/decidim/admin/extra/_title_bar.scss +4 -0
  19. data/app/assets/stylesheets/decidim/admin/modules/_buttons.scss +11 -1
  20. data/app/assets/stylesheets/decidim/admin/modules/_callouts.scss +11 -0
  21. data/app/assets/stylesheets/decidim/admin/modules/_cards.scss +2 -2
  22. data/app/assets/stylesheets/decidim/admin/modules/_filters.scss +2 -2
  23. data/app/assets/stylesheets/decidim/admin/modules/_forms.scss +16 -2
  24. data/app/assets/stylesheets/decidim/admin/modules/_import_result.scss +10 -0
  25. data/app/assets/stylesheets/decidim/admin/modules/_loading-spinner.scss +19 -0
  26. data/app/assets/stylesheets/decidim/admin/modules/_main-nav.scss +0 -1
  27. data/app/assets/stylesheets/decidim/admin/modules/_modules.scss +5 -1
  28. data/app/assets/stylesheets/decidim/admin/modules/_process-header.scss +0 -1
  29. data/app/assets/stylesheets/decidim/admin/modules/_secondary-nav.scss +0 -1
  30. data/app/assets/stylesheets/decidim/admin/modules/_table-list.scss +0 -5
  31. data/app/assets/stylesheets/decidim/admin/modules/_tabs.scss +7 -0
  32. data/app/assets/stylesheets/decidim/admin/modules/_users_statistics.scss +18 -0
  33. data/app/assets/stylesheets/decidim/admin/utils/_mixins.scss +42 -0
  34. data/app/assets/stylesheets/decidim/admin/utils/_settings.scss +4 -1
  35. data/app/cells/decidim/admin/content_block/show.erb +2 -2
  36. data/app/commands/decidim/admin/create_attachment.rb +2 -2
  37. data/app/commands/decidim/admin/create_newsletter.rb +34 -9
  38. data/app/commands/decidim/admin/destroy_share_token.rb +46 -0
  39. data/app/commands/decidim/admin/reorder_content_blocks.rb +1 -1
  40. data/app/commands/decidim/admin/update_component.rb +27 -3
  41. data/app/commands/decidim/admin/update_content_block.rb +25 -1
  42. data/app/commands/decidim/admin/update_newsletter.rb +31 -9
  43. data/app/commands/decidim/admin/update_organization.rb +11 -0
  44. data/app/commands/decidim/admin/update_organization_appearance.rb +3 -1
  45. data/app/controllers/concerns/decidim/admin/participatory_space_export.rb +8 -2
  46. data/app/controllers/decidim/admin/application_controller.rb +1 -0
  47. data/app/controllers/decidim/admin/authorization_workflows_controller.rb +6 -0
  48. data/app/controllers/decidim/admin/components_controller.rb +17 -6
  49. data/app/controllers/decidim/admin/dashboard_controller.rb +33 -1
  50. data/app/controllers/decidim/admin/metrics_controller.rb +22 -0
  51. data/app/controllers/decidim/admin/newsletter_templates_controller.rb +41 -0
  52. data/app/controllers/decidim/admin/newsletters_controller.rb +32 -4
  53. data/app/controllers/decidim/admin/officializations_controller.rb +8 -0
  54. data/app/controllers/decidim/admin/organization_appearance_controller.rb +1 -0
  55. data/app/controllers/decidim/admin/organization_controller.rb +4 -3
  56. data/app/controllers/decidim/admin/organization_homepage_content_blocks_controller.rb +2 -1
  57. data/app/controllers/decidim/admin/share_tokens_controller.rb +30 -0
  58. data/app/forms/decidim/admin/attachment_form.rb +3 -0
  59. data/app/forms/decidim/admin/component_form.rb +5 -22
  60. data/app/forms/decidim/admin/newsletter_form.rb +15 -3
  61. data/app/forms/decidim/admin/organization_appearance_form.rb +7 -4
  62. data/app/forms/decidim/admin/organization_form.rb +20 -0
  63. data/app/forms/decidim/admin/participatory_space_private_user_csv_import_form.rb +13 -0
  64. data/app/forms/decidim/admin/participatory_space_private_user_form.rb +3 -2
  65. data/app/forms/decidim/admin/selective_newsletter_form.rb +6 -0
  66. data/app/frontend/components/autocomplete.component.test.tsx +2 -1
  67. data/app/frontend/components/autocomplete.component.tsx +29 -0
  68. data/app/helpers/decidim/admin/application_helper.rb +1 -0
  69. data/app/helpers/decidim/admin/filterable_helper.rb +35 -27
  70. data/app/helpers/decidim/admin/icon_link_helper.rb +1 -1
  71. data/app/helpers/decidim/admin/newsletters_helper.rb +3 -1
  72. data/app/helpers/decidim/admin/resource_scope_helper.rb +43 -0
  73. data/app/helpers/decidim/admin/settings_helper.rb +52 -59
  74. data/app/helpers/decidim/admin/uploader_image_dimensions_helper.rb +30 -0
  75. data/app/models/decidim/admin/fake_newsletter.rb +49 -0
  76. data/app/permissions/decidim/admin/permissions.rb +7 -1
  77. data/app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb +57 -0
  78. data/app/queries/decidim/admin/active_users_counter.rb +35 -0
  79. data/app/queries/decidim/admin/newsletter_recipients.rb +5 -8
  80. data/app/views/decidim/admin/attachment_collections/index.html.erb +1 -1
  81. data/app/views/decidim/admin/authorization_workflows/index.html.erb +1 -0
  82. data/app/views/decidim/admin/categories/index.html.erb +1 -1
  83. data/app/views/decidim/admin/components/_component.html.erb +5 -0
  84. data/app/views/decidim/admin/components/_form.html.erb +4 -0
  85. data/app/views/decidim/admin/components/_settings_fields.html.erb +2 -2
  86. data/app/views/decidim/admin/components/index.html.erb +1 -0
  87. data/app/views/decidim/admin/dashboard/show.html.erb +35 -10
  88. data/app/views/decidim/admin/exports/_dropdown.html.erb +6 -2
  89. data/app/views/decidim/admin/impersonatable_users/index.html.erb +2 -2
  90. data/app/views/decidim/admin/metrics/_metrics.html.erb +21 -0
  91. data/app/views/decidim/admin/metrics/index.html.erb +7 -0
  92. data/app/views/decidim/admin/newsletter_templates/index.html.erb +28 -0
  93. data/app/views/decidim/admin/newsletter_templates/show.html.erb +12 -0
  94. data/app/views/decidim/admin/newsletters/_form.html.erb +1 -7
  95. data/app/views/decidim/admin/newsletters/edit.html.erb +1 -1
  96. data/app/views/decidim/admin/newsletters/index.html.erb +1 -1
  97. data/app/views/decidim/admin/newsletters/new.html.erb +1 -1
  98. data/app/views/decidim/admin/officializations/_show_email_modal.html.erb +31 -0
  99. data/app/views/decidim/admin/officializations/index.html.erb +7 -3
  100. data/app/views/decidim/admin/officializations/show_email.html.erb +2 -0
  101. data/app/views/decidim/admin/organization/_form.html.erb +21 -0
  102. data/app/views/decidim/admin/organization_appearance/_form.html.erb +2 -72
  103. data/app/views/decidim/admin/organization_appearance/form/_colors.html.erb +23 -0
  104. data/app/views/decidim/admin/organization_appearance/form/_images.html.erb +38 -0
  105. data/app/views/decidim/admin/organization_appearance/form/_minimap.html.erb +46 -0
  106. data/app/views/decidim/admin/resource_permissions/_options_form.html.erb +1 -1
  107. data/app/views/decidim/admin/share_tokens/_share_tokens.html.erb +57 -0
  108. data/app/views/decidim/admin/shared/_filters.html.erb +3 -3
  109. data/app/views/decidim/admin/shared/_gallery.html.erb +21 -0
  110. data/app/views/decidim/admin/static_pages/_form.html.erb +1 -1
  111. data/app/views/decidim/admin/user_groups/index.html.erb +4 -4
  112. data/app/views/decidim/admin/users_statistics/_users_count.html.erb +39 -0
  113. data/app/views/layouts/decidim/admin/_application.html.erb +1 -0
  114. data/app/views/layouts/decidim/admin/_header.html.erb +3 -0
  115. data/app/views/layouts/decidim/admin/_title_bar.html.erb +20 -10
  116. data/app/views/layouts/decidim/admin/newsletters.erb +1 -1
  117. data/config/locales/am-ET.yml +1 -0
  118. data/config/locales/ar.yml +12 -45
  119. data/config/locales/bg-BG.yml +16 -0
  120. data/config/locales/bg.yml +131 -0
  121. data/config/locales/ca.yml +84 -46
  122. data/config/locales/cs.yml +175 -137
  123. data/config/locales/da-DK.yml +1 -0
  124. data/config/locales/da.yml +1 -0
  125. data/config/locales/de.yml +150 -56
  126. data/config/locales/el.yml +814 -0
  127. data/config/locales/en.yml +84 -46
  128. data/config/locales/eo-UY.yml +0 -1
  129. data/config/locales/eo.yml +51 -0
  130. data/config/locales/es-MX.yml +84 -46
  131. data/config/locales/es-PY.yml +84 -46
  132. data/config/locales/es.yml +84 -46
  133. data/config/locales/et-EE.yml +1 -0
  134. data/config/locales/et.yml +1 -0
  135. data/config/locales/eu.yml +30 -59
  136. data/config/locales/fi-plain.yml +84 -46
  137. data/config/locales/fi.yml +98 -60
  138. data/config/locales/fr-CA.yml +847 -0
  139. data/config/locales/fr.yml +126 -51
  140. data/config/locales/ga-IE.yml +1 -0
  141. data/config/locales/gl.yml +156 -42
  142. data/config/locales/hr-HR.yml +1 -0
  143. data/config/locales/hr.yml +1 -0
  144. data/config/locales/hu.yml +55 -46
  145. data/config/locales/id-ID.yml +12 -41
  146. data/config/locales/is-IS.yml +10 -42
  147. data/config/locales/is.yml +568 -0
  148. data/config/locales/it.yml +106 -85
  149. data/config/locales/ja-JP.yml +855 -0
  150. data/config/locales/ja.yml +847 -0
  151. data/config/locales/ko-KR.yml +1 -0
  152. data/config/locales/ko.yml +1 -0
  153. data/config/locales/lt-LT.yml +1 -0
  154. data/config/locales/lt.yml +1 -0
  155. data/config/locales/lv.yml +795 -0
  156. data/config/locales/mt-MT.yml +1 -0
  157. data/config/locales/mt.yml +1 -0
  158. data/config/locales/nl.yml +74 -46
  159. data/config/locales/no.yml +108 -83
  160. data/config/locales/om-ET.yml +1 -0
  161. data/config/locales/pl.yml +354 -233
  162. data/config/locales/pt-BR.yml +13 -42
  163. data/config/locales/pt.yml +321 -231
  164. data/config/locales/ro-RO.yml +810 -0
  165. data/config/locales/ru.yml +11 -44
  166. data/config/locales/si-LK.yml +1 -0
  167. data/config/locales/sk-SK.yml +823 -0
  168. data/config/locales/sk.yml +802 -0
  169. data/config/locales/sl.yml +162 -0
  170. data/config/locales/so-SO.yml +1 -0
  171. data/config/locales/sr-CS.yml +586 -0
  172. data/config/locales/sv.yml +134 -54
  173. data/config/locales/sw-KE.yml +1 -0
  174. data/config/locales/ti-ER.yml +1 -0
  175. data/config/locales/tr-TR.yml +139 -50
  176. data/config/locales/uk.yml +10 -42
  177. data/config/locales/vi-VN.yml +1 -0
  178. data/config/locales/vi.yml +1 -0
  179. data/config/locales/zh-CN.yml +845 -0
  180. data/config/locales/zh-TW.yml +1 -0
  181. data/config/routes.rb +14 -3
  182. data/lib/decidim/admin/engine.rb +12 -9
  183. data/lib/decidim/admin/form_builder.rb +2 -2
  184. data/lib/decidim/admin/test/manage_attachment_collections_examples.rb +1 -1
  185. data/lib/decidim/admin/test/manage_component_permissions_examples.rb +15 -15
  186. data/lib/decidim/admin/version.rb +1 -1
  187. metadata +85 -33
  188. data/app/commands/decidim/admin/create_oauth_application.rb +0 -36
  189. data/app/commands/decidim/admin/destroy_oauth_application.rb +0 -39
  190. data/app/commands/decidim/admin/update_oauth_application.rb +0 -39
  191. data/app/controllers/decidim/admin/oauth_applications_controller.rb +0 -90
  192. data/app/forms/decidim/admin/oauth_application_form.rb +0 -32
  193. data/app/views/decidim/admin/oauth_applications/_form.html.erb +0 -19
  194. data/app/views/decidim/admin/oauth_applications/edit.html.erb +0 -13
  195. data/app/views/decidim/admin/oauth_applications/index.html.erb +0 -40
  196. data/app/views/decidim/admin/oauth_applications/new.html.erb +0 -13
  197. data/app/views/decidim/admin/oauth_applications/show.html.erb +0 -27
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Admin
5
+ class DashboardMetricChartsPresenter < Decidim::MetricChartsPresenter
6
+ attribute :summary, Boolean
7
+
8
+ def render_not_highlighted(metrics)
9
+ safe_join(
10
+ metrics.map do |metric|
11
+ render_metrics_data(metric.metric_name, klass: not_highlighted_classes, graph_klass: "small")
12
+ end
13
+ )
14
+ end
15
+
16
+ def highlighted_metrics
17
+ return super unless summary?
18
+
19
+ Decidim.metrics_registry.filtered(
20
+ highlight: true,
21
+ scope: "home"
22
+ ).select do |registry|
23
+ %w(users proposals).include? registry.metric_name
24
+ end
25
+ end
26
+
27
+ def not_highlighted_metrics
28
+ return super unless summary?
29
+
30
+ Decidim.metrics_registry.filtered(
31
+ highlight: false,
32
+ scope: "home"
33
+ ).select do |registry|
34
+ %w(comments meetings accepted_proposals results).include? registry.metric_name
35
+ end
36
+ end
37
+
38
+ private
39
+
40
+ def highlighted_classes
41
+ return "cell medium-6" if summary?
42
+
43
+ "cell medium-4"
44
+ end
45
+
46
+ def not_highlighted_classes
47
+ return "cell medium-3" if summary?
48
+
49
+ "cell medium-2"
50
+ end
51
+
52
+ def not_highlighted_wrapper_classes
53
+ "grid-x grid-margin-x"
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Admin
5
+ # Counts active users making a distinction between whether they are admins or participants
6
+ class ActiveUsersCounter < Rectify::Query
7
+ # Initializes the class.
8
+ #
9
+ # @param organization [Organization] Current organization
10
+ # @param date [Date] Period time to make users count check
11
+ # @param admin [boolean] Possible values : t for Admin or f for participant
12
+ def initialize(organization:, date:, admin: false)
13
+ @organization = organization
14
+ @date = date
15
+ @admin = admin
16
+ end
17
+
18
+ # Count the user's number who have logged in since given date
19
+ #
20
+ # Returns an ActiveRecord::Relation
21
+ def query
22
+ return Decidim::User.none unless organization && date
23
+
24
+ query = Decidim::User.left_outer_joins(:organization).where(decidim_organizations: { id: organization.id })
25
+ query = query.where("#{Decidim::User.table_name}.current_sign_in_at >= ?", date)
26
+ query = query.where(admin: admin)
27
+ query
28
+ end
29
+
30
+ private
31
+
32
+ attr_reader :organization, :date, :admin
33
+ end
34
+ end
35
+ end
@@ -46,7 +46,7 @@ module Decidim
46
46
  def spaces
47
47
  return if @form.participatory_space_types.blank?
48
48
 
49
- @form.participatory_space_types.map do |type|
49
+ @spaces ||= @form.participatory_space_types.map do |type|
50
50
  next if type.ids.blank?
51
51
 
52
52
  object_class = "Decidim::#{type.manifest_name.classify}"
@@ -75,20 +75,17 @@ module Decidim
75
75
 
76
76
  participant_ids = []
77
77
  spaces.each do |space|
78
+ next unless defined? space.component_ids
79
+
78
80
  available_components = Decidim.component_manifests.map { |m| m.name.to_s if m.newsletter_participant_entities.present? }.compact
79
81
  Decidim::Component.where(id: space.component_ids, manifest_name: available_components).published.each do |component|
80
82
  Decidim.find_component_manifest(component.manifest_name).try(&:newsletter_participant_entities).flatten.each do |object|
81
83
  klass = Object.const_get(object)
82
- participant_ids << klass.newsletter_participant_ids(component)
84
+ participant_ids |= klass.newsletter_participant_ids(component)
83
85
  end
84
86
  end
85
- next unless defined?(Decidim::Comments)
86
-
87
- Decidim::Comments.newsletter_participant_entities.flatten.each do |object|
88
- klass = Object.const_get(object)
89
- participant_ids << klass.newsletter_participant_ids(space)
90
- end
91
87
  end
88
+
92
89
  participant_ids.flatten.compact.uniq
93
90
  end
94
91
  end
@@ -34,7 +34,7 @@
34
34
  <%= icon_link_to "circle-x", polymorphic_path([collection_for, attachment_collection]), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
35
35
  <% else %>
36
36
  <span class="action-icon" title="<%= t("attachment_collections.index.attachment_collection_used", scope: "decidim.admin") %>" data-tooltip="true" data-disable-hover="false">
37
- <%= icon "circle-x", class: "action-icon action-icon--disabled" %>
37
+ <%= icon "circle-x", class: "action-icon action-icon--disabled", role: "img" %>
38
38
  </span>
39
39
  <% end %>
40
40
  <% end %>
@@ -1,4 +1,5 @@
1
1
  <div class="card">
2
+ <%= cell("decidim/verifications/revocations", @authorizations) %>
2
3
  <div class="card-divider">
3
4
  <h2 class="card-title">
4
5
  <%= t("decidim.admin.titles.authorization_workflows") %>
@@ -34,7 +34,7 @@
34
34
  <%= icon_link_to "circle-x", category_path(current_participatory_space, category), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
35
35
  <% else %>
36
36
  <span class="action-icon" title="<%= t("categories.index.category_used", scope: "decidim.admin") %>" data-tooltip="true" data-disable-hover="false">
37
- <%= icon "circle-x", class: "action-icon action-icon--disabled" %>
37
+ <%= icon "circle-x", class: "action-icon action-icon--disabled", role: "img" %>
38
38
  </span>
39
39
  <% end %>
40
40
  <% end %>
@@ -8,6 +8,7 @@
8
8
  <td>
9
9
  <%= t "decidim.components.#{component.manifest.name}.name" %>
10
10
  </td>
11
+ <%= td_resource_scope_for(component.scope) %>
11
12
  <td class="table-list__actions">
12
13
  <% if component.manifest.admin_engine %>
13
14
  <%= icon_link_to "pencil", manage_component_path(component), t("actions.manage", scope: "decidim.admin"), class: "action-icon--manage" %>
@@ -33,6 +34,10 @@
33
34
  <% end %>
34
35
  <% end %>
35
36
 
37
+ <% if allowed_to? :share, :component, component: component %>
38
+ <%= icon_link_to "share", url_for(action: :share, id: component, controller: "components"), t("actions.share", scope: "decidim.admin"), class: "action-icon--share", target: "_blank" %>
39
+ <% end %>
40
+
36
41
  <% if allowed_to? :destroy, :component, component: component %>
37
42
  <%= 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 %>
38
43
  <% end %>
@@ -77,6 +77,10 @@
77
77
  </div>
78
78
  </fieldset>
79
79
  <% end %>
80
+
81
+ <% unless component.published? %>
82
+ <%= render partial: "decidim/admin/share_tokens/share_tokens", locals: { share_tokens: form.object.share_tokens } %>
83
+ <% end %>
80
84
  </div>
81
85
  </div>
82
86
  </div>
@@ -3,8 +3,8 @@
3
3
  form,
4
4
  settings_attribute,
5
5
  field_name,
6
- label: t("decidim.components.#{manifest.name}.settings.#{settings_name}.#{field_name}"),
6
+ "decidim.components.#{manifest.name}.settings.#{settings_name}",
7
7
  tabs_prefix: tabs_prefix,
8
- help_text: help_text_for_component_setting(field_name, settings_name, manifest.name)
8
+ readonly: settings_attribute.readonly?(component: @component)
9
9
  ) %>
10
10
  <% end %>
@@ -21,6 +21,7 @@
21
21
  <thead>
22
22
  <th><%= t(".headers.name") %></th>
23
23
  <th><%= t(".headers.type") %></th>
24
+ <%= th_resource_scope_label(t(".headers.scope")) %>
24
25
  <th><%= t(".headers.actions") %></th>
25
26
  </thead>
26
27
 
@@ -10,16 +10,41 @@
10
10
  <%= cell("decidim/announcement", admin_terms_announcement_args ) %>
11
11
  <% end %>
12
12
 
13
- <% if allowed_to? :read, :admin_log %>
14
- <div class="row">
15
- <h3 class="card-title">
16
- </h3>
17
- <%= render partial: "decidim/admin/logs/logs_list", locals: { logs: latest_action_logs } %>
18
- <% if latest_action_logs.any? %>
19
- <div class="text-center"><%= link_to t(".view_more_logs"), logs_path %></div>
20
- <% end %>
21
- </div>
22
- <% end %>
13
+ <div class="grid-x grid-margin-x">
14
+ <% if current_user.admin? && current_user.organization&.id == current_organization.id %>
15
+ <div class="cell small-12 medium-6 large-4">
16
+ <%= render(
17
+ partial: "decidim/admin/users_statistics/users_count",
18
+ locals: {
19
+ result: users_counter
20
+ }
21
+ ) %>
22
+ </div>
23
+ <% end %>
24
+ </div>
25
+
26
+ <div class="grid-x grid-margin-x">
27
+ <% if allowed_to? :read, :metrics %>
28
+ <div class="cell small-6">
29
+ <%= render(
30
+ partial: "decidim/admin/metrics/metrics",
31
+ locals: {
32
+ metrics_presenter: metrics_presenter,
33
+ show_link_to_more: true
34
+ }
35
+ ) %>
36
+ </div>
37
+ <% end %>
38
+
39
+ <% if allowed_to? :read, :admin_log %>
40
+ <div class="cell small-6">
41
+ <%= render partial: "decidim/admin/logs/logs_list", locals: { logs: latest_action_logs } %>
42
+ <% if latest_action_logs.any? %>
43
+ <div class="text-center"><%= link_to t(".view_more_logs"), logs_path %></div>
44
+ <% end %>
45
+ </div>
46
+ <% end %>
47
+ </div>
23
48
 
24
49
  <% if current_user.admin_terms_accepted? %>
25
50
  <p class="text-right">
@@ -2,8 +2,12 @@
2
2
  <div class="dropdown-pane" id="export-dropdown" data-dropdown data-position=bottom data-alignment=right data-auto-focus="true" data-close-on-click="true">
3
3
  <ul class="vertical menu add-components">
4
4
  <% component.manifest.export_manifests.each do |manifest| %>
5
- <% %w{CSV JSON Excel}.each do |format| %>
6
- <li class="exports--format--<%= format.downcase %> exports--<%= manifest.name %>"><%= link_to t("decidim.admin.exports.export_as", name: t("decidim.#{component.manifest.name}.admin.exports.#{manifest.name}"), export_format: format.upcase), exports_path(component, id: manifest.name, format: format), method: :post %></li>
5
+ <% manifest.formats.each do |format| %>
6
+ <li class="exports--format--<%= format.downcase %> exports--<%= manifest.name %>">
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),
9
+ method: :post %>
10
+ </li>
7
11
  <% end %>
8
12
  <% end %>
9
13
  </ul>
@@ -33,8 +33,8 @@
33
33
  <%= search_field_tag :q, @query,label: false, class: "input-group-field", placeholder: t(".search") %>
34
34
  <%= hidden_field_tag :state, @state %>
35
35
  <div class="input-group-button">
36
- <button type="submit" class="button button--muted">
37
- <%= icon "magnifying-glass", aria_label: t(".search") %>
36
+ <button type="submit" class="button">
37
+ <%= icon "magnifying-glass", aria_label: t(".search"), role: "img" %>
38
38
  </button>
39
39
  </div>
40
40
  </div>
@@ -0,0 +1,21 @@
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title">
4
+ <%= t "decidim.admin.titles.metrics" %>
5
+ </h2>
6
+ </div>
7
+
8
+ <div class="grid-y grid-padding-y">
9
+ <div class="cell grid-x grid-padding-x">
10
+ <%= metrics_presenter.highlighted %>
11
+ </div>
12
+
13
+ <div class="cell grid-x grid-padding-x">
14
+ <%= metrics_presenter.not_highlighted %>
15
+ </div>
16
+ </div>
17
+ </div>
18
+
19
+ <% if show_link_to_more %>
20
+ <div class="text-center"><%= link_to t(".see_more_metrics"), metrics_path %></div>
21
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%= render(
2
+ partial: "decidim/admin/metrics/metrics",
3
+ locals: {
4
+ metrics_presenter: metrics_presenter,
5
+ show_link_to_more: false
6
+ }
7
+ ) %>
@@ -0,0 +1,28 @@
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title">
4
+ <%= t ".title" %>
5
+ </h2>
6
+ </div>
7
+
8
+ <div class="card-section">
9
+ <div class="grid-x grid-margin-x card-grid">
10
+ <% templates.each do |newsletter_template| %>
11
+ <div class="cell small-6">
12
+ <div class="card card--mini" id="<%= newsletter_template.name %>">
13
+ <iframe src="<%= preview_newsletter_template_path(newsletter_template.name) %>" class="email-preview newsletter-template-preview">
14
+ </iframe>
15
+
16
+ <div class="card-footer">
17
+ <h2 class="card-title">
18
+ <%= t newsletter_template.public_name_key %>
19
+ <%= link_to(t(".preview_template"), newsletter_template_path(newsletter_template.name), class: "button tiny button--title") %>
20
+ <%= link_to(t(".use_template"), new_newsletter_template_newsletter_path(newsletter_template.name), class: "button tiny button--title") %>
21
+ </h2>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ <% end %>
26
+ </div>
27
+ </div>
28
+ </div>
@@ -0,0 +1,12 @@
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title"><%= t ".preview", template_name: t(template_manifest.public_name_key) %></h2>
4
+ </div>
5
+ <div class="card-section">
6
+ <iframe src="<%= preview_newsletter_template_path(template_manifest.name) %>" class="email-preview">
7
+ </iframe>
8
+ </div>
9
+ </div>
10
+ <div class="button--double form-general-submit">
11
+ <%= link_to(t(".use_template"), new_newsletter_template_newsletter_path(template_manifest.name), class: "button") %>
12
+ </div>
@@ -2,10 +2,4 @@
2
2
  <%= form.translated :text_field, :subject %>
3
3
  </div>
4
4
 
5
- <div class="row column">
6
- <%= form.translated :editor, :body, toolbar: "basic-no-video" %>
7
- </div>
8
-
9
- <div class="row column">
10
- <%= t(".interpolations_hint") %>
11
- </div>
5
+ <%= cell content_block.settings_form_cell, form, content_block: content_block %>
@@ -1,4 +1,4 @@
1
- <%= decidim_form_for(@form, html: { class: "form edit_newsletter" }) do |f| %>
1
+ <%= decidim_form_for(@form, html: { class: "form edit_newsletter" }, url: newsletter_path(newsletter)) do |f| %>
2
2
  <div class="card">
3
3
  <div class="card-divider">
4
4
  <h2 class="card-title"><%= t ".title" %></h2>
@@ -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.new", scope: "decidim.admin", name: t("models.newsletter.name", scope: "decidim.admin").downcase), ["new", "newsletter"], class: "button tiny button--title new" %>
11
+ <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.newsletter.name", scope: "decidim.admin").downcase), ["newsletter_templates"], class: "button tiny button--title new" %>
12
12
  <% end %>
13
13
  </div>
14
14
  </div>
@@ -1,4 +1,4 @@
1
- <%= decidim_form_for(@form, html: { class: "form new_newsletter" }) do |f| %>
1
+ <%= decidim_form_for(@form, html: { class: "form new_newsletter" }, url: newsletter_template_newsletters_path(newsletter_template_id: params[:newsletter_template_id])) do |f| %>
2
2
  <div class="card">
3
3
  <div class="card-divider">
4
4
  <h2 class="card-title"><%= t ".title" %></h2>
@@ -0,0 +1,31 @@
1
+ <div class="reveal" id="show-email-modal" data-reveal>
2
+ <div class="reveal__header">
3
+ <h3 class="reveal__title"><%= t(".title") %></h3>
4
+ <button class="close-button" data-close aria-label="<%= t(".close_modal") %>"
5
+ type="button">
6
+ <span aria-hidden="true">&times;</span>
7
+ </button>
8
+ </div>
9
+
10
+ <div class="row">
11
+ <div class="columns medium-4 medium-centered">
12
+ <p><%= t(".description") %></p>
13
+
14
+ <div class="show_email">
15
+ <h4><%= t(".full_name") %></h4>
16
+ <div><p id="user_full_name"></p></div>
17
+ <h4><%= t(".email_address") %></h4>
18
+ <div>
19
+ <p id="user_email"></p>
20
+ <p><%= t(".hidden") %></p>
21
+ </div>
22
+ </div>
23
+
24
+ <div class="button--double form-general-submit">
25
+ <button class="button" data-open="user_email" data-open-url="">
26
+ <%= t(".show") %>
27
+ </button>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
@@ -31,15 +31,18 @@
31
31
  <td><%= translated_attribute(user.officialized_as) %></td>
32
32
 
33
33
  <td class="table-list__actions">
34
+ <% if allowed_to? :show_email, :user, user: user %>
35
+ <%= icon_link_to "envelope-open", show_email_officialization_path(user_id: user.id), t(".show_email"), class: "action-icon action-icon--show-email", data: { full_name: user.name, toggle: "show-email-modal" } %>
36
+ <% end %>
34
37
  <%= icon_link_to "envelope-closed", current_or_new_conversation_path_with(user), t("decidim.contact"), class:"action-icon--new" %>
35
38
  <% if user.officialized? %>
36
- <%= icon "circle-check", class: "action-icon action-icon--disabled" %>
39
+ <%= icon "circle-check", class: "action-icon action-icon--disabled", role: "img" %>
37
40
  <%= icon_link_to "pencil", new_officialization_path(user_id: user.id), t(".reofficialize"), class: "action-icon--new" %>
38
41
  <%= icon_link_to "circle-x", officialization_path(user.id), t(".unofficialize"), method: :delete, class: "action-icon--reject" %>
39
42
  <% else %>
40
43
  <%= icon_link_to "circle-check", new_officialization_path(user_id: user.id), t(".officialize"), class: "action-icon--verify" %>
41
- <%= icon "pencil", class: "action-icon action-icon--disabled" %>
42
- <%= icon "circle-x", class: "action-icon action-icon--disabled" %>
44
+ <%= icon "pencil", class: "action-icon action-icon--disabled", role: "img" %>
45
+ <%= icon "circle-x", class: "action-icon action-icon--disabled", role: "img" %>
43
46
  <% end %>
44
47
  </td>
45
48
  </tr>
@@ -50,3 +53,4 @@
50
53
  </div>
51
54
  </div>
52
55
  </div>
56
+ <%= render "show_email_modal" %>