decidim-admin 0.21.0 → 0.22.0

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 (134) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/decidim/admin/application.js.es6 +4 -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 +7 -7
  5. data/app/assets/javascripts/decidim/admin/bundle.js.map +1 -1
  6. data/app/assets/javascripts/decidim/admin/dynamic_fields.component.js.es6 +24 -5
  7. data/app/assets/javascripts/decidim/admin/form.js.es6 +23 -10
  8. data/app/assets/javascripts/decidim/admin/gallery.js.es6 +5 -0
  9. data/app/assets/javascripts/decidim/admin/officializations.js.es6 +20 -0
  10. data/app/assets/stylesheets/decidim/admin/_decidim.scss +2 -0
  11. data/app/assets/stylesheets/decidim/admin/_variables.scss +1 -1
  12. data/app/assets/stylesheets/decidim/admin/extra/_newsletter-templates-gallery.scss +3 -0
  13. data/app/assets/stylesheets/decidim/admin/extra/_organization-appearance.scss +141 -0
  14. data/app/assets/stylesheets/decidim/admin/extra/_show_email.scss +31 -0
  15. data/app/assets/stylesheets/decidim/admin/extra/_title_bar.scss +4 -0
  16. data/app/assets/stylesheets/decidim/admin/modules/_buttons.scss +10 -1
  17. data/app/assets/stylesheets/decidim/admin/modules/_cards.scss +2 -2
  18. data/app/assets/stylesheets/decidim/admin/modules/_filters.scss +2 -2
  19. data/app/assets/stylesheets/decidim/admin/modules/_forms.scss +2 -2
  20. data/app/assets/stylesheets/decidim/admin/modules/_import_result.scss +10 -0
  21. data/app/assets/stylesheets/decidim/admin/modules/_loading-spinner.scss +11 -0
  22. data/app/assets/stylesheets/decidim/admin/modules/_main-nav.scss +0 -1
  23. data/app/assets/stylesheets/decidim/admin/modules/_modules.scss +5 -1
  24. data/app/assets/stylesheets/decidim/admin/modules/_process-header.scss +0 -1
  25. data/app/assets/stylesheets/decidim/admin/modules/_secondary-nav.scss +0 -1
  26. data/app/assets/stylesheets/decidim/admin/modules/_table-list.scss +0 -5
  27. data/app/assets/stylesheets/decidim/admin/modules/_users_statistics.scss +18 -0
  28. data/app/assets/stylesheets/decidim/admin/utils/_mixins.scss +42 -0
  29. data/app/assets/stylesheets/decidim/admin/utils/_settings.scss +4 -1
  30. data/app/cells/decidim/admin/content_block/show.erb +2 -2
  31. data/app/commands/decidim/admin/create_newsletter.rb +34 -9
  32. data/app/commands/decidim/admin/reorder_content_blocks.rb +1 -1
  33. data/app/commands/decidim/admin/update_component.rb +27 -3
  34. data/app/commands/decidim/admin/update_content_block.rb +2 -1
  35. data/app/commands/decidim/admin/update_newsletter.rb +31 -9
  36. data/app/commands/decidim/admin/update_organization_appearance.rb +3 -1
  37. data/app/controllers/decidim/admin/authorization_workflows_controller.rb +6 -0
  38. data/app/controllers/decidim/admin/components_controller.rb +6 -5
  39. data/app/controllers/decidim/admin/dashboard_controller.rb +33 -1
  40. data/app/controllers/decidim/admin/metrics_controller.rb +22 -0
  41. data/app/controllers/decidim/admin/newsletter_templates_controller.rb +41 -0
  42. data/app/controllers/decidim/admin/newsletters_controller.rb +22 -4
  43. data/app/controllers/decidim/admin/officializations_controller.rb +8 -0
  44. data/app/controllers/decidim/admin/organization_appearance_controller.rb +1 -0
  45. data/app/controllers/decidim/admin/organization_controller.rb +4 -3
  46. data/app/controllers/decidim/admin/organization_homepage_content_blocks_controller.rb +1 -1
  47. data/app/forms/decidim/admin/component_form.rb +0 -23
  48. data/app/forms/decidim/admin/newsletter_form.rb +15 -3
  49. data/app/forms/decidim/admin/organization_appearance_form.rb +2 -0
  50. data/app/helpers/decidim/admin/filterable_helper.rb +35 -27
  51. data/app/helpers/decidim/admin/icon_link_helper.rb +1 -1
  52. data/app/helpers/decidim/admin/settings_helper.rb +47 -59
  53. data/app/helpers/decidim/admin/uploader_image_dimensions_helper.rb +30 -0
  54. data/app/models/decidim/admin/fake_newsletter.rb +49 -0
  55. data/app/permissions/decidim/admin/permissions.rb +6 -0
  56. data/app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb +57 -0
  57. data/app/queries/decidim/admin/active_users_counter.rb +35 -0
  58. data/app/views/decidim/admin/attachment_collections/index.html.erb +1 -1
  59. data/app/views/decidim/admin/authorization_workflows/index.html.erb +1 -0
  60. data/app/views/decidim/admin/categories/index.html.erb +1 -1
  61. data/app/views/decidim/admin/components/_settings_fields.html.erb +2 -2
  62. data/app/views/decidim/admin/dashboard/show.html.erb +35 -10
  63. data/app/views/decidim/admin/impersonatable_users/index.html.erb +2 -2
  64. data/app/views/decidim/admin/metrics/_metrics.html.erb +21 -0
  65. data/app/views/decidim/admin/metrics/index.html.erb +7 -0
  66. data/app/views/decidim/admin/newsletter_templates/index.html.erb +28 -0
  67. data/app/views/decidim/admin/newsletter_templates/show.html.erb +12 -0
  68. data/app/views/decidim/admin/newsletters/_form.html.erb +1 -7
  69. data/app/views/decidim/admin/newsletters/edit.html.erb +1 -1
  70. data/app/views/decidim/admin/newsletters/index.html.erb +1 -1
  71. data/app/views/decidim/admin/newsletters/new.html.erb +1 -1
  72. data/app/views/decidim/admin/officializations/_show_email_modal.html.erb +31 -0
  73. data/app/views/decidim/admin/officializations/index.html.erb +7 -3
  74. data/app/views/decidim/admin/officializations/show_email.html.erb +2 -0
  75. data/app/views/decidim/admin/organization_appearance/_form.html.erb +2 -72
  76. data/app/views/decidim/admin/organization_appearance/form/_colors.html.erb +23 -0
  77. data/app/views/decidim/admin/organization_appearance/form/_images.html.erb +38 -0
  78. data/app/views/decidim/admin/organization_appearance/form/_minimap.html.erb +46 -0
  79. data/app/views/decidim/admin/resource_permissions/_options_form.html.erb +1 -1
  80. data/app/views/decidim/admin/shared/_filters.html.erb +3 -3
  81. data/app/views/decidim/admin/shared/_gallery.html.erb +21 -0
  82. data/app/views/decidim/admin/user_groups/index.html.erb +4 -4
  83. data/app/views/decidim/admin/users_statistics/_users_count.html.erb +39 -0
  84. data/app/views/layouts/decidim/admin/_application.html.erb +1 -0
  85. data/app/views/layouts/decidim/admin/_header.html.erb +2 -0
  86. data/app/views/layouts/decidim/admin/_title_bar.html.erb +20 -10
  87. data/app/views/layouts/decidim/admin/newsletters.erb +1 -1
  88. data/config/locales/ar.yml +12 -6
  89. data/config/locales/bg-BG.yml +16 -0
  90. data/config/locales/ca.yml +46 -6
  91. data/config/locales/cs.yml +89 -49
  92. data/config/locales/da-DK.yml +1 -0
  93. data/config/locales/de.yml +102 -6
  94. data/config/locales/el.yml +848 -0
  95. data/config/locales/en.yml +46 -6
  96. data/config/locales/eo-UY.yml +0 -1
  97. data/config/locales/es-MX.yml +46 -6
  98. data/config/locales/es-PY.yml +46 -6
  99. data/config/locales/es.yml +46 -6
  100. data/config/locales/et-EE.yml +1 -0
  101. data/config/locales/eu.yml +12 -6
  102. data/config/locales/fi-plain.yml +46 -6
  103. data/config/locales/fi.yml +61 -21
  104. data/config/locales/fr-CA.yml +849 -0
  105. data/config/locales/fr.yml +83 -6
  106. data/config/locales/ga-IE.yml +1 -0
  107. data/config/locales/gl.yml +12 -6
  108. data/config/locales/hr-HR.yml +1 -0
  109. data/config/locales/hu.yml +46 -6
  110. data/config/locales/id-ID.yml +12 -6
  111. data/config/locales/is-IS.yml +10 -5
  112. data/config/locales/it.yml +78 -38
  113. data/config/locales/ja-JP.yml +849 -0
  114. data/config/locales/lt-LT.yml +1 -0
  115. data/config/locales/lv-LV.yml +835 -0
  116. data/config/locales/mt-MT.yml +1 -0
  117. data/config/locales/nl.yml +63 -6
  118. data/config/locales/no.yml +80 -43
  119. data/config/locales/pl.yml +309 -185
  120. data/config/locales/pt-BR.yml +13 -7
  121. data/config/locales/pt.yml +331 -207
  122. data/config/locales/ro-RO.yml +844 -0
  123. data/config/locales/ru.yml +11 -5
  124. data/config/locales/sk-SK.yml +823 -0
  125. data/config/locales/sk.yml +842 -0
  126. data/config/locales/sl.yml +175 -0
  127. data/config/locales/sr-CS.yml +625 -0
  128. data/config/locales/sv.yml +94 -12
  129. data/config/locales/tr-TR.yml +12 -6
  130. data/config/locales/uk.yml +10 -5
  131. data/config/routes.rb +13 -2
  132. data/lib/decidim/admin/engine.rb +2 -1
  133. data/lib/decidim/admin/version.rb +1 -1
  134. metadata +53 -18
@@ -23,7 +23,7 @@ module Decidim
23
23
  target: options[:target]) do
24
24
  content_tag(:span, data: { tooltip: true, disable_hover: false, click_open: false },
25
25
  title: title) do
26
- icon(icon_name)
26
+ icon(icon_name, aria_label: title, role: "img")
27
27
  end
28
28
  end
29
29
  end
@@ -9,7 +9,8 @@ module Decidim
9
9
  boolean: :check_box,
10
10
  integer: :number_field,
11
11
  string: :text_field,
12
- text: :text_area
12
+ text: :text_area,
13
+ enum: :collection_radio_buttons
13
14
  }.freeze
14
15
 
15
16
  # Public: Renders a form field that matches a settings attribute's
@@ -22,67 +23,65 @@ module Decidim
22
23
  # options - Extra options to be passed to the field helper.
23
24
  #
24
25
  # Returns a rendered form field.
25
- def settings_attribute_input(form, attribute, name, options = {})
26
- if name == :amendments_visibility
27
- amendments_visibility_form_field(form, options)
28
- elsif attribute.translated?
29
- form_method = form_method_for_attribute(attribute)
30
- tab_options = { tabs_id: "#{options[:tabs_prefix]}-#{name}-tabs" }
31
- extra_options = tab_options.merge(extra_options_for_type(form_method))
32
- form.send(:translated, form_method, name, options.merge(extra_options))
33
- else
34
- form_method = form_method_for_attribute(attribute)
35
- extra_options = extra_options_for(name).merge(extra_options_for_type(form_method))
36
- form.send(form_method, name, options.merge(extra_options))
26
+ def settings_attribute_input(form, attribute, name, i18n_scope, options = {})
27
+ form_method = form_method_for_attribute(attribute)
28
+
29
+ container_class = "#{name}_container"
30
+ if options[:readonly]
31
+ container_class += " readonly_container"
32
+ help_text = text_for_setting(name, "readonly", i18n_scope)
37
33
  end
38
- end
34
+ help_text ||= text_for_setting(name, "help", i18n_scope)
35
+ help_text_options = help_text ? { help_text: help_text } : {}
39
36
 
40
- # Returns a translation or nil. If nil, ZURB Foundation won't add the help_text.
41
- def help_text_for_component_setting(field_name, settings_name, component_name)
42
- key = "decidim.components.#{component_name}.settings.#{settings_name}.#{field_name}_help"
43
- return t(key) if I18n.exists?(key)
37
+ options = { label: t(name, scope: i18n_scope) }
38
+ .merge(help_text_options)
39
+ .merge(extra_options_for_type(form_method))
40
+ .merge(options)
41
+
42
+ content_tag(:div, class: container_class) do
43
+ if attribute.translated?
44
+ options[:tabs_id] = "#{options.delete(:tabs_prefix)}-#{name}-tabs"
45
+ form.send(:translated, form_method, name, options)
46
+ elsif form_method == :collection_radio_buttons
47
+ render_enum_form_field(form, attribute, name, i18n_scope, options)
48
+ else
49
+ form.send(form_method, name, options)
50
+ end
51
+ end.html_safe
44
52
  end
45
53
 
46
54
  private
47
55
 
48
- # Returns a radio buttons collection input for the component's step setting
49
- # :amendments_visibility; all wrap in a label tag and with help text.
50
- def amendments_visibility_form_field(form, options)
51
- html = label_tag(:amendments_visibility) do
56
+ # Returns a radio buttons collection input for the given attribute
57
+ def render_enum_form_field(form, attribute, name, i18n_scope, options)
58
+ html = label_tag(name) do
52
59
  concat options[:label]
53
60
  concat tag(:br)
54
- concat form.collection_radio_buttons(:amendments_visibility,
55
- Decidim::Amendment::VisibilityStepSetting.options,
61
+ concat form.collection_radio_buttons(name,
62
+ build_enum_choices(name, i18n_scope, attribute.build_choices),
56
63
  :last,
57
64
  :first,
58
- { checked: form.object.amendments_visibility },
59
- amendments_extra_options) { |b| b.label { b.radio_button + b.text } }
65
+ { checked: form.object.send(name) },
66
+ options) { |b| b.label { b.radio_button + b.text } }
60
67
  end
61
- html << content_tag(:p, help_text_for_component_setting(:amendments_visibility, :step, :proposals), class: "help-text")
62
- html.html_safe
68
+ html << content_tag(:p, options[:help_text], class: "help-text") if options[:help_text]
69
+ html
63
70
  end
64
71
 
72
+ # Returns a translation or nil. If nil, ZURB Foundation won't add the help_text.
73
+ def text_for_setting(name, suffix, i18n_scope)
74
+ key = "#{i18n_scope}.#{name}_#{suffix}"
75
+ return t(key) if I18n.exists?(key)
76
+ end
77
+
78
+ # Returns the FormBuilder's method used to render
65
79
  def form_method_for_attribute(attribute)
66
80
  return :editor if attribute.type.to_sym == :text && attribute.editor?
67
81
 
68
82
  TYPES[attribute.type.to_sym]
69
83
  end
70
84
 
71
- # Handles special cases.
72
- # Returns an empty Hash or a Hash with extra HTML options.
73
- def extra_options_for(field_name)
74
- case field_name
75
- when :participatory_texts_enabled
76
- participatory_texts_extra_options
77
- when :amendment_creation_enabled,
78
- :amendment_reaction_enabled,
79
- :amendment_promotion_enabled
80
- amendments_extra_options
81
- else
82
- {}
83
- end
84
- end
85
-
86
85
  # Handles special cases.
87
86
  # Returns an empty Hash or a Hash with extra HTML options.
88
87
  def extra_options_for_type(input_type)
@@ -94,22 +93,11 @@ module Decidim
94
93
  end
95
94
  end
96
95
 
97
- # Marks :participatory_texts_enabled setting with a CSS class if the
98
- # Proposals component has existing proposals, so it can be identified
99
- # in "decidim/admin/form.js". Also, adds a help_text.
100
- def participatory_texts_extra_options
101
- return {} unless Decidim::Proposals::Proposal.where(component: @component).any?
102
-
103
- {
104
- class: "participatory_texts_disabled",
105
- help_text: help_text_for_component_setting(:participatory_texts_disabled, :global, :proposals)
106
- }
107
- end
108
-
109
- # Marks component_step_settings related to amendments with a CSS class,
110
- # so they can be identified in "decidim/admin/form.js".
111
- def amendments_extra_options
112
- { class: "amendments_step_settings" }
96
+ # Build options for enum attributes
97
+ def build_enum_choices(name, i18n_scope, choices)
98
+ choices.map do |choice|
99
+ [t("#{name}_choices.#{choice}", scope: i18n_scope), choice]
100
+ end
113
101
  end
114
102
  end
115
103
  end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Admin
5
+ # This class contains helpers needed to obtain information about
6
+ # image dimensions from the processors defined in the specific image's Uploader class
7
+ module UploaderImageDimensionsHelper
8
+ # Find the dimensions info of a model's image field and get the first value for dimensions ([w, h])
9
+ #
10
+ # model - The model to which the image belongs (An instance of `ActiveRecord`)
11
+ # image_name - The attribute name for the image (either a `symbol` or a `string`)
12
+ #
13
+ # Returns an integer array with [width, height]
14
+ def image_dimensions(model, image_name)
15
+ versions = model.send(image_name).dimensions_info
16
+ [:small, :medium, :default].map { |v| versions.dig(v, :dimensions) }.compact.first
17
+ end
18
+
19
+ # Find the first value for the processed image width
20
+ def image_width(model, image_name)
21
+ image_dimensions(model, image_name)[0]
22
+ end
23
+
24
+ # Find the first value for the processed image height
25
+ def image_height(model, image_name)
26
+ image_dimensions(model, image_name)[1]
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Admin
5
+ # This class is used to generate fake newsletters and data to preview
6
+ # newsletter templates.
7
+ class FakeNewsletter
8
+ def initialize(organization, manifest)
9
+ @organization = organization
10
+ @manifest = manifest
11
+ end
12
+
13
+ def id
14
+ 1
15
+ end
16
+
17
+ def template
18
+ @template ||= Decidim::ContentBlock.new(
19
+ in_preview: true,
20
+ manifest_name: manifest.name,
21
+ scope_name: :newsletter_template,
22
+ settings: manifest.settings.attributes.inject({}) do |acc, (name, attrs)|
23
+ value = if attrs.preview.respond_to?(:call)
24
+ attrs.preview.call
25
+ else
26
+ attrs.preview
27
+ end
28
+
29
+ acc.update(name => value)
30
+ end
31
+ )
32
+ end
33
+
34
+ def subject
35
+ organization.available_locales.inject({}) do |acc, locale|
36
+ acc.update(locale => "Lorem ipsum")
37
+ end
38
+ end
39
+
40
+ def sent_at
41
+ nil
42
+ end
43
+
44
+ private
45
+
46
+ attr_reader :organization, :manifest
47
+ end
48
+ end
49
+ end
@@ -31,6 +31,7 @@ module Decidim
31
31
 
32
32
  if user.admin? && admin_terms_accepted?
33
33
  allow! if read_admin_log_action?
34
+ allow! if read_metrics_action?
34
35
  allow! if static_page_action?
35
36
  allow! if organization_action?
36
37
  allow! if user_action?
@@ -96,6 +97,11 @@ module Decidim
96
97
  end
97
98
  end
98
99
 
100
+ def read_metrics_action?
101
+ permission_action.subject == :metrics &&
102
+ permission_action.action == :read
103
+ end
104
+
99
105
  def read_admin_log_action?
100
106
  permission_action.subject == :admin_log &&
101
107
  permission_action.action == :read
@@ -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
@@ -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 %>
@@ -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 %>
@@ -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">
@@ -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>