decidim-verifications 0.28.0 → 0.28.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -0
  3. data/app/controllers/concerns/decidim/admin/workflows_breadcrumb.rb +28 -0
  4. data/app/controllers/decidim/verifications/csv_census/admin/census_controller.rb +4 -0
  5. data/app/controllers/decidim/verifications/id_documents/admin/config_controller.rb +4 -0
  6. data/app/controllers/decidim/verifications/id_documents/admin/confirmations_controller.rb +4 -0
  7. data/app/controllers/decidim/verifications/id_documents/admin/offline_confirmations_controller.rb +4 -0
  8. data/app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb +4 -0
  9. data/app/controllers/decidim/verifications/id_documents/admin/rejections_controller.rb +4 -0
  10. data/app/controllers/decidim/verifications/postal_letter/admin/pending_authorizations_controller.rb +4 -0
  11. data/app/controllers/decidim/verifications/postal_letter/admin/postages_controller.rb +4 -0
  12. data/app/forms/decidim/verifications/id_documents/information_form.rb +8 -4
  13. data/app/views/decidim/verifications/csv_census/admin/census/index.html.erb +2 -2
  14. data/app/views/decidim/verifications/csv_census/admin/census/instructions.html.erb +2 -2
  15. data/app/views/decidim/verifications/id_documents/admin/config/edit.html.erb +2 -2
  16. data/app/views/decidim/verifications/id_documents/admin/confirmations/new.html.erb +2 -2
  17. data/app/views/decidim/verifications/id_documents/admin/offline_confirmations/new.html.erb +2 -2
  18. data/app/views/decidim/verifications/id_documents/admin/pending_authorizations/index.html.erb +3 -3
  19. data/app/views/decidim/verifications/postal_letter/admin/pending_authorizations/index.html.erb +49 -52
  20. data/config/locales/ar.yml +0 -2
  21. data/config/locales/bg.yml +272 -4
  22. data/config/locales/ca.yml +1 -2
  23. data/config/locales/cs.yml +1 -2
  24. data/config/locales/de.yml +1 -2
  25. data/config/locales/el.yml +0 -2
  26. data/config/locales/en.yml +1 -2
  27. data/config/locales/es-MX.yml +1 -2
  28. data/config/locales/es-PY.yml +1 -2
  29. data/config/locales/es.yml +1 -2
  30. data/config/locales/eu.yml +1 -2
  31. data/config/locales/fi-plain.yml +1 -2
  32. data/config/locales/fi.yml +1 -2
  33. data/config/locales/fr-CA.yml +1 -2
  34. data/config/locales/fr.yml +1 -2
  35. data/config/locales/ga-IE.yml +0 -2
  36. data/config/locales/gl.yml +0 -2
  37. data/config/locales/he-IL.yml +1 -0
  38. data/config/locales/hu.yml +0 -2
  39. data/config/locales/id-ID.yml +0 -2
  40. data/config/locales/is-IS.yml +0 -2
  41. data/config/locales/it.yml +0 -2
  42. data/config/locales/ja.yml +1 -2
  43. data/config/locales/lt.yml +0 -2
  44. data/config/locales/nl.yml +0 -2
  45. data/config/locales/no.yml +0 -2
  46. data/config/locales/pl.yml +1 -2
  47. data/config/locales/pt-BR.yml +0 -2
  48. data/config/locales/pt.yml +0 -2
  49. data/config/locales/ro-RO.yml +0 -2
  50. data/config/locales/ru.yml +0 -2
  51. data/config/locales/sk.yml +0 -2
  52. data/config/locales/sv.yml +0 -2
  53. data/config/locales/tr-TR.yml +1 -2
  54. data/config/locales/uk.yml +0 -2
  55. data/config/locales/zh-CN.yml +0 -2
  56. data/config/locales/zh-TW.yml +0 -2
  57. data/decidim-verifications.gemspec +37 -0
  58. data/lib/decidim/verifications/engine.rb +5 -0
  59. data/lib/decidim/verifications/test/factories.rb +8 -2
  60. data/lib/decidim/verifications/version.rb +1 -1
  61. data/lib/decidim/verifications.rb +7 -0
  62. metadata +17 -15
  63. data/config/environment.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ccd4b6e5efeb10ae08b7f78d59216bae371d58f1e66985761be2a155084b649
4
- data.tar.gz: d5535f678693c7bff6448604c9d9c044b462e090e6bd3269035f14a856b388ea
3
+ metadata.gz: 600e182f3b2e8e757b636f2dc4bc15e47d147961a9413e497dad0d5dbc9a2561
4
+ data.tar.gz: baba3e7c9ade0677fbd7d33789f63bfc7d041d2b7bf18bfaaea0b4fed734edbb
5
5
  SHA512:
6
- metadata.gz: b6244f59ee69c01f75f2af03a19e8da77bf0e6a9710e97cb56530fb41ee8fe1746cfa5a98be23b9675e540fcbbc8352a07c8737e51bd9d54d6414160694c2f74
7
- data.tar.gz: f033b38eaee51daf80c815ea5232ffc02f9cd6567ed89a54b933c0d467726bfcd91bef8cb8c7cc0ad3aebebd1a395507ab4e59e3c230bab9ebe2b4fe560a9a87
6
+ metadata.gz: 63642876393d8f99b4a4efcc57208c7b4fc2d5e6d60c7f1eb2464ead6adb574d1a596009c7588d5e934cf7a73ea5e34f3b85e100cae89acd9159b9ae409e17aa
7
+ data.tar.gz: 548feee7c666cb49b1fdd3e84b63231c3c29b16ddc18eaabf41950686a0860d281d2a5c8f847c120b924faa22071f2ea7aae1c43c309f1360d6e3f945ca904ab
data/README.md CHANGED
@@ -113,6 +113,28 @@ Decidim implements two type of authorization methods:
113
113
  end
114
114
  ```
115
115
 
116
+ ### Identification numbers
117
+
118
+ For the verification of the participants' data in Verifications, you can configure which type of documents a participant can have. By default these documents are `identification_number` and `passport`, but in some countries you may need to adapt these to your region or governmental specific needs. For instance, in Spain there are `dni`, `nie` and `passport`.
119
+
120
+ For configuring these you can do so with the Environment Variable `VERIFICATIONS_DOCUMENT_TYPES`.
121
+
122
+ ```env
123
+ VERIFICATIONS_DOCUMENT_TYPES="dni,nie,passport"
124
+ ```
125
+
126
+ You need to also add the following keys in your i18n files (i.e. `config/locales/en.yml`). By default in the verifications, `indentification_number` is currently being used as a universal example. Below are examples of adding `dni`, `nie` and `passport` locally used in Spain.
127
+
128
+ ```yaml
129
+ en:
130
+ decidim:
131
+ verifications:
132
+ id_documents:
133
+ dni: DNI
134
+ nie: NIE
135
+ passport: Passport
136
+ ```
137
+
116
138
  ### SMS verification
117
139
 
118
140
  Decidim comes with a verification workflow designed to verify users by sending
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Admin
5
+ # This module contains the breadrumb for the verifications worfklows
6
+ module WorkflowsBreadcrumb
7
+ extend ActiveSupport::Concern
8
+
9
+ included do
10
+ helper_method :context_breadcrumb_items
11
+ end
12
+
13
+ private
14
+
15
+ def context_breadcrumb_items
16
+ @context_breadcrumb_items ||= [authorization_breadcrumb_item]
17
+ end
18
+
19
+ def authorization_breadcrumb_item
20
+ {
21
+ label: I18n.t("menu.authorization_workflows", scope: "decidim.admin"),
22
+ url: decidim_admin.authorization_workflows_path,
23
+ active: true
24
+ }
25
+ end
26
+ end
27
+ end
28
+ end
@@ -10,6 +10,10 @@ module Decidim
10
10
  before_action :show_instructions,
11
11
  unless: :csv_census_active?
12
12
 
13
+ include Decidim::Admin::WorkflowsBreadcrumb
14
+
15
+ add_breadcrumb_item_from_menu :workflows_menu
16
+
13
17
  def index
14
18
  enforce_permission_to :index, :authorization
15
19
  @form = form(CensusDataForm).instance
@@ -10,6 +10,10 @@ module Decidim
10
10
  class ConfigController < Decidim::Admin::ApplicationController
11
11
  layout "decidim/admin/users"
12
12
 
13
+ include Decidim::Admin::WorkflowsBreadcrumb
14
+
15
+ add_breadcrumb_item_from_menu :workflows_menu
16
+
13
17
  def edit
14
18
  enforce_permission_to :update, :organization, organization: current_organization
15
19
 
@@ -12,6 +12,10 @@ module Decidim
12
12
 
13
13
  before_action :load_pending_authorization
14
14
 
15
+ include Decidim::Admin::WorkflowsBreadcrumb
16
+
17
+ add_breadcrumb_item_from_menu :workflows_menu
18
+
15
19
  def new
16
20
  enforce_permission_to :update, :authorization, authorization: @pending_authorization
17
21
 
@@ -10,6 +10,10 @@ module Decidim
10
10
  class OfflineConfirmationsController < Decidim::Admin::ApplicationController
11
11
  layout "decidim/admin/users"
12
12
 
13
+ include Decidim::Admin::WorkflowsBreadcrumb
14
+
15
+ add_breadcrumb_item_from_menu :workflows_menu
16
+
13
17
  def new
14
18
  enforce_permission_to :update, :authorization
15
19
 
@@ -9,6 +9,10 @@ module Decidim
9
9
 
10
10
  helper_method :has_offline_method?
11
11
 
12
+ include Decidim::Admin::WorkflowsBreadcrumb
13
+
14
+ add_breadcrumb_item_from_menu :workflows_menu
15
+
12
16
  def index
13
17
  enforce_permission_to :index, :authorization
14
18
 
@@ -12,6 +12,10 @@ module Decidim
12
12
 
13
13
  before_action :load_pending_authorization
14
14
 
15
+ include Decidim::Admin::WorkflowsBreadcrumb
16
+
17
+ add_breadcrumb_item_from_menu :workflows_menu
18
+
15
19
  def create
16
20
  enforce_permission_to :update, :authorization, authorization: @pending_authorization
17
21
 
@@ -7,6 +7,10 @@ module Decidim
7
7
  class PendingAuthorizationsController < Decidim::Admin::ApplicationController
8
8
  layout "decidim/admin/users"
9
9
 
10
+ include Decidim::Admin::WorkflowsBreadcrumb
11
+
12
+ add_breadcrumb_item_from_menu :workflows_menu
13
+
10
14
  def index
11
15
  enforce_permission_to :index, :authorization
12
16
 
@@ -12,6 +12,10 @@ module Decidim
12
12
 
13
13
  before_action :load_pending_authorization
14
14
 
15
+ include Decidim::Admin::WorkflowsBreadcrumb
16
+
17
+ add_breadcrumb_item_from_menu :workflows_menu
18
+
15
19
  def create
16
20
  enforce_permission_to :update, :authorization, authorization: @pending_authorization
17
21
 
@@ -7,14 +7,12 @@ module Decidim
7
7
  class InformationForm < AuthorizationHandler
8
8
  mimic :id_document_information
9
9
 
10
- DOCUMENT_TYPES = %w(DNI NIE passport).freeze
11
-
12
10
  attribute :document_number, String
13
11
  attribute :document_type, String
14
12
  attribute :verification_type, String
15
13
 
16
14
  validates :document_type,
17
- inclusion: { in: DOCUMENT_TYPES },
15
+ inclusion: { in: :document_types },
18
16
  presence: true
19
17
 
20
18
  validates :document_number,
@@ -44,7 +42,7 @@ module Decidim
44
42
  end
45
43
 
46
44
  def document_types_for_select
47
- DOCUMENT_TYPES.map do |type|
45
+ document_types.map do |type|
48
46
  [
49
47
  I18n.t(type.downcase, scope: "decidim.verifications.id_documents"),
50
48
  type
@@ -55,6 +53,12 @@ module Decidim
55
53
  def uses_online_method?
56
54
  verification_type == "online"
57
55
  end
56
+
57
+ private
58
+
59
+ def document_types
60
+ Decidim::Verifications.document_types
61
+ end
58
62
  end
59
63
  end
60
64
  end
@@ -1,9 +1,9 @@
1
1
  <% add_decidim_page_title(t("admin.index.title", scope: "decidim.verifications.csv_census")) %>
2
2
 
3
3
  <div class="item_show__header">
4
- <h2 class="item_show__header-title">
4
+ <h1 class="item_show__header-title">
5
5
  <%= t("admin.index.title", scope: "decidim.verifications.csv_census") %>
6
- </h2>
6
+ </h1>
7
7
  </div>
8
8
 
9
9
  <div class="item__edit item__edit-1col">
@@ -1,9 +1,9 @@
1
1
  <% add_decidim_page_title(t("admin.instructions.title", scope: "decidim.verifications.csv_census") ) %>
2
2
  <div class="card">
3
3
  <div class="item_show__header">
4
- <h2 class="item_show__header-title">
4
+ <h1 class="item_show__header-title">
5
5
  <%= t("admin.instructions.title", scope: "decidim.verifications.csv_census") %>
6
- </h2>
6
+ </h1>
7
7
  </div>
8
8
  <div class="card-section">
9
9
  <p><%= t("admin.instructions.body", scope: "decidim.verifications.csv_census") %></p>
@@ -1,9 +1,9 @@
1
1
  <% add_decidim_page_title(t(".title")) %>
2
2
 
3
3
  <div class="item_show__header">
4
- <h2 class="item_show__header-title">
4
+ <h1 class="item_show__header-title">
5
5
  <%= t(".title") %>
6
- </h2>
6
+ </h1>
7
7
  </div>
8
8
 
9
9
  <div class="item__edit item__edit-1col">
@@ -1,10 +1,10 @@
1
1
  <% add_decidim_page_title(t(".introduce_user_data")) %>
2
2
 
3
3
  <div class="item_show__header">
4
- <h2 class="item_show__header-title">
4
+ <h1 class="item_show__header-title">
5
5
  <%= t(".introduce_user_data") %>
6
6
  <%= link_to t(".reject"), pending_authorization_rejection_path(@pending_authorization), method: :post, class: "button button__sm button__secondary alert tiny button--title destroy" %>
7
- </h2>
7
+ </h1>
8
8
  </div>
9
9
 
10
10
  <div class="item__edit item__edit-1col">
@@ -1,9 +1,9 @@
1
1
  <% add_decidim_page_title(t(".introduce_user_data")) %>
2
2
 
3
3
  <div class="item_show__header">
4
- <h2 class="item_show__header-title">
4
+ <h1 class="item_show__header-title">
5
5
  <%= t(".introduce_user_data") %>
6
- </h2>
6
+ </h1>
7
7
  </div>
8
8
 
9
9
  <div class="item__edit item__edit-1col">
@@ -1,13 +1,13 @@
1
1
  <% add_decidim_page_title(t(".title")) %>
2
2
  <div class="card">
3
3
  <div class="item_show__header">
4
- <h2 class="item_show__header-title">
4
+ <h1 class="item_show__header-title">
5
5
  <%= t(".title") %>
6
6
  <%= link_to t(".config"), edit_config_path, class: "button button__sm button__secondary" %>
7
7
  <%= link_to t(".offline_verification"), new_offline_confirmation_path, class: "button button__sm button__secondary" if has_offline_method? %>
8
- </h2>
8
+ </h1>
9
9
  </div>
10
- <div class="card-section">
10
+ <div class="table-scroll">
11
11
  <table class="table-list">
12
12
  <thead>
13
13
  <tr>
@@ -1,56 +1,53 @@
1
1
  <% add_decidim_page_title(t(".title")) %>
2
- <div class="item_show__header">
3
- <h2 class="item_show__header-title">
4
- <%= t(".title") %>
5
- </h2>
6
- </div>
2
+ <div class="card">
3
+
4
+ <div class="item_show__header">
5
+ <h1 class="item_show__header-title">
6
+ <%= t(".title") %>
7
+ </h1>
8
+ </div>
7
9
 
8
- <div class="item__edit item__edit-1col">
9
- <div class="item__edit-form">
10
- <div class="card">
11
- <div class="card-section">
12
- <table class="table-list">
13
- <thead>
14
- <tr>
15
- <th><%= t(".username") %></th>
16
- <th><%= t(".address") %></th>
17
- <th><%= t(".verification_code") %></th>
18
- <th><%= t(".letter_sent_at") %></th>
19
- <th></th>
20
- </tr>
21
- </thead>
22
- <tbody>
23
- <% @pending_authorizations.each do |authorization| %>
24
- <tr>
25
- <td>
26
- <%= authorization.user.name %>
27
- </td>
28
- <td>
29
- <%= authorization.verification_address %>
30
- </td>
31
- <td>
32
- <%= authorization.verification_code %>
33
- </td>
34
- <td>
35
- <%= authorization.letter_sent_at %>
36
- </td>
37
- <td>
38
- <% if authorization.letter_sent? %>
39
- <%= icon "checkbox-circle-line",
40
- class: "action-icon action-icon--disabled" %>
41
- <% else %>
42
- <%= icon_link_to "checkbox-circle-line",
43
- pending_authorization_postage_path(authorization.id),
44
- t(".mark_as_sent"),
45
- method: :post,
46
- class: "action-icon--verify" %>
47
- <% end %>
48
- </td>
49
- </tr>
50
- <% end %>
51
- </tbody>
52
- </table>
53
- </div>
54
- </div>
10
+ <div class="table-scroll">
11
+ <table class="table-list">
12
+ <thead>
13
+ <tr>
14
+ <th><%= t(".username") %></th>
15
+ <th><%= t(".address") %></th>
16
+ <th><%= t(".verification_code") %></th>
17
+ <th><%= t(".letter_sent_at") %></th>
18
+ <th></th>
19
+ </tr>
20
+ </thead>
21
+ <tbody>
22
+ <% @pending_authorizations.each do |authorization| %>
23
+ <tr>
24
+ <td>
25
+ <%= authorization.user.name %>
26
+ </td>
27
+ <td>
28
+ <%= authorization.verification_address %>
29
+ </td>
30
+ <td>
31
+ <%= authorization.verification_code %>
32
+ </td>
33
+ <td>
34
+ <%= authorization.letter_sent_at %>
35
+ </td>
36
+ <td>
37
+ <% if authorization.letter_sent? %>
38
+ <%= icon "checkbox-circle-line",
39
+ class: "action-icon action-icon--disabled" %>
40
+ <% else %>
41
+ <%= icon_link_to "checkbox-circle-line",
42
+ pending_authorization_postage_path(authorization.id),
43
+ t(".mark_as_sent"),
44
+ method: :post,
45
+ class: "action-icon--verify" %>
46
+ <% end %>
47
+ </td>
48
+ </tr>
49
+ <% end %>
50
+ </tbody>
51
+ </table>
55
52
  </div>
56
53
  </div>
@@ -137,8 +137,6 @@ ar:
137
137
  new:
138
138
  send: طلب التحقق
139
139
  title: قم بتحميل مستند هويتك
140
- dni: DNI
141
- nie: NIE
142
140
  passport: جواز سفر
143
141
  postal_letter:
144
142
  admin: