decidim-verifications 0.27.10 → 0.28.0.rc4

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 (104) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -26
  3. data/app/cells/decidim/verifications/revocations/show.erb +18 -16
  4. data/app/commands/decidim/verifications/authorize_user.rb +24 -3
  5. data/app/commands/decidim/verifications/confirm_user_authorization.rb +1 -1
  6. data/app/commands/decidim/verifications/csv_census/admin/create_census_data.rb +1 -1
  7. data/app/commands/decidim/verifications/id_documents/admin/confirm_user_offline_authorization.rb +1 -1
  8. data/app/commands/decidim/verifications/perform_authorization_step.rb +1 -1
  9. data/app/commands/decidim/verifications/revoke_all_authorizations.rb +2 -2
  10. data/app/commands/decidim/verifications/revoke_by_condition_authorizations.rb +3 -3
  11. data/app/controllers/concerns/decidim/verifications/renewable.rb +2 -2
  12. data/app/controllers/decidim/verifications/application_controller.rb +3 -0
  13. data/app/controllers/decidim/verifications/authorizations_controller.rb +20 -4
  14. data/app/controllers/decidim/verifications/id_documents/authorizations_controller.rb +6 -6
  15. data/app/controllers/decidim/verifications/sms/authorizations_controller.rb +7 -11
  16. data/app/events/decidim/verifications/managed_user_error_event.rb +3 -8
  17. data/app/forms/decidim/verifications/id_documents/information_form.rb +4 -8
  18. data/app/forms/decidim/verifications/postal_letter/postage_form.rb +1 -1
  19. data/app/forms/decidim/verifications/sms/mobile_phone_form.rb +7 -3
  20. data/app/helpers/decidim/verifications/application_helper.rb +91 -0
  21. data/app/jobs/decidim/verifications/csv_census/application_job.rb +1 -1
  22. data/app/jobs/decidim/verifications/csv_census/remove_duplicates_job.rb +1 -1
  23. data/app/models/decidim/verifications/csv_census/data.rb +1 -1
  24. data/app/models/decidim/verifications/csv_datum.rb +3 -3
  25. data/app/packs/entrypoints/decidim_verifications.js +2 -0
  26. data/app/packs/stylesheets/verifications.scss +58 -0
  27. data/app/presenters/decidim/verifications/postal_letter/authorization_presenter.rb +1 -1
  28. data/app/queries/decidim/verifications/authorizations.rb +2 -2
  29. data/app/services/decidim/authorization_handler.rb +45 -13
  30. data/app/views/decidim/verifications/authorizations/_item.html.erb +31 -0
  31. data/app/views/decidim/verifications/authorizations/first_login.html.erb +20 -21
  32. data/app/views/decidim/verifications/authorizations/index.html.erb +28 -73
  33. data/app/views/decidim/verifications/authorizations/new.html.erb +27 -29
  34. data/app/views/decidim/verifications/authorizations/renew_modal.html.erb +23 -30
  35. data/app/views/decidim/verifications/csv_census/admin/census/index.html.erb +54 -39
  36. data/app/views/decidim/verifications/csv_census/admin/census/instructions.html.erb +3 -2
  37. data/app/views/decidim/verifications/id_documents/admin/config/edit.html.erb +30 -21
  38. data/app/views/decidim/verifications/id_documents/admin/confirmations/new.html.erb +38 -22
  39. data/app/views/decidim/verifications/id_documents/admin/offline_confirmations/new.html.erb +39 -21
  40. data/app/views/decidim/verifications/id_documents/admin/pending_authorizations/index.html.erb +4 -4
  41. data/app/views/decidim/verifications/id_documents/authorizations/_form.html.erb +4 -10
  42. data/app/views/decidim/verifications/id_documents/authorizations/choose.html.erb +10 -19
  43. data/app/views/decidim/verifications/id_documents/authorizations/edit.html.erb +32 -41
  44. data/app/views/decidim/verifications/id_documents/authorizations/new.html.erb +19 -25
  45. data/app/views/decidim/verifications/postal_letter/admin/pending_authorizations/index.html.erb +53 -48
  46. data/app/views/decidim/verifications/postal_letter/authorizations/edit.html.erb +32 -34
  47. data/app/views/decidim/verifications/postal_letter/authorizations/new.html.erb +20 -25
  48. data/app/views/decidim/verifications/sms/authorizations/edit.html.erb +25 -34
  49. data/app/views/decidim/verifications/sms/authorizations/new.html.erb +20 -25
  50. data/app/views/dummy_authorization/_form.html.erb +6 -16
  51. data/app/views/layouts/decidim/authorizations.html.erb +8 -0
  52. data/config/assets.rb +8 -0
  53. data/config/locales/ar.yml +3 -50
  54. data/config/locales/bg.yml +4 -266
  55. data/config/locales/ca.yml +46 -39
  56. data/config/locales/cs.yml +48 -41
  57. data/config/locales/de.yml +44 -37
  58. data/config/locales/el.yml +3 -59
  59. data/config/locales/en.yml +52 -45
  60. data/config/locales/es-MX.yml +47 -40
  61. data/config/locales/es-PY.yml +47 -40
  62. data/config/locales/es.yml +46 -39
  63. data/config/locales/eu.yml +51 -44
  64. data/config/locales/fi-plain.yml +48 -41
  65. data/config/locales/fi.yml +48 -41
  66. data/config/locales/fr-CA.yml +50 -43
  67. data/config/locales/fr.yml +50 -43
  68. data/config/locales/ga-IE.yml +2 -1
  69. data/config/locales/gl.yml +3 -59
  70. data/config/locales/hu.yml +48 -43
  71. data/config/locales/id-ID.yml +3 -50
  72. data/config/locales/is-IS.yml +3 -22
  73. data/config/locales/it.yml +3 -59
  74. data/config/locales/ja.yml +50 -43
  75. data/config/locales/lt.yml +43 -35
  76. data/config/locales/lv.yml +1 -58
  77. data/config/locales/nl.yml +3 -59
  78. data/config/locales/no.yml +3 -59
  79. data/config/locales/pl.yml +3 -80
  80. data/config/locales/pt-BR.yml +3 -66
  81. data/config/locales/pt.yml +3 -59
  82. data/config/locales/ro-RO.yml +7 -59
  83. data/config/locales/ru.yml +3 -28
  84. data/config/locales/sk.yml +3 -58
  85. data/config/locales/sv.yml +7 -62
  86. data/config/locales/tr-TR.yml +3 -60
  87. data/config/locales/uk.yml +3 -28
  88. data/config/locales/zh-CN.yml +3 -59
  89. data/config/locales/zh-TW.yml +33 -25
  90. data/lib/decidim/verifications/adapter.rb +7 -7
  91. data/lib/decidim/verifications/csv_census/workflow.rb +1 -0
  92. data/lib/decidim/verifications/id_documents/workflow.rb +1 -0
  93. data/lib/decidim/verifications/postal_letter/workflow.rb +1 -0
  94. data/lib/decidim/verifications/sms/engine.rb +2 -1
  95. data/lib/decidim/verifications/sms/example_gateway.rb +3 -2
  96. data/lib/decidim/verifications/test/factories.rb +2 -8
  97. data/lib/decidim/verifications/version.rb +1 -1
  98. data/lib/decidim/verifications/workflow_manifest.rb +2 -1
  99. data/lib/decidim/verifications/workflows.rb +2 -2
  100. data/lib/decidim/verifications.rb +0 -7
  101. metadata +26 -18
  102. data/app/views/decidim/verifications/authorizations/_granted_authorization.html.erb +0 -32
  103. data/config/locales/he-IL.yml +0 -1
  104. data/decidim-verifications.gemspec +0 -30
@@ -9,7 +9,7 @@ module Decidim
9
9
  def perform(organization)
10
10
  duplicated_census(organization).pluck(:email).each do |email|
11
11
  CsvDatum.inside(organization)
12
- .where(email: email)
12
+ .where(email:)
13
13
  .order(id: :desc)
14
14
  .all(1..-1)
15
15
  .each(&:delete)
@@ -21,7 +21,7 @@ module Decidim
21
21
  @values = []
22
22
  @errors = []
23
23
 
24
- CSV.foreach(@file) do |row|
24
+ CSV.foreach(@file, encoding: "BOM|UTF-8") do |row|
25
25
  process_row(row)
26
26
  end
27
27
  end
@@ -9,18 +9,18 @@ module Decidim
9
9
  validates :email, format: { with: ::Devise.email_regexp }
10
10
 
11
11
  def self.inside(organization)
12
- where(organization: organization)
12
+ where(organization:)
13
13
  end
14
14
 
15
15
  def self.search_user_email(organization, email)
16
16
  inside(organization)
17
- .where(email: email)
17
+ .where(email:)
18
18
  .order(created_at: :desc, id: :desc)
19
19
  .first
20
20
  end
21
21
 
22
22
  def self.insert_all(organization, values)
23
- values.each { |value| create(email: value, organization: organization) }
23
+ values.each { |value| create(email: value, organization:) }
24
24
  end
25
25
 
26
26
  def self.clear(organization)
@@ -0,0 +1,2 @@
1
+ // CSS
2
+ import "stylesheets/verifications.scss"
@@ -0,0 +1,58 @@
1
+ .verification {
2
+ @apply flex items-center justify-between gap-4 border-[3px] border-background rounded px-4 py-2 cursor-pointer;
3
+
4
+ &__no_clickable {
5
+ @apply cursor-default;
6
+ }
7
+
8
+ &__container {
9
+ @apply space-y-8;
10
+
11
+ &-title {
12
+ @apply uppercase font-semibold text-gray-2 mb-8 mt-16 first:mt-0;
13
+ }
14
+ }
15
+
16
+ &__icon {
17
+ @apply flex-none w-8 h-8 text-gray fill-current;
18
+
19
+ &.is-granted {
20
+ @apply text-success;
21
+ }
22
+ }
23
+
24
+ &__text {
25
+ @apply grow space-y-2.5;
26
+
27
+ span {
28
+ @apply inline-block text-sm text-gray-2;
29
+ }
30
+ }
31
+
32
+ &__upload-button {
33
+ @apply w-full block mt-4;
34
+ }
35
+
36
+ &:not(.verification__no_clickable):hover {
37
+ @apply border-tertiary;
38
+ }
39
+
40
+ &:not(.verification__no_clickable):hover &__text > :first-child {
41
+ @apply underline;
42
+ }
43
+ }
44
+
45
+ .verification-modal {
46
+ &__text {
47
+ @apply text-lg text-gray-2 mt-8 mb-12 space-y-8;
48
+
49
+ ul,
50
+ ol {
51
+ @apply list-disc pl-4;
52
+ }
53
+ }
54
+
55
+ &__name {
56
+ @apply text-xl font-semibold block mb-2;
57
+ }
58
+ }
@@ -19,7 +19,7 @@ module Decidim
19
19
  end
20
20
 
21
21
  #
22
- # The verification code to be sent. It's kept in a different metadata
22
+ # The verification code to be sent. It is kept in a different metadata
23
23
  # key according to whether it has already been sent or not
24
24
  #
25
25
  def verification_code
@@ -23,8 +23,8 @@ module Decidim
23
23
  def query
24
24
  scope = Decidim::Authorization.left_outer_joins(:organization).where(decidim_organizations: { id: organization.id })
25
25
 
26
- scope = scope.where(name: name) unless name.nil?
27
- scope = scope.where(user: user) unless user.nil?
26
+ scope = scope.where(name:) unless name.nil?
27
+ scope = scope.where(user:) unless user.nil?
28
28
 
29
29
  case granted
30
30
  when true
@@ -12,11 +12,11 @@ module Decidim
12
12
  #
13
13
  # It also sets two default attributes, `user` and `handler_name`.
14
14
  class AuthorizationHandler < Form
15
- # The user that is trying to authorize, it's initialized with the
15
+ # The user that is trying to authorize, it is initialized with the
16
16
  # `current_user` from the controller.
17
17
  attribute :user, Decidim::User
18
18
 
19
- # The String name of the handler, should not be modified since it's used to
19
+ # The String name of the handler, should not be modified since it is used to
20
20
  # infer the class name of the authorization handler.
21
21
  attribute :handler_name, String
22
22
 
@@ -29,6 +29,39 @@ module Decidim
29
29
  nil
30
30
  end
31
31
 
32
+ # Defines whether the authorization is unique or if there is a duplicate for
33
+ # this particular authorization that matches the same unique_id.
34
+ #
35
+ # @return [Boolean] A boolean indicating if the authorization has a
36
+ # duplicate.
37
+ def unique?
38
+ unique_id.nil? || duplicate.blank?
39
+ end
40
+
41
+ # Defines whether the duplicate authorizations can be transferred to a new
42
+ # user.
43
+ #
44
+ # @return [Boolean] A boolean indicating whether the authorization can be
45
+ # transferred.
46
+ def transferrable?
47
+ duplicate.present? && duplicate.user.deleted?
48
+ end
49
+
50
+ # Fetches the duplicate record of the same authorization currently belonging
51
+ # to other user than the user being authorized.
52
+ #
53
+ # @return [Decidim::Authorization, nil] The duplicate authorization record
54
+ # based on the unique ID or nil if there is no duplicate.
55
+ def duplicate
56
+ return unless user
57
+
58
+ Authorization.find_by(
59
+ user: User.where.not(id: user.id).where(organization: user.organization),
60
+ name: handler_name,
61
+ unique_id:
62
+ )
63
+ end
64
+
32
65
  # The attributes of the handler that should be exposed as form input when
33
66
  # rendering the handler in a form.
34
67
  #
@@ -51,8 +84,15 @@ module Decidim
51
84
  "#{handler_name.sub!(/_handler$/, "")}/form"
52
85
  end
53
86
 
87
+ def authorization_attributes
88
+ {
89
+ unique_id:,
90
+ metadata:
91
+ }
92
+ end
93
+
54
94
  # Any data that the developer would like to inject to the `metadata` field
55
- # of an authorization when it's created. Can be useful if some of the
95
+ # of an authorization when it is created. Can be useful if some of the
56
96
  # params the user sent with the authorization form want to be persisted for
57
97
  # future use.
58
98
  #
@@ -67,7 +107,7 @@ module Decidim
67
107
 
68
108
  #
69
109
  # Any data to be injected in the `verification_metadata` field of an
70
- # authorization when it's created. This data will be used for multi-step
110
+ # authorization when it is created. This data will be used for multi-step
71
111
  # verificaton workflows in order to confirm the authorization.
72
112
  #
73
113
  # Returns a Hash.
@@ -117,16 +157,8 @@ module Decidim
117
157
 
118
158
  private
119
159
 
120
- def duplicates
121
- Authorization.where(
122
- user: User.where.not(id: user.id).where(organization: user.organization),
123
- name: handler_name,
124
- unique_id: unique_id
125
- )
126
- end
127
-
128
160
  def uniqueness
129
- return true if unique_id.nil? || duplicates.none?
161
+ return true if unique?
130
162
 
131
163
  errors.add(:base, I18n.t("decidim.authorization_handlers.errors.duplicate_authorization"))
132
164
 
@@ -0,0 +1,31 @@
1
+ <% verification = capture do %>
2
+ <%= icon auth_icon || "login-circle-line", class: "verification__icon#{" is-granted" if local_assigns[:is_granted].present?}" %>
3
+ <div class="verification__text">
4
+ <h2 class="h5 text-secondary">
5
+ <%= title %>
6
+ </h2>
7
+ <span>
8
+ <%= explanation %>
9
+ </span>
10
+ </div>
11
+ <% if local_assigns[:is_granted].present? && remote_url.present? %>
12
+ <%= icon "refresh-line", class: "w-6 h-6 flex-none text-secondary fill-current" %>
13
+ <% elsif local_assigns[:url].present? %>
14
+ <%= icon "arrow-right-s-line", class: "w-6 h-6 flex-none text-secondary fill-current" %>
15
+ <% end %>
16
+ <% end %>
17
+
18
+ <% if local_assigns[:url].present? %>
19
+ <a href="<%= url %>" class="verification" title="<%= button_text %>" data-verification>
20
+ <%= verification %>
21
+ </a>
22
+ <% elsif remote_url.present? %>
23
+ <div class="verification" data-verification data-dialog-open="renew-modal" data-dialog-remote-url="<%= remote_url %>">
24
+ <%= verification %>
25
+ </div>
26
+ <%= decidim_modal id: "renew-modal", class:"verification-modal", remote: true %>
27
+ <% else %>
28
+ <div class="verification verification__no_clickable">
29
+ <%= verification %>
30
+ </div>
31
+ <% end %>
@@ -1,22 +1,21 @@
1
- <div class="wrapper">
2
- <div class="row collapse">
3
- <div class="row collapse">
4
- <div class="columns large-8 large-centered text-center">
5
- <h1 class="heading1 page-title"><%= t(".title") %></h1>
6
- <p class="heading5"><%= t(".verify_with_these_options") %></p>
7
- </div>
8
- </div>
9
- <div class="row">
10
- <div class="columns medium-7 large-5 medium-centered">
11
- <div class="card">
12
- <div class="card__content">
13
- <% unauthorized_methods.each do |unauthorized_method| %>
14
- <%= link_to t(".actions.#{unauthorized_method.key}"), unauthorized_method.root_path, class: "button expanded" %>
15
- <% end %>
16
- <p class="text-center skip"><%= t("decidim.verifications.authorizations.skip_verification", link: link_to(t("decidim.verifications.authorizations.start_exploring"), cta_button_path).html_safe).html_safe %>.</p>
17
- </div>
18
- </div>
19
- </div>
20
- </div>
21
- </div>
1
+ <div class="text-center py-10">
2
+ <h1 class="title-decorator inline-block text-left mb-12">
3
+ <%= t("decidim.verifications.authorizations.first_login.title") %>
4
+ </h1>
5
+ <p class="text-lg text-gray-2 text-left">
6
+ <%= t("decidim.verifications.authorizations.first_login.verify_with_these_options") %>
7
+ </p>
8
+ </div>
9
+
10
+ <div class="space-y-4">
11
+ <ul class="space-y-4">
12
+ <% unauthorized_methods.each do |unauthorized_method| %>
13
+ <li>
14
+ <%= link_to t("decidim.verifications.authorizations.first_login.actions.#{unauthorized_method.key}"),
15
+ unauthorized_method.root_path,
16
+ class: "button button__sm button__transparent-secondary" %>
17
+ </li>
18
+ <% end %>
19
+ </ul>
20
+ <p class="prose prose-a:text-secondary"><%= t("decidim.verifications.authorizations.skip_verification", link: link_to(t("decidim.verifications.authorizations.start_exploring"), cta_button_path).html_safe).html_safe %>.</p>
22
21
  </div>
@@ -1,83 +1,38 @@
1
1
  <% add_decidim_page_title(t("authorizations", scope: "layouts.decidim.user_profile")) %>
2
2
  <% content_for(:subtitle) { t("authorizations", scope: "layouts.decidim.user_profile") } %>
3
- <% url_params = (redirect_url.present? ? { redirect_url: redirect_url } : {}) %>
3
+ <% url_params = (redirect_url.present? ? { redirect_url: } : {}) %>
4
4
 
5
- <div class="row column authorizations-list">
6
- <section class="section">
7
- <% if @granted_authorizations.any? %>
8
- <div class="card card--list">
9
- <% @granted_authorizations.each do |authorization| %>
10
- <% if authorization.renewable? %>
11
- <%= link_to "#", title: t(".show_renew_info"), data: { open: "renew-modal", "open-url": renew_modal_authorizations_path(handler: authorization.name) }, class: "card--list__item authorization-renewable" do %>
12
- <%= render partial: "granted_authorization", locals: { authorization: authorization } %>
13
- <% end %>
14
- <% elsif authorization.expired? %>
15
- <%= link_to authorization_method(authorization).root_path(**url_params), title: t(".expired_verification"), class: "card--list__item" do %>
16
- <% render partial: "granted_authorization", locals: { authorization: authorization } %>
17
- <% end %>
18
- <% else %>
19
- <div class="card--list__item">
20
- <%= render partial: "granted_authorization", locals: { authorization: authorization } %>
21
- </div>
22
- <% end %>
23
- <% end %>
24
- </div>
5
+ <%= append_javascript_pack_tag "decidim_verifications" %>
6
+ <%= append_stylesheet_pack_tag "decidim_verifications" %>
25
7
 
26
- <div id="renew-modal" data-reveal class="reveal" aria-labelledby="<%= t("renew_modal.title", scope: "decidim.verifications.authorizations") %>" aria-hidden="true" role="dialog"></div>
27
- <% end %>
8
+ <%= render layout: "layouts/decidim/shared/layout_user_profile" do %>
9
+ <section class="authorizations-list">
10
+ <%
11
+ subsections = []
28
12
 
29
- <% if @pending_authorizations.any? %>
30
- <div class="card card--list">
31
- <% @pending_authorizations.each do |authorization| %>
32
- <%= link_to authorization_method(authorization).resume_authorization_path(**url_params) do %>
33
- <div class="card--list__item">
34
- <div class="card--list__text">
35
- <%= icon "reload", class: "card--list__icon", aria_label: t(".pending_verification"), role: "img" %>
36
- <div>
37
- <h5 class="card--list__heading">
38
- <%= t("#{authorization.name}.name", scope: "decidim.authorization_handlers") %>
39
- </h5>
40
- <span class="text-small">
41
- <%= t("started_at", scope: "decidim.authorization_handlers", timestamp: l(authorization.updated_at, format: :long)) %>
42
- </span>
43
- </div>
44
- </div>
45
- <div class="card--list__data" aria-hidden="true">
46
- <span class="card--list__data__icon">
47
- <%= icon "chevron-right", role: "img", "aria-hidden": true %>
48
- </span>
49
- </div>
50
- </div>
51
- <% end %>
52
- <% end %>
53
- </div>
54
- <% end %>
13
+ subsections << {
14
+ title: t("authorizations.index.granted_verification", scope: "decidim.verifications"),
15
+ items: @granted_authorizations.map { |authorization| granted_authorization_display_data(authorization, redirect_url) }
16
+ } if @granted_authorizations.any?
17
+
18
+ subsections << {
19
+ title: t("authorizations.index.pending_verification", scope: "decidim.verifications"),
20
+ items: @pending_authorizations.map { |authorization| pending_authorization_display_data(authorization, redirect_url) }
21
+ } if @pending_authorizations.any?
22
+
23
+ subsections << {
24
+ title: t("authorizations.index.unauthorized_methods", scope: "decidim.verifications"),
25
+ items: unauthorized_methods.map { |method| unauthorized_method_display_data(method, redirect_url) }
26
+ } if unauthorized_methods.any?
27
+ %>
55
28
 
56
- <% if unauthorized_methods.any? %>
57
- <div class="card card--list">
58
- <% unauthorized_methods.each do |unauthorized_method| %>
59
- <%= link_to unauthorized_method.root_path(**url_params) do %>
60
- <div class="card--list__item">
61
- <div class="card--list__text">
62
- <%= icon "lock-unlocked", class: "card--list__icon", aria_label: t(".unauthorized_verification"), role: "img" %>
63
- <div>
64
- <h5 class="card--list__heading">
65
- <%= t("#{unauthorized_method.key}.name", scope: "decidim.authorization_handlers") %>
66
- </h5>
67
- <span class="text-small">
68
- <%= t("#{unauthorized_method.key}.explanation", scope: "decidim.authorization_handlers") %>
69
- </span>
70
- </div>
71
- </div>
72
- <div class="card--list__data" aria-hidden="true">
73
- <span class="card--list__data__icon">
74
- <%= icon "chevron-right", role: "img", "aria-hidden": true %>
75
- </span>
76
- </div>
77
- </div>
78
- <% end %>
29
+ <% subsections.each do |subsection| %>
30
+ <div class="verification__container-title"><%= subsection[:title] %></div>
31
+ <div class="verification__container">
32
+ <% subsection[:items].each do |locals| %>
33
+ <%= render partial: "item", locals: %>
79
34
  <% end %>
80
35
  </div>
81
36
  <% end %>
82
37
  </section>
83
- </div>
38
+ <% end %>
@@ -1,32 +1,30 @@
1
- <div class="wrapper">
2
- <div class="row collapse">
3
- <div class="row collapse">
4
- <div class="columns large-8 large-centered text-center page-title">
5
- <h1><%= t(".authorize_with", authorizer: t("#{handler.handler_name}.name", scope: "decidim.authorization_handlers")) %></h1>
6
- </div>
7
- </div>
8
-
9
- <div class="row">
10
- <div class="columns large-6 medium-centered">
11
- <div class="card">
12
- <div class="card__content">
13
- <%= authorization_form_for(handler, url: authorizations_path(redirect_url: redirect_url)) do |form| %>
14
- <% if lookup_context.exists?(handler.to_partial_path, [], true) %>
15
- <%= render partial: handler.to_partial_path, locals: { handler: handler, form: form } %>
16
- <% else %>
17
- <%= form.all_fields %>
18
- <% end %>
1
+ <div class="text-center py-10">
2
+ <h1 class="title-decorator inline-block text-left">
3
+ <%= t("decidim.verifications.authorizations.new.authorize_with", authorizer: t("#{handler.handler_name}.name", scope: "decidim.authorization_handlers")) %>
4
+ </h1>
5
+ </div>
19
6
 
20
- <div class="actions">
21
- <%= form.submit t(".authorize"), class: "button expanded" %>
22
- </div>
23
- <% end %>
24
- <p class="text-center skip">
25
- <%= t("decidim.verifications.authorizations.skip_verification", link: link_to(t("decidim.verifications.authorizations.start_exploring"), cta_button_path).html_safe).html_safe %>.
26
- </p>
27
- </div>
28
- </div>
29
- </div>
7
+ <%= authorization_form_for(handler, url: authorizations_path(redirect_url:)) 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 %>
30
13
  </div>
14
+ <% end %>
15
+
16
+ <div class="form__wrapper-block flex-col-reverse md:flex-row justify-between">
17
+ <%= link_to authorizations_path, class: "button button__sm md:button__lg button__text-secondary" do %>
18
+ <%= icon "arrow-left-line", class: "fill-current" %>
19
+ <span><%= t("decidim.wizard_step_form.wizard_aside.back") %></span>
20
+ <% end %>
21
+ <button type="submit" class="button button__sm md:button__lg button__secondary">
22
+ <span><%= t("decidim.verifications.authorizations.new.authorize") %></span>
23
+ <%= icon "arrow-right-line", class: "fill-current" %>
24
+ </button>
31
25
  </div>
32
- </div>
26
+
27
+ <p class="prose prose-a:text-secondary">
28
+ <%= t("decidim.verifications.authorizations.skip_verification", link: link_to(t("decidim.verifications.authorizations.start_exploring"), cta_button_path).html_safe).html_safe %>.
29
+ </p>
30
+ <% end %>
@@ -1,38 +1,31 @@
1
- <div class="reveal__header">
2
- <h3 class="reveal__title">
1
+ <div data-dialog-container>
2
+ <%= icon "refresh-line" %>
3
+ <h3 class="h3" id="dialog-title-renew-modal" tabindex="-1" data-dialog-title>
3
4
  <%= t("renew_modal.title", scope: "decidim.verifications.authorizations") %>
4
5
  </h3>
6
+ <div>
7
+ <div id="dialog-desc-renew-modal" class="verification-modal__text">
8
+ <p>
9
+ <span class="verification-modal__name"><%= t("#{authorization.name}.name", scope: "decidim.authorization_handlers") %></span>
10
+ <span><%= t("#{authorization.name}.explanation", scope: "decidim.authorization_handlers") %></span>
11
+ </p>
5
12
 
6
- <button class="close-button" data-close aria-label="<%= t("renew_modal.close", scope: "decidim.verifications.authorizations") %>"
7
- type="button">
8
- <span aria-hidden="true">&times;</span>
9
- </button>
10
- </div>
11
-
12
- <div class="row">
13
- <p>
14
- <strong>
15
- <%= t("#{authorization.name}.name", scope: "decidim.authorization_handlers") %>
16
- </strong>
17
- <br>
18
- <span class="text-muted">
19
- <%= t("#{authorization.name}.explanation", scope: "decidim.authorization_handlers") %>
20
- </span>
21
- </p>
22
-
23
- <%= cell(authorization.metadata_cell, authorization) %>
13
+ <%= cell(authorization.metadata_cell, authorization) %>
24
14
 
25
- <p>
26
- <%= t("renew_modal.info_renew", scope: "decidim.verifications.authorizations") %>
27
- </p>
15
+ <p>
16
+ <%= t("renew_modal.info_renew", scope: "decidim.verifications.authorizations") %>
17
+ </p>
18
+ </div>
19
+ </div>
28
20
  </div>
29
21
 
30
- <div class="row">
31
- <div class="column flex-center">
32
- <button class="clear button secondary expanded" data-close type="button">
33
- <%= t("renew_modal.cancel", scope: "decidim.verifications.authorizations") %>
34
- </button>
22
+ <div data-dialog-actions>
23
+ <button class="button button__sm md:button__lg button__transparent-secondary" data-dialog-close="renew-modal">
24
+ <%= t("renew_modal.cancel", scope: "decidim.verifications.authorizations") %>
25
+ </button>
35
26
 
36
- <%= link_to t("renew_modal.continue", scope: "decidim.verifications.authorizations"), authorization_method(authorization).renew_path, class: "button expanded" %>
37
- </div>
27
+ <%= link_to authorization_method(authorization).renew_path, class: "button button__sm md:button__lg button__secondary" do %>
28
+ <span><%= t("renew_modal.continue", scope: "decidim.verifications.authorizations") %></span>
29
+ <%= icon "arrow-right-line", class: "fill-current" %>
30
+ <% end %>
38
31
  </div>
@@ -1,44 +1,59 @@
1
1
  <% add_decidim_page_title(t("admin.index.title", scope: "decidim.verifications.csv_census")) %>
2
- <div class="card">
3
- <div class="card-divider">
4
- <h2 class="card-title">
5
- <%= t("admin.index.title", scope: "decidim.verifications.csv_census") %>
6
- </h2>
7
- </div>
8
- <div class="card-section">
9
- <% if @status.count > 0 %>
10
- <p><%= t("decidim.verifications.csv_census.admin.index.data", count: @status.count,
11
- due_date: l(@status.last_import_at, format: :long)) %>
12
- </p>
13
- <%= link_to t("decidim.verifications.csv_census.admin.destroy.title"),
14
- destroy_all_census_path,
15
- method: :delete,
16
- class: "button alert",
17
- data: { confirm: t("decidim.verifications.csv_census.admin.destroy.confirm") } %>
18
- <% else %>
19
- <p><%= t("admin.index.empty", scope: "decidim.verifications.csv_census") %></p>
20
- <% end %>
21
- </div>
2
+
3
+ <div class="item_show__header">
4
+ <h2 class="item_show__header-title">
5
+ <%= t("admin.index.title", scope: "decidim.verifications.csv_census") %>
6
+ </h2>
22
7
  </div>
23
8
 
24
- <div class="card">
25
- <div class="card-divider">
26
- <h2 class="card-title">
27
- <%= t("admin.new.title", scope: "decidim.verifications.csv_census") %>
28
- </h2>
29
- </div>
30
- <div class="card-section">
31
- <p><%= t("decidim.verifications.csv_census.admin.new.info") %></p>
32
- <pre class="code-block">
33
- user@example.org
34
- user2@example.org
35
- ...
36
- ...
37
- </pre>
38
- <%= decidim_form_for @form, url: census_path, multipart: true do |form| %>
39
- <%= label_tag :file, t("admin.new.file", scope: "decidim.verifications.csv_census") %>
40
- <%= form.file_field :file %>
41
- <%= submit_tag t("admin.new.submit", scope: "decidim.verifications.csv_census"), class: "button" %>
42
- <% end %>
9
+ <div class="item__edit item__edit-1col">
10
+ <div class="item__edit-form">
11
+ <div class="form__wrapper">
12
+ <div class="card">
13
+ <div class="card-divider"></div>
14
+ <div class="card-section">
15
+
16
+ <% if @status.count > 0 %>
17
+ <div class="row column">
18
+ <p><%= t("decidim.verifications.csv_census.admin.index.data", count: @status.count,
19
+ due_date: l(@status.last_import_at, format: :long)) %>
20
+ </p>
21
+ <%= link_to t("decidim.verifications.csv_census.admin.destroy.title"),
22
+ destroy_all_census_path,
23
+ method: :delete,
24
+ class: "button button__sm button__secondary alert",
25
+ data: { confirm: t("decidim.verifications.csv_census.admin.destroy.confirm") } %>
26
+ </div>
27
+ <% else %>
28
+ <p class="row column"><%= t("admin.index.empty", scope: "decidim.verifications.csv_census") %></p>
29
+ <% end %>
30
+ </div>
31
+
32
+ <div class="card-divider">
33
+ <h2 class="card-title">
34
+ <%= t("admin.new.title", scope: "decidim.verifications.csv_census") %>
35
+ </h2>
36
+ </div>
37
+ <div class="card-section">
38
+ <div class="row column">
39
+ <p><%= t("decidim.verifications.csv_census.admin.new.info") %></p>
40
+ <pre class="code-block"><%= t("decidim.verifications.csv_census.admin.new.example") %></pre>
41
+ </div>
42
+
43
+ <div class="row column">
44
+ <%= decidim_form_for @form, url: census_path, multipart: true do |form| %>
45
+ <%= label_tag :file, t("admin.new.file", scope: "decidim.verifications.csv_census") %>
46
+ <%= form.file_field :file %>
47
+
48
+ <div class="item__edit-sticky">
49
+ <div class="item__edit-sticky-container">
50
+ <%= submit_tag t("admin.new.submit", scope: "decidim.verifications.csv_census"), class: "button button__sm button__secondary" %>
51
+ </div>
52
+ </div>
53
+ <% end %>
54
+ </div>
55
+ </div>
56
+ </div>
57
+ </div>
43
58
  </div>
44
59
  </div>
@@ -1,6 +1,7 @@
1
+ <% add_decidim_page_title(t("admin.instructions.title", scope: "decidim.verifications.csv_census") ) %>
1
2
  <div class="card">
2
- <div class="card-divider">
3
- <h2 class="card-title">
3
+ <div class="item_show__header">
4
+ <h2 class="item_show__header-title">
4
5
  <%= t("admin.instructions.title", scope: "decidim.verifications.csv_census") %>
5
6
  </h2>
6
7
  </div>