decidim-decidim_awesome 0.11.2 → 0.11.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/README.md +54 -2
  4. data/app/cells/concerns/decidim/decidim_awesome/proposal_l_cell_override.rb +5 -3
  5. data/app/cells/decidim/decidim_awesome/content_blocks/map_cell.rb +0 -4
  6. data/app/cells/decidim/decidim_awesome/voting/proposal_metadata_cell.rb +18 -3
  7. data/app/commands/concerns/decidim/decidim_awesome/proposals/create_proposal_override.rb +2 -2
  8. data/app/commands/concerns/decidim/decidim_awesome/proposals/update_proposal_override.rb +1 -1
  9. data/app/commands/concerns/decidim/decidim_awesome/system/register_organization_override.rb +29 -0
  10. data/app/commands/concerns/decidim/decidim_awesome/system/update_organization_override.rb +35 -0
  11. data/app/commands/concerns/decidim/decidim_awesome/update_account_override.rb +30 -0
  12. data/app/commands/decidim/decidim_awesome/admin/create_scoped_style.rb +3 -2
  13. data/app/commands/decidim/decidim_awesome/admin/destroy_scoped_style.rb +6 -4
  14. data/app/controllers/concerns/decidim/decidim_awesome/check_login_authorizations.rb +60 -0
  15. data/app/controllers/concerns/decidim/decidim_awesome/needs_awesome_config.rb +0 -2
  16. data/app/controllers/concerns/decidim/decidim_awesome/proposals/memoize_extra_fields.rb +23 -0
  17. data/app/controllers/concerns/decidim/decidim_awesome/use_user_time_zone.rb +32 -0
  18. data/app/controllers/decidim/decidim_awesome/admin/admin_authorizations_controller.rb +122 -0
  19. data/app/controllers/decidim/decidim_awesome/admin/checks_controller.rb +1 -1
  20. data/app/controllers/decidim/decidim_awesome/admin/config_controller.rb +7 -1
  21. data/app/controllers/decidim/decidim_awesome/admin/constraints_controller.rb +5 -1
  22. data/app/controllers/decidim/decidim_awesome/admin/scoped_styles_controller.rb +12 -4
  23. data/app/controllers/decidim/decidim_awesome/required_authorizations_controller.rb +58 -0
  24. data/app/forms/concerns/decidim/decidim_awesome/account_form_override.rb +25 -0
  25. data/app/forms/concerns/decidim/decidim_awesome/system/organization_form_override.rb +34 -0
  26. data/app/forms/decidim/decidim_awesome/admin/config_form.rb +41 -8
  27. data/app/helpers/decidim/decidim_awesome/map_helper.rb +28 -26
  28. data/app/overrides/decidim/account/show/add_timezone_select.html.erb.deface +3 -0
  29. data/app/overrides/decidim/admin/officializations/index/add_modal.html.erb.deface +3 -0
  30. data/app/overrides/decidim/admin/officializations/index/add_td.html.erb.deface +5 -0
  31. data/app/overrides/decidim/admin/officializations/index/add_th.html.erb.deface +5 -0
  32. data/app/overrides/decidim/system/organizations/_advanced_settings/add_awesome_config.html.erb.deface +9 -0
  33. data/app/overrides/layouts/decidim/_head/add_awesome_tags.html.erb.deface +1 -1
  34. data/app/overrides/layouts/decidim/admin/_header/add_awesome_custom_styles.html.erb.deface +3 -0
  35. data/app/overrides/layouts/decidim/admin/_header/add_awesome_tags.html.erb.deface +1 -0
  36. data/app/packs/src/decidim/decidim_awesome/admin/proposal_sortings.js +0 -5
  37. data/app/packs/src/decidim/decidim_awesome/admin/verification_selects.js +21 -0
  38. data/app/packs/src/decidim/decidim_awesome/admin/verifications.js +43 -0
  39. data/app/packs/src/decidim/decidim_awesome/awesome_admin.js +1 -0
  40. data/app/packs/src/decidim/decidim_awesome/awesome_admin_global.js +1 -0
  41. data/app/packs/src/decidim/decidim_awesome/awesome_map/awesome_map.js +1 -1
  42. data/app/packs/stylesheets/decidim/decidim_awesome/admin/verifications.scss +99 -0
  43. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_admin_global.scss +1 -0
  44. data/app/permissions/decidim/decidim_awesome/admin/permissions.rb +42 -11
  45. data/app/permissions/decidim/decidim_awesome/permissions.rb +7 -0
  46. data/app/presenters/decidim/decidim_awesome/admin_log/component_presenter_override.rb +3 -5
  47. data/app/presenters/decidim/decidim_awesome/admin_log/user_presenter_override.rb +46 -0
  48. data/app/views/decidim/decidim_awesome/account/_timezone_select.html.erb +3 -0
  49. data/app/views/decidim/decidim_awesome/admin/admin_authorizations/authorization.html.erb +20 -0
  50. data/app/views/decidim/decidim_awesome/admin/admin_authorizations/callout.html.erb +3 -0
  51. data/app/views/decidim/decidim_awesome/admin/admin_authorizations/conflict.html.erb +5 -0
  52. data/app/views/decidim/decidim_awesome/admin/admin_authorizations/edit.html.erb +41 -0
  53. data/app/views/decidim/decidim_awesome/admin/config/_form_scoped_admin_styles.html.erb +1 -0
  54. data/app/views/decidim/decidim_awesome/admin/config/_form_scoped_styles.html.erb +48 -0
  55. data/app/views/decidim/decidim_awesome/admin/config/_form_surveys.html.erb +8 -0
  56. data/app/views/decidim/decidim_awesome/admin/config/_form_verifications.html.erb +15 -0
  57. data/app/views/decidim/decidim_awesome/admin/constraints/no_permissions.html.erb +6 -0
  58. data/app/views/decidim/decidim_awesome/admin/officializations/_participants_td.html.erb +25 -0
  59. data/app/views/decidim/decidim_awesome/admin/officializations/_participants_th.html.erb +1 -0
  60. data/app/views/decidim/decidim_awesome/admin/officializations/_verification_modal.html.erb +9 -0
  61. data/app/views/decidim/decidim_awesome/required_authorizations/index.html.erb +66 -0
  62. data/app/views/decidim/decidim_awesome/system/organizations/_admin_allowed_authorizations.html.erb +5 -0
  63. data/app/views/layouts/decidim/decidim_awesome/_custom_styles.html.erb +1 -1
  64. data/app/views/layouts/decidim/decidim_awesome/admin/_custom_styles.html.erb +3 -0
  65. data/app/views/layouts/decidim/decidim_awesome/admin/admin_authorizations.html.erb +7 -0
  66. data/config/i18n-tasks.yml +6 -0
  67. data/config/locales/ca.yml +91 -5
  68. data/config/locales/cs.yml +86 -0
  69. data/config/locales/de.yml +131 -0
  70. data/config/locales/en.yml +115 -1
  71. data/config/locales/es.yml +89 -3
  72. data/config/locales/eu.yml +607 -26
  73. data/config/locales/fr.yml +37 -1
  74. data/config/locales/it.yml +0 -1
  75. data/config/locales/ja.yml +86 -0
  76. data/config/locales/nl.yml +0 -1
  77. data/config/locales/pt-BR.yml +0 -1
  78. data/lib/decidim/decidim_awesome/admin_engine.rb +2 -0
  79. data/lib/decidim/decidim_awesome/authorizator.rb +34 -0
  80. data/lib/decidim/decidim_awesome/awesome.rb +55 -1
  81. data/lib/decidim/decidim_awesome/awesome_helpers.rb +48 -19
  82. data/lib/decidim/decidim_awesome/checksums.yml +9 -0
  83. data/lib/decidim/decidim_awesome/engine.rb +20 -4
  84. data/lib/decidim/decidim_awesome/menu.rb +45 -9
  85. data/lib/decidim/decidim_awesome/request_memoizer.rb +16 -0
  86. data/lib/decidim/decidim_awesome/test/factories.rb +0 -4
  87. data/lib/decidim/decidim_awesome/test/initializer.rb +4 -0
  88. data/lib/decidim/decidim_awesome/test/shared_examples/config_examples.rb +1 -1
  89. data/lib/decidim/decidim_awesome/test/shared_examples/custom_styles_examples.rb +156 -0
  90. data/lib/decidim/decidim_awesome/test/shared_examples/summary_examples.rb +26 -10
  91. data/lib/decidim/decidim_awesome/version.rb +1 -1
  92. data/package.json +6 -5
  93. metadata +42 -4
  94. data/app/views/decidim/decidim_awesome/admin/config/_form_styles.html.erb +0 -30
@@ -12,20 +12,16 @@ module Decidim
12
12
  return permission_action if user.read_attribute("admin").blank?
13
13
  return permission_action unless permission_action.action == :edit_config
14
14
 
15
- if permission_action.subject == :admin_accountability && DecidimAwesome.admin_accountability.respond_to?(:include?)
16
- if global?
17
- toggle_allow(DecidimAwesome.admin_accountability.include?(:admin_roles))
18
- else
19
- toggle_allow(DecidimAwesome.admin_accountability.include?(:participatory_space_roles))
20
- end
21
- elsif permission_action.subject == :private_data && config_enabled?(:proposal_private_custom_fields)
22
- if private_data.present?
23
- allow! if private_data.destroyable?
15
+ apply_private_data_permissions!
16
+ if config_enabled?(*permission_action.subject)
17
+ case permission_action.subject
18
+ when :admins_available_authorizations
19
+ apply_admin_authorizations_permissions!
20
+ when :admin_accountability
21
+ apply_admin_accountability_permissions!
24
22
  else
25
23
  allow!
26
24
  end
27
- else
28
- toggle_allow(config_enabled?(*permission_action.subject))
29
25
  end
30
26
 
31
27
  permission_action
@@ -33,6 +29,30 @@ module Decidim
33
29
 
34
30
  private
35
31
 
32
+ def apply_admin_authorizations_permissions!
33
+ allow! if awesome_admin_authorizations.present? && handler.in?(awesome_admin_authorizations)
34
+ end
35
+
36
+ def apply_admin_accountability_permissions!
37
+ if DecidimAwesome.admin_accountability.respond_to?(:include?)
38
+ if global?
39
+ allow! if DecidimAwesome.admin_accountability.include?(:admin_roles)
40
+ elsif DecidimAwesome.admin_accountability.include?(:participatory_space_roles)
41
+ allow!
42
+ end
43
+ end
44
+ end
45
+
46
+ def apply_private_data_permissions!
47
+ return unless permission_action.subject == :private_data && config_enabled?(:proposal_private_custom_fields)
48
+
49
+ if private_data.present?
50
+ allow! if private_data.destroyable?
51
+ else
52
+ allow!
53
+ end
54
+ end
55
+
36
56
  def global?
37
57
  context.fetch(:global, nil)
38
58
  end
@@ -40,6 +60,17 @@ module Decidim
40
60
  def private_data
41
61
  context.fetch(:private_data, nil)
42
62
  end
63
+
64
+ def handler
65
+ context.fetch(:handler, "")
66
+ end
67
+
68
+ def awesome_admin_authorizations
69
+ @awesome_admin_authorizations ||= begin
70
+ handlers = AwesomeConfig.find_by(var: :admins_available_authorizations, organization: user.organization)&.value || []
71
+ user.organization.available_authorizations.intersection(handlers)
72
+ end
73
+ end
43
74
  end
44
75
  end
45
76
  end
@@ -9,6 +9,7 @@ module Decidim
9
9
  return Decidim::DecidimAwesome::Admin::Permissions.new(user, permission_action, context).permissions if permission_action.scope == :admin
10
10
 
11
11
  editor_image_action?
12
+ required_authorizations_action?
12
13
 
13
14
  permission_action
14
15
  end
@@ -23,6 +24,12 @@ module Decidim
23
24
  return allow! if config[:allow_images_in_editors]
24
25
  return allow! if config[:allow_videos_in_editors]
25
26
  end
27
+
28
+ def required_authorizations_action?
29
+ return false unless permission_action.subject == :required_authorizations
30
+
31
+ return allow! unless context[:user_is_authorized]
32
+ end
26
33
  end
27
34
  end
28
35
  end
@@ -17,11 +17,9 @@ module Decidim
17
17
  end
18
18
 
19
19
  def i18n_params
20
- if action == "destroy_private_data"
21
- decidim_original_i18n_params.merge({ count: action_log.extra["count"] })
22
- else
23
- decidim_original_i18n_params
24
- end
20
+ return decidim_original_i18n_params unless action == "destroy_private_data"
21
+
22
+ decidim_original_i18n_params.merge({ count: action_log.extra["count"] })
25
23
  end
26
24
  end
27
25
  end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module DecidimAwesome
5
+ module AdminLog
6
+ module UserPresenterOverride
7
+ extend ActiveSupport::Concern
8
+
9
+ included do
10
+ alias_method :decidim_original_action_string, :action_string
11
+ alias_method :decidim_original_i18n_params, :i18n_params
12
+ alias_method :decidim_original_resource_presenter, :resource_presenter
13
+
14
+ def action_string
15
+ return "decidim.decidim_awesome.admin_log.user.#{action}" if authorization_action?
16
+
17
+ decidim_original_action_string
18
+ end
19
+
20
+ def i18n_params
21
+ return decidim_original_i18n_params unless authorization_action?
22
+
23
+ decidim_original_i18n_params.merge({
24
+ handler_name: h.content_tag(:span, action_log.extra["handler_name"], class: "logs__log__resource"),
25
+ reason: h.content_tag(:em, action_log.extra["reason"])
26
+ })
27
+ end
28
+
29
+ def resource_presenter
30
+ return decidim_original_resource_presenter unless authorization_action? && authorization_user
31
+
32
+ @resource_presenter ||= Decidim::Log::UserPresenter.new(authorization_user, h, { "name" => authorization_user.name, "nickname" => authorization_user.nickname })
33
+ end
34
+
35
+ def authorization_user
36
+ @authorization_user ||= Decidim::User.find_by(id: action_log.extra["user_id"])
37
+ end
38
+
39
+ def authorization_action?
40
+ action.in?(%w(admin_creates_authorization admin_forces_authorization admin_destroys_authorization))
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,3 @@
1
+ <% if awesome_config[:user_timezone].present? %>
2
+ <%= f.time_zone_select :user_time_zone, nil, help_text: t(".time_zone_helper") %>
3
+ <% end %>
@@ -0,0 +1,20 @@
1
+ <h4><%= t("decidim.decidim_awesome.required_authorizations.index.granted_title") %></h4>
2
+
3
+ <div class="verification__container">
4
+ <div class="verification">
5
+ <%= icon "checkbox-circle-line", class: "verification__icon is-granted self-start" %>
6
+
7
+ <div class="verification__text">
8
+ <h2 class="h5 text-secondary"><%= workflow.fullname %></h2>
9
+ <p><%= t(".granted_at", date: l(authorization.granted_at), format: :decidim_short) %></p>
10
+ <p><%= t(".metadata", metadata: content_tag("strong", t("booleans.#{authorization.metadata.present?}"))).html_safe %></p>
11
+ </div>
12
+
13
+ <div class="verification__actions">
14
+ <%= link_to decidim_admin_decidim_awesome.admin_authorization_path(id: user.id, handler: authorization.name), method: :delete, remote: true, class: "button button__lg button__primary", data: { confirm: t(".confirm_destroy") } do %>
15
+ <%= icon "delete-bin-line", class: "icon" %>
16
+ <%= t(".destroy") %>
17
+ <% end %>
18
+ </div>
19
+ </div>
20
+ </div>
@@ -0,0 +1,3 @@
1
+ <%= cell("decidim/announcement",
2
+ local_assigns[:message].presence || t("decidim.decidim_awesome.admin.admin_authorizations.#{i18n_key}", name: workflow&.fullname, user: user.name),
3
+ callout_class: klass) %>
@@ -0,0 +1,5 @@
1
+ <%= cell("decidim/announcement", {
2
+ title: t("decidim.decidim_awesome.admin.admin_authorizations.conflict"),
3
+ body: t("decidim.decidim_awesome.admin.admin_authorizations.conflict_help_html", user: link_to(conflict.user.name, decidim_admin.officializations_path(q: { name_or_nickname_or_email_cont: conflict.user.email })))
4
+ },
5
+ callout_class: "alert") %>
@@ -0,0 +1,41 @@
1
+ <div class="form-defaults">
2
+ <%= decidim_form_for(handler,
3
+ builder: Decidim::AuthorizationFormBuilder,
4
+ as: "authorization_handler",
5
+ url: decidim_admin_decidim_awesome.admin_authorization_path(id: user.id, handler: params[:handler]),
6
+ method: :patch,
7
+ remote: true) do |form| %>
8
+ <% if lookup_context.exists?(handler.to_partial_path, [], true) %>
9
+ <%= render partial: handler.to_partial_path, locals: { handler:, form: } %>
10
+ <% else %>
11
+ <div class="form__wrapper">
12
+ <%= form.all_fields %>
13
+ </div>
14
+ <% end %>
15
+
16
+ <% if defined?(with_override) %>
17
+ <div class="form__wrapper flash alert">
18
+ <label class="flex-col">
19
+ <div class="flash__title">
20
+ <%= check_box_tag "force_verification_check", true %>
21
+ <%= t(".force_verification") %>
22
+ </div>
23
+ <p class="help-text"><%= t(".force_verification_help") %></p>
24
+ </label>
25
+ <label>
26
+ <%= t(".force_verification_reason") %>
27
+ <%= text_area_tag "force_verification", nil, disabled: true %>
28
+ </label>
29
+ </div>
30
+ <% else %>
31
+ <%= cell("decidim/announcement", { title: t(".warning"), body: t(".do_it_if_sure") }, callout_class: "warning") %>
32
+ <% end %>
33
+
34
+ <div class="text-center mt-8">
35
+ <button type="submit" class="button button__lg button__primary">
36
+ <%= icon "alert-line", class: "fill-current" %>
37
+ <span><%= t(".authorize", name: workflow.fullname, user: user.name) %></span>
38
+ </button>
39
+ </div>
40
+ <% end %>
41
+ </div>
@@ -0,0 +1 @@
1
+ <%= render "form_scoped_styles", **local_assigns %>
@@ -0,0 +1,48 @@
1
+ <%
2
+ admin_styles = (config_var == "scoped_admin_styles")
3
+ style = admin_styles ? "scoped_admin_style" : "scoped_style"
4
+ %>
5
+ <div class="form__wrapper row column decidim_awesome-form">
6
+ <% if config_enabled? config_var %>
7
+ <% if admin_styles %>
8
+ <div class="colors-help">
9
+ <p><%= t("help.scoped_admin_styles_warning", scope: "decidim.decidim_awesome.admin.config.form").html_safe %></p>
10
+ <p><%= t("help.scoped_admin_styles", scope: "decidim.decidim_awesome.admin.config.form") %>
11
+ <%= t("help.scoped_admin_styles_variables", scope: "decidim.decidim_awesome.admin.config.form") %>
12
+ </p>
13
+ <p class="colors">
14
+ <% ["primary", "secondary", "tertiary", "success", "warning", "alert"].each do |color| %>
15
+ <span class="color-box <%= color %>" style="background-color: <%= current_organization.colors[color] %>"></span>
16
+ <code>var(--<%= color %>)</code>
17
+ <% end %>
18
+ </p>
19
+ </div>
20
+ <% else %>
21
+ <div class="colors-help">
22
+ <p><%= t("help.scoped_styles", scope: "decidim.decidim_awesome.admin.config.form") %>
23
+ <%= t("help.scoped_styles_variables", scope: "decidim.decidim_awesome.admin.config.form") %>
24
+ </p>
25
+ <p class="colors">
26
+ <% ["primary", "secondary", "tertiary", "success", "warning", "alert"].each do |color| %>
27
+ <span class="color-box <%= color %>" style="background-color: <%= current_organization.colors[color] %>"></span>
28
+ <code>var(--<%= color %>)</code>
29
+ <% end %>
30
+ </p>
31
+ </div>
32
+ <% end %>
33
+ <% form.object.send(config_var)&.each do |key, value| %>
34
+ <div class="card p-4 scoped_styles_container<%= " private" if admin_styles %> js-box-container" data-key="<%= key %>" data-var="<%= config_var %>">
35
+ <%= render("decidim/decidim_awesome/admin/config/autoedit_box_label", var: config_var, key: key, scope: "#{style}_#{key}", delete_path: decidim_admin_decidim_awesome.scoped_style_path(key: key, admin_panel: admin_styles)) %>
36
+ <p class="form-error is-visible" id="custom-style-error-<%= key %>"><%= errors[key.to_sym].join("<br>") if errors %></p>
37
+ <%= text_area_tag key, value, name: "config[#{config_var}][#{key}]", rows: 5 %>
38
+ <%= render("decidim/decidim_awesome/admin/config/constraints", key: "#{style}_#{key}", constraints: constraints_for("#{style}_#{key}")) %>
39
+ </div>
40
+ <% end %>
41
+
42
+ <%= link_to decidim_admin_decidim_awesome.scoped_styles_path(admin_panel: admin_styles), method: :post, class: "button button__sm button__text-secondary mr-auto" do %>
43
+ <%= icon("add-box-line") %>
44
+ <%= t("new", scope: "decidim.decidim_awesome.admin.config.form_#{config_var}") %>
45
+ <% end %>
46
+
47
+ <% end %>
48
+ </div>
@@ -8,4 +8,12 @@
8
8
  <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :auto_save_forms, constraints: constraints_for(:auto_save_forms) }) %>
9
9
  </div>
10
10
  <% end %>
11
+ <% if config_enabled? :user_timezone %>
12
+ <div class="row column">
13
+ <%= form.check_box :user_timezone %>
14
+ <span class="help-text mb-4" style="margin-top: -1rem;">
15
+ <%= t("help.user_timezone", scope: "decidim.decidim_awesome.admin.config.form") %>
16
+ </span>
17
+ </div>
18
+ <% end %>
11
19
  </div>
@@ -0,0 +1,15 @@
1
+ <div class="form__wrapper row column decidim_awesome-form">
2
+ <div class="callout warning"><%= t("help.verifications_html", scope: "decidim.decidim_awesome.admin.config.form") %></div>
3
+
4
+ <% if config_enabled? :force_authorization_after_login %>
5
+ <div>
6
+ <%= form.select :force_authorization_after_login, available_authorizations.map {|workflow| [workflow.fullname, workflow.name]}, { include_blank: false }, { multiple: true } %>
7
+ <p class="help-text"><%= t("help.force_authorization_after_login", scope: "decidim.decidim_awesome.admin.config.form") %></p>
8
+
9
+ <%= form.check_box :force_authorization_with_any_method %>
10
+
11
+ <%= form.translated :editor, :force_authorization_help_text, lines: 10, aria: { label: :force_authorization_help_text } %>
12
+ <p class="help-text"><%= t("help.force_authorization_help_text", scope: "decidim.decidim_awesome.admin.config.form") %></p>
13
+ </div>
14
+ <% end %>
15
+ </div>
@@ -0,0 +1,6 @@
1
+ <div data-dialog-container>
2
+ <%= icon "lock-line" %>
3
+ <h2 tabindex="-1" data-dialog-title>
4
+ No permissions for <%= constraint_key %>
5
+ </h2>
6
+ </div>
@@ -0,0 +1,25 @@
1
+ <td class="awesome_participants-td">
2
+ <% awesome_authorizations_for(user).authorizations.each do |auth| %>
3
+ <%
4
+ data = {
5
+ verification_user: user.name,
6
+ verification_user_id: user.id,
7
+ verification_handler: auth[:name],
8
+ verification_url: decidim_admin_decidim_awesome.edit_admin_authorization_path(id: user.id, handler: auth[:name])
9
+ }
10
+ classes = []
11
+ classes << "granted" if auth[:granted]
12
+ classes << "pending" if auth[:pending]
13
+ if auth[:managed]
14
+ classes << "managed"
15
+ data[:dialog_open] = "awesome-verification-modal"
16
+ end
17
+ %>
18
+ <%= content_tag(auth[:managed] ? "a" : "div", href: "#", class: classes, data:) do %>
19
+ <%= icon "check-line", class: "checked" %>
20
+ <%= icon "time-line", class: "undeterminated" %>
21
+ <%= icon "close-line", class: "unchecked" %>
22
+ <%= auth[:fullname] %>
23
+ <% end %>
24
+ <% end %>
25
+ </td>
@@ -0,0 +1 @@
1
+ <th class="awesome_participants-th"><%= t("decidim.decidim_awesome.admin.officializations.authorizations") %></th>
@@ -0,0 +1,9 @@
1
+ <%= decidim_modal id: "awesome-verification-modal", class:"reveal awesome_participants-modal" do %>
2
+ <div data-dialog-container>
3
+ </div>
4
+ <div data-dialog-actions>
5
+ <button data-dialog-close="awesome-verification-modal" class="button button__lg button__transparent-secondary">
6
+ <%= t(".close") %>
7
+ </button>
8
+ </div>
9
+ <% end %>
@@ -0,0 +1,66 @@
1
+ <div class="text-center py-10">
2
+ <h1 class="title-decorator inline-block text-left mb-12">
3
+ <%= t(".title") %>
4
+ </h1>
5
+ <p class="text-lg text-gray-2 text-left">
6
+ <%= t(awesome_config[:force_authorization_with_any_method] ? ".verify_with_any_of_these_options" : ".verify_with_all_these_options") %>
7
+ </p>
8
+ </div>
9
+
10
+ <div class="space-y-8">
11
+ <% if granted_authorizations.any? %>
12
+ <div class="verification__container-title"><%= t(".granted_title") %></div>
13
+ <div class="verification__container">
14
+ <% granted_authorizations.each do |method| %>
15
+ <div class="verification verification__no_clickable">
16
+ <%= icon "checkbox-circle-line", class: "verification__icon is-granted" %>
17
+ <div class="verification__text">
18
+ <h2 class="h5 text-secondary">
19
+ <%= method.fullname %>
20
+ </h2>
21
+ </div>
22
+ </div>
23
+ <% end %>
24
+ </div>
25
+ <% end %>
26
+
27
+ <% if pending_authorizations.any? %>
28
+ <div class="verification__container-title"><%= t(".resume_title") %></div>
29
+ <div class="verification__container">
30
+ <% pending_authorizations.each do |method| %>
31
+ <%= link_to method.resume_authorization_path(redirect_url:), class: "verification" do %>
32
+ <%= icon "time-line", class: "verification__icon" %>
33
+ <div class="verification__text">
34
+ <h2 class="h5 text-secondary">
35
+ <%= t(".resume_with_method", name: method.fullname) %>
36
+ </h2>
37
+ </div>
38
+ <% end %>
39
+ <% end %>
40
+ </div>
41
+ <% end %>
42
+
43
+ <% if missing_authorizations.any? %>
44
+ <div class="verification__container-title"><%= t(".missing_title") %></div>
45
+ <div class="verification__container">
46
+ <% missing_authorizations.each do |method| %>
47
+ <%= link_to method.root_path(redirect_url:), class: "verification" do %>
48
+ <%= icon(method.icon || "login-circle-line", class: "verification__icon") %>
49
+ <div class="verification__text">
50
+ <h2 class="h5 text-secondary">
51
+ <%= t(".verify_with_method", name: method.fullname) %>
52
+ </h2>
53
+ </div>
54
+ <% end %>
55
+ <% end %>
56
+ </div>
57
+ <% end %>
58
+ </div>
59
+
60
+ <div class="space-y-8 prose-a:text-secondary mt-8">
61
+ <%= translated_attribute(awesome_config[:force_authorization_help_text]).html_safe %>
62
+
63
+ <p class="prose-a:text-secondary italic">
64
+ <%= t(".cancel", link: link_to("#{icon("logout-box-r-line", class: "inline-block").html_safe} #{t(".logout")}".html_safe, decidim.destroy_user_session_path(redirect_url:), method: :delete).html_safe).html_safe %>
65
+ </p>
66
+ </div>
@@ -0,0 +1,5 @@
1
+ <%= field_set_tag f.label(:awesome_admins_available_authorizations, nil, for: nil), class: "border-2 border-background p-4" do %>
2
+ <%= f.collection_check_boxes :awesome_admins_available_authorizations, Decidim.authorization_handlers, :name, :description, help_text: t("decidim.decidim_awesome.system.organizations.admin_allowed_authoritzations_help_html") do |builder|
3
+ builder.label(for: nil, class: "form__wrapper-checkbox-label") { builder.check_box(id: nil) + builder.text }
4
+ end %>
5
+ <% end %>
@@ -1,3 +1,3 @@
1
1
  <style media="all">
2
- <%== awesome_custom_styles.join("\n").html_safe %>
2
+ <%== awesome_scoped_styles.join("\n").html_safe %>
3
3
  </style>
@@ -0,0 +1,3 @@
1
+ <style media="all">
2
+ <%== awesome_scoped_admin_styles.join("\n").html_safe %>
3
+ </style>
@@ -0,0 +1,7 @@
1
+ <%= icon "lock-line" %>
2
+ <h3 tabindex="-1" data-dialog-title>
3
+ <%= t("decidim.decidim_awesome.admin.officializations.verification_modal.authorizations_for", user: user.name) %>
4
+ </h3>
5
+ <div data-dialog-content>
6
+ <%= yield %>
7
+ </div>
@@ -17,6 +17,8 @@ ignore_unused:
17
17
  - "decidim.admin.filters.search_placeholder.*"
18
18
  - "activemodel.attributes.constraint.*"
19
19
  - "activemodel.attributes.custom_redirect.*"
20
+ - "activemodel.attributes.user.*"
21
+ - activemodel.attributes.organization.awesome_admins_available_authorizations
20
22
  - "decidim.components.decidim_awesome.name"
21
23
  - "decidim.components.awesome_iframe.settings.*"
22
24
  - "decidim.components.awesome_map.settings.*"
@@ -24,6 +26,8 @@ ignore_unused:
24
26
  - "decidim.components.proposals.settings.step.*"
25
27
  - "decidim.decidim_awesome.admin.config.*"
26
28
  - "decidim.decidim_awesome.admin.admin_accountability.*"
29
+ - "decidim.decidim_awesome.admin.scoped_admin_styles.*"
30
+ - "decidim.decidim_awesome.admin.scoped_styles.*"
27
31
  - "decidim.decidim_awesome.admin.menu.*"
28
32
  - "decidim.decidim_awesome.admin.menu_hacks.*"
29
33
  - "decidim.decidim_awesome.admin.proposal_custom_fields.*"
@@ -32,6 +36,8 @@ ignore_unused:
32
36
  - "decidim.decidim_awesome.voting.voting_cards.*"
33
37
  - "decidim.decidim_awesome.content_blocks.*"
34
38
  - "decidim.decidim_awesome.admin_log.*"
39
+ - "decidim.decidim_awesome.required_authorizations.index.verify_with_all_these_options"
40
+ - "decidim.decidim_awesome.required_authorizations.index.verify_with_any_of_these_options"
35
41
  - "layouts.decidim.decidim_awesome.admin.maintenance.titles.*"
36
42
  - "decidim.proposals.*"
37
43
  - "decidim.meetings.*"