decidim-verifications 0.28.0 → 0.28.1
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.
- checksums.yaml +4 -4
- data/README.md +22 -0
- data/app/controllers/concerns/decidim/admin/workflows_breadcrumb.rb +28 -0
- data/app/controllers/decidim/verifications/csv_census/admin/census_controller.rb +4 -0
- data/app/controllers/decidim/verifications/id_documents/admin/config_controller.rb +4 -0
- data/app/controllers/decidim/verifications/id_documents/admin/confirmations_controller.rb +4 -0
- data/app/controllers/decidim/verifications/id_documents/admin/offline_confirmations_controller.rb +4 -0
- data/app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb +4 -0
- data/app/controllers/decidim/verifications/id_documents/admin/rejections_controller.rb +4 -0
- data/app/controllers/decidim/verifications/postal_letter/admin/pending_authorizations_controller.rb +4 -0
- data/app/controllers/decidim/verifications/postal_letter/admin/postages_controller.rb +4 -0
- data/app/forms/decidim/verifications/id_documents/information_form.rb +8 -4
- data/app/views/decidim/verifications/csv_census/admin/census/index.html.erb +2 -2
- data/app/views/decidim/verifications/csv_census/admin/census/instructions.html.erb +2 -2
- data/app/views/decidim/verifications/id_documents/admin/config/edit.html.erb +2 -2
- data/app/views/decidim/verifications/id_documents/admin/confirmations/new.html.erb +2 -2
- data/app/views/decidim/verifications/id_documents/admin/offline_confirmations/new.html.erb +2 -2
- data/app/views/decidim/verifications/id_documents/admin/pending_authorizations/index.html.erb +3 -3
- data/app/views/decidim/verifications/postal_letter/admin/pending_authorizations/index.html.erb +49 -52
- data/config/locales/ar.yml +0 -2
- data/config/locales/bg.yml +272 -4
- data/config/locales/ca.yml +1 -2
- data/config/locales/cs.yml +1 -2
- data/config/locales/de.yml +1 -2
- data/config/locales/el.yml +0 -2
- data/config/locales/en.yml +1 -2
- data/config/locales/es-MX.yml +1 -2
- data/config/locales/es-PY.yml +1 -2
- data/config/locales/es.yml +1 -2
- data/config/locales/eu.yml +1 -2
- data/config/locales/fi-plain.yml +1 -2
- data/config/locales/fi.yml +1 -2
- data/config/locales/fr-CA.yml +1 -2
- data/config/locales/fr.yml +1 -2
- data/config/locales/ga-IE.yml +0 -2
- data/config/locales/gl.yml +0 -2
- data/config/locales/he-IL.yml +1 -0
- data/config/locales/hu.yml +0 -2
- data/config/locales/id-ID.yml +0 -2
- data/config/locales/is-IS.yml +0 -2
- data/config/locales/it.yml +0 -2
- data/config/locales/ja.yml +1 -2
- data/config/locales/lt.yml +0 -2
- data/config/locales/nl.yml +0 -2
- data/config/locales/no.yml +0 -2
- data/config/locales/pl.yml +1 -2
- data/config/locales/pt-BR.yml +0 -2
- data/config/locales/pt.yml +0 -2
- data/config/locales/ro-RO.yml +0 -2
- data/config/locales/ru.yml +0 -2
- data/config/locales/sk.yml +0 -2
- data/config/locales/sv.yml +0 -2
- data/config/locales/tr-TR.yml +1 -2
- data/config/locales/uk.yml +0 -2
- data/config/locales/zh-CN.yml +0 -2
- data/config/locales/zh-TW.yml +0 -2
- data/decidim-verifications.gemspec +37 -0
- data/lib/decidim/verifications/engine.rb +5 -0
- data/lib/decidim/verifications/test/factories.rb +8 -2
- data/lib/decidim/verifications/version.rb +1 -1
- data/lib/decidim/verifications.rb +7 -0
- metadata +17 -15
- data/config/environment.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 600e182f3b2e8e757b636f2dc4bc15e47d147961a9413e497dad0d5dbc9a2561
|
4
|
+
data.tar.gz: baba3e7c9ade0677fbd7d33789f63bfc7d041d2b7bf18bfaaea0b4fed734edbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/app/controllers/decidim/verifications/id_documents/admin/offline_confirmations_controller.rb
CHANGED
@@ -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
|
|
@@ -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
|
|
data/app/controllers/decidim/verifications/postal_letter/admin/pending_authorizations_controller.rb
CHANGED
@@ -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:
|
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
|
-
|
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
|
-
<
|
4
|
+
<h1 class="item_show__header-title">
|
5
5
|
<%= t("admin.index.title", scope: "decidim.verifications.csv_census") %>
|
6
|
-
</
|
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
|
-
<
|
4
|
+
<h1 class="item_show__header-title">
|
5
5
|
<%= t("admin.instructions.title", scope: "decidim.verifications.csv_census") %>
|
6
|
-
</
|
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,10 +1,10 @@
|
|
1
1
|
<% add_decidim_page_title(t(".introduce_user_data")) %>
|
2
2
|
|
3
3
|
<div class="item_show__header">
|
4
|
-
<
|
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
|
-
</
|
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
|
-
<
|
4
|
+
<h1 class="item_show__header-title">
|
5
5
|
<%= t(".introduce_user_data") %>
|
6
|
-
</
|
6
|
+
</h1>
|
7
7
|
</div>
|
8
8
|
|
9
9
|
<div class="item__edit item__edit-1col">
|
data/app/views/decidim/verifications/id_documents/admin/pending_authorizations/index.html.erb
CHANGED
@@ -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
|
-
<
|
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
|
-
</
|
8
|
+
</h1>
|
9
9
|
</div>
|
10
|
-
<div class="
|
10
|
+
<div class="table-scroll">
|
11
11
|
<table class="table-list">
|
12
12
|
<thead>
|
13
13
|
<tr>
|
data/app/views/decidim/verifications/postal_letter/admin/pending_authorizations/index.html.erb
CHANGED
@@ -1,56 +1,53 @@
|
|
1
1
|
<% add_decidim_page_title(t(".title")) %>
|
2
|
-
<div class="
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
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="
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
<
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
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>
|