decidim-verifications 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +101 -0
  3. data/Rakefile +3 -0
  4. data/app/commands/decidim/verifications/authorize_user.rb +61 -0
  5. data/app/commands/decidim/verifications/confirm_user_authorization.rb +49 -0
  6. data/app/commands/decidim/verifications/perform_authorization_step.rb +48 -0
  7. data/app/controllers/decidim/verifications/authorizations_controller.rb +91 -0
  8. data/app/controllers/decidim/verifications/id_documents/admin/confirmations_controller.rb +48 -0
  9. data/app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb +28 -0
  10. data/app/controllers/decidim/verifications/id_documents/admin/rejections_controller.rb +37 -0
  11. data/app/controllers/decidim/verifications/id_documents/authorizations_controller.rb +82 -0
  12. data/app/controllers/decidim/verifications/postal_letter/admin/pending_authorizations_controller.rb +27 -0
  13. data/app/controllers/decidim/verifications/postal_letter/admin/postages_controller.rb +41 -0
  14. data/app/controllers/decidim/verifications/postal_letter/authorizations_controller.rb +74 -0
  15. data/app/forms/decidim/verifications/id_documents/information_form.rb +50 -0
  16. data/app/forms/decidim/verifications/id_documents/information_rejection_form.rb +15 -0
  17. data/app/forms/decidim/verifications/id_documents/upload_form.rb +20 -0
  18. data/app/forms/decidim/verifications/postal_letter/address_form.rb +28 -0
  19. data/app/forms/decidim/verifications/postal_letter/confirmation_form.rb +19 -0
  20. data/app/forms/decidim/verifications/postal_letter/postage_form.rb +34 -0
  21. data/app/presenters/decidim/verifications/id_documents/authorization_presenter.rb +20 -0
  22. data/app/presenters/decidim/verifications/postal_letter/authorization_presenter.rb +59 -0
  23. data/app/queries/decidim/verifications/authorizations.rb +41 -0
  24. data/app/services/decidim/authorization_handler.rb +112 -0
  25. data/app/services/decidim/dummy_authorization_handler.rb +27 -0
  26. data/app/uploaders/decidim/verifications/attachment_uploader.rb +16 -0
  27. data/app/views/decidim/verifications/authorizations/first_login.html.erb +22 -0
  28. data/app/views/decidim/verifications/authorizations/index.html.erb +78 -0
  29. data/app/views/decidim/verifications/authorizations/new.html.erb +33 -0
  30. data/app/views/decidim/verifications/id_documents/admin/confirmations/new.html.erb +26 -0
  31. data/app/views/decidim/verifications/id_documents/admin/pending_authorizations/index.html.erb +32 -0
  32. data/app/views/decidim/verifications/id_documents/authorizations/edit.html.erb +53 -0
  33. data/app/views/decidim/verifications/id_documents/authorizations/new.html.erb +35 -0
  34. data/app/views/decidim/verifications/postal_letter/admin/pending_authorizations/index.html.erb +50 -0
  35. data/app/views/decidim/verifications/postal_letter/authorizations/edit.html.erb +37 -0
  36. data/app/views/decidim/verifications/postal_letter/authorizations/new.html.erb +27 -0
  37. data/config/locales/ca.yml +126 -0
  38. data/config/locales/en.yml +126 -0
  39. data/config/locales/es.yml +126 -0
  40. data/config/locales/eu.yml +125 -0
  41. data/config/locales/fi.yml +125 -0
  42. data/config/locales/fr.yml +125 -0
  43. data/config/locales/it.yml +125 -0
  44. data/config/locales/nl.yml +125 -0
  45. data/config/locales/pl.yml +125 -0
  46. data/config/locales/pt.yml +125 -0
  47. data/config/locales/ru.yml +5 -0
  48. data/config/locales/uk.yml +41 -0
  49. data/db/migrate/20171030133426_move_authorizations_to_new_api.rb +66 -0
  50. data/lib/decidim/verifications.rb +26 -0
  51. data/lib/decidim/verifications/adapter.rb +88 -0
  52. data/lib/decidim/verifications/dummy.rb +5 -0
  53. data/lib/decidim/verifications/engine.rb +24 -0
  54. data/lib/decidim/verifications/id_documents.rb +6 -0
  55. data/lib/decidim/verifications/id_documents/admin.rb +12 -0
  56. data/lib/decidim/verifications/id_documents/admin_engine.rb +21 -0
  57. data/lib/decidim/verifications/id_documents/engine.rb +18 -0
  58. data/lib/decidim/verifications/id_documents/workflow.rb +6 -0
  59. data/lib/decidim/verifications/postal_letter.rb +6 -0
  60. data/lib/decidim/verifications/postal_letter/admin.rb +12 -0
  61. data/lib/decidim/verifications/postal_letter/admin_engine.rb +21 -0
  62. data/lib/decidim/verifications/postal_letter/engine.rb +18 -0
  63. data/lib/decidim/verifications/postal_letter/workflow.rb +6 -0
  64. data/lib/decidim/verifications/registry.rb +39 -0
  65. data/lib/decidim/verifications/version.rb +10 -0
  66. data/lib/decidim/verifications/workflow_manifest.rb +56 -0
  67. data/lib/decidim/verifications/workflows.rb +58 -0
  68. metadata +152 -0
@@ -0,0 +1,53 @@
1
+ <div class="wrapper">
2
+ <div class="row column">
3
+ <div class="callout announcement <%= authorization.rejected? ? 'alert' : 'secondary' %>">
4
+ <div class="row">
5
+ <div class="columns medium-8 large-9">
6
+ <% if authorization.rejected? %>
7
+ <h3 class="heading3"><%= t(".rejection_notice") %></h3>
8
+ <ul>
9
+ <li><%= t(".rejection_correctness") %></li>
10
+ <li><%= t(".rejection_clarity") %></li>
11
+ </ul>
12
+ <% else %>
13
+ <h3><%= t(".being_reviewed") %></h3>
14
+ <% end %>
15
+ </div>
16
+ </div>
17
+ </div>
18
+ </div>
19
+
20
+ <% if authorization.rejected? %>
21
+ <div class="row">
22
+ <div class="columns large-6 medium-centered">
23
+ <div class="row column">
24
+ <div class="card">
25
+ <div class="card__content">
26
+ <%= decidim_form_for(@form, url: authorization_path, method: :put) do |form| %>
27
+ <div class="card-section">
28
+ <div class="field">
29
+ <%= form.select :document_type, @form.document_types_for_select, prompt: true %>
30
+ </div>
31
+
32
+ <div class="field">
33
+ <%= form.text_field :document_number %>
34
+ </div>
35
+
36
+ <div class="field">
37
+ <%= form.upload :verification_attachment, optional: false %>
38
+ </div>
39
+ </div>
40
+
41
+ <div class="card-section">
42
+ <div class="actions">
43
+ <%= form.submit t(".send"), class: "button expanded", "data-disable-with" => "#{t('.send')}..." %>
44
+ </div>
45
+ </div>
46
+ <% end %>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ <% end %>
53
+ </div>
@@ -0,0 +1,35 @@
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(".title") %></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
+ <%= decidim_form_for(@form, url: authorization_path) do |form| %>
14
+ <div class="field">
15
+ <%= form.select :document_type, @form.document_types_for_select, prompt: true %>
16
+ </div>
17
+
18
+ <div class="field">
19
+ <%= form.text_field :document_number %>
20
+ </div>
21
+
22
+ <div class="field">
23
+ <%= form.upload :verification_attachment %>
24
+ </div>
25
+
26
+ <div class="actions">
27
+ <%= form.submit t(".send"), class: "button expanded", "data-disable-with" => "#{t('.send')}..." %>
28
+ </div>
29
+ <% end %>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
@@ -0,0 +1,50 @@
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title">
4
+ <%= t(".title") %>
5
+ </h2>
6
+ </div>
7
+ <div class="card-section">
8
+ <table class="table-list">
9
+ <thead>
10
+ <tr>
11
+ <th><%= t(".username") %></th>
12
+ <th><%= t(".address") %></th>
13
+ <th><%= t(".verification_code") %></th>
14
+ <th><%= t(".letter_sent_at") %></th>
15
+ <th></th>
16
+ </tr>
17
+ </thead>
18
+ <tbody>
19
+ <% @pending_authorizations.each do |authorization| %>
20
+ <tr>
21
+ <td>
22
+ <%= authorization.user.name %>
23
+ </td>
24
+ <td>
25
+ <%= authorization.verification_address %>
26
+ </td>
27
+ <td>
28
+ <%= authorization.verification_code %>
29
+ </td>
30
+ <td>
31
+ <%= authorization.letter_sent_at %>
32
+ </td>
33
+ <td>
34
+ <% if authorization.letter_sent? %>
35
+ <%= icon "circle-check",
36
+ class: "action-icon action-icon--disabled" %>
37
+ <% else %>
38
+ <%= icon_link_to "circle-check",
39
+ pending_authorization_postage_path(authorization.id),
40
+ t(".mark_as_sent"),
41
+ method: :post,
42
+ class: "action-icon--verify" %>
43
+ <% end %>
44
+ </td>
45
+ </tr>
46
+ <% end %>
47
+ </tbody>
48
+ </table>
49
+ </div>
50
+ </div>
@@ -0,0 +1,37 @@
1
+ <div class="wrapper">
2
+ <div class="row collapse">
3
+ <% if authorization.letter_sent? %>
4
+ <div class="row collapse">
5
+ <div class="columns large-8 large-centered text-center page-title">
6
+ <h1><%= t(".title") %></h1>
7
+ </div>
8
+ </div>
9
+
10
+ <div class="row">
11
+ <div class="columns large-6 medium-centered">
12
+ <div class="card">
13
+ <div class="card__content">
14
+ <%= decidim_form_for(@form, url: authorization_path, method: :put) do |form| %>
15
+ <div class="field">
16
+ <%= form.text_field :verification_code %>
17
+ </div>
18
+
19
+ <div class="actions">
20
+ <%= form.submit t(".send"), class: "button expanded", "data-disable-with" => "#{t('.send')}..." %>
21
+ </div>
22
+ <% end %>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ <% else %>
28
+ <div class="row">
29
+ <div class="callout announcement secondary">
30
+ <div class="row column">
31
+ <h3><%= t(".waiting_for_letter") %></h3>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ <% end %>
36
+ </div>
37
+ </div>
@@ -0,0 +1,27 @@
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(".title") %></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
+ <%= decidim_form_for(@form, url: authorization_path) do |form| %>
14
+ <div class="field">
15
+ <%= form.text_field :full_address %>
16
+ </div>
17
+
18
+ <div class="actions">
19
+ <%= form.submit t(".send"), class: "button expanded", "data-disable-with" => "#{t('.send')}..." %>
20
+ </div>
21
+ <% end %>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ </div>
@@ -0,0 +1,126 @@
1
+ ---
2
+ ca:
3
+ activemodel:
4
+ attributes:
5
+ id_document_information:
6
+ document_number: Número de document (amb lletra)
7
+ document_type: Tipus del document
8
+ id_document_upload:
9
+ document_number: Número de document (amb lletra)
10
+ document_type: Tipus del teu document
11
+ user: Usuari
12
+ verification_attachment: Còpia escanejada del teu document
13
+ decidim:
14
+ admin:
15
+ menu:
16
+ authorization_workflows: Verificacions
17
+ authorization_handlers:
18
+ admin:
19
+ id_documents:
20
+ help:
21
+ - Els usuaris omplen la informació de la seva identitat i carreguen una còpia del seu document.
22
+ - Emplenes la informació que es mostra a la imatge penjada.
23
+ - La informació ha de coincidir amb el que hagi omplert l'usuari.
24
+ - Si no pots veure la informació amb claredat o no la pots verificar, pots rebutjar la sol·licitud i l'usuari la podrà solucionar.
25
+ postal_letter:
26
+ help:
27
+ - Els usuaris sol·liciten un codi de verificació que s'enviarà a la seva adreça.
28
+ - Envies la carta a la seva adreça amb el codi de verificació.
29
+ - Marques la carta com a enviada.
30
+ - Una vegada la carta està marcada com a enviada, l'usuari podrà introduir el codi i verificar-se.
31
+ direct: Directe
32
+ help: Ajuda
33
+ id_documents:
34
+ explanation: Carrega els teus documents d'identitat per a que puguem comprovar la teva identitat
35
+ name: Documents d'identitat
36
+ multistep: Amb múltiples passos
37
+ name: Nom
38
+ postal_letter:
39
+ explanation: T'enviarem una carta postal amb un codi que hauràs d'introduir perquè puguem verificar la teva adreça
40
+ name: Codi per carta postal
41
+ verifications:
42
+ authorizations:
43
+ create:
44
+ error: S'ha produït un error en crear l'autorització.
45
+ success: Has estat autoritzat amb èxit.
46
+ first_login:
47
+ actions:
48
+ dummy_authorization_handler: Verificar contra l'autorització d'exemple
49
+ dummy_authorization_workflow: Verificar contra l'exemple de flux d'autorització
50
+ id_documents: Verifica't carregant el teu document d'identitat
51
+ postal_letter: Verifica't rebent un codi de verificació per correu postal
52
+ title: Verifica la teva identitat
53
+ verify_with_these_options: 'Aquestes són les opcions disponibles per verificar la teva identitat:'
54
+ new:
55
+ authorize: Enviar
56
+ authorize_with: Verifica amb %{authorizer}
57
+ skip_verification: Pots ometre-ho per ara i %{link}
58
+ start_exploring: comença a explorar
59
+ id_documents:
60
+ admin:
61
+ confirmations:
62
+ create:
63
+ error: La verificació no coincideix. Torna-ho a provar o rebutja la verificació perquè l'usuari pugui modificar-la
64
+ success: S'ha verificat l'usuari correctament
65
+ new:
66
+ introduce_user_data: Introdueix les dades de la imatge
67
+ reject: Rebutjar
68
+ verify: Verificar
69
+ pending_authorizations:
70
+ index:
71
+ title: Verificacions pendents
72
+ verification_number: 'Verificació #%{n}'
73
+ rejections:
74
+ create:
75
+ success: S'ha rebutjat la verificació. Es demanarà a l'usuari que modifiqui els seus documents
76
+ authorizations:
77
+ create:
78
+ error: S'ha produït un problema en penjar el document
79
+ success: Document penjat correctament
80
+ edit:
81
+ being_reviewed: Estem revisant els teus documents. Et verificarem aviat
82
+ rejection_clarity: Assegura't que la informació sigui visible a la imatge carregada
83
+ rejection_correctness: Assegura't que la informació introduïda sigui correcta
84
+ rejection_notice: S'ha produït un problema amb la teva verificació. Siusplau torna-ho a provar
85
+ send: Sol·licita la verificació de nou
86
+ new:
87
+ send: Sol·licita la verificació
88
+ title: Penja el document d'identitat
89
+ update:
90
+ error: S'ha produït un problema en tornar a carregar el document
91
+ success: El document s'ha tornat a carregar correctament
92
+ dni: DNI
93
+ nie: NIE
94
+ passport: Passaport
95
+ postal_letter:
96
+ admin:
97
+ pending_authorizations:
98
+ index:
99
+ address: Adreça
100
+ letter_sent_at: Carta enviada el
101
+ mark_as_sent: Marca com a enviada
102
+ not_yet_sent: Encara no s'ha enviat
103
+ title: Verificacions en curs
104
+ username: Nom d'usuari
105
+ verification_code: Codi de verificació
106
+ postages:
107
+ create:
108
+ error: S'ha produït un error en marcar la carta com a enviada
109
+ success: La carta s'ha marcat com a enviada correctament
110
+ authorizations:
111
+ create:
112
+ error: S'ha produït un problema amb la teva sol·licitud
113
+ success: Gràcies! Enviarem un codi de verificació a la teva adreça
114
+ edit:
115
+ send: Confirmar
116
+ title: Introduïeix el codi de verificació que has rebut
117
+ waiting_for_letter: En breu enviarem una carta a la teva adreça amb el teu codi de verificació
118
+ new:
119
+ send: Envia'm una carta
120
+ title: Sol·licita el teu codi de verificació
121
+ update:
122
+ error: El teu codi de verificació no coincideix amb el nostre. Si us plau, revisa la carta que t'hem enviat
123
+ success: Felicitats. T'has verificat correctament
124
+ errors:
125
+ messages:
126
+ uppercase_only_letters_numbers: ha d'estar en majúscules i contenir lletres i/o nombres
@@ -0,0 +1,126 @@
1
+ ---
2
+ en:
3
+ activemodel:
4
+ attributes:
5
+ id_document_information:
6
+ document_number: Document number (with letter)
7
+ document_type: Type of the document
8
+ id_document_upload:
9
+ document_number: Document number (with letter)
10
+ document_type: Type of your document
11
+ user: User
12
+ verification_attachment: Scanned copy of your document
13
+ decidim:
14
+ admin:
15
+ menu:
16
+ authorization_workflows: Verifications
17
+ authorization_handlers:
18
+ admin:
19
+ id_documents:
20
+ help:
21
+ - Users fill in their identity information and upload a copy of their document.
22
+ - You fill in the information present in the uploaded image.
23
+ - The information should match whatever the user filled in.
24
+ - If you can't clearly see the information or you can't get it verified, you can reject the request and the user will be able to fix it.
25
+ postal_letter:
26
+ help:
27
+ - Users request a verification code to be sent to their address.
28
+ - You send the letter to their address with the verification code.
29
+ - You mark the letter as sent.
30
+ - Once you mark the letter as sent, the user will be able to introduce the code and get verified.
31
+ direct: Direct
32
+ help: Help
33
+ id_documents:
34
+ explanation: Upload your identity documents so we can check your identity
35
+ name: Identity documents
36
+ multistep: Multi-Step
37
+ name: Name
38
+ postal_letter:
39
+ explanation: We'll send you a postal letter with a code that you'll have to enter so we can verify your address
40
+ name: Code by postal letter
41
+ verifications:
42
+ authorizations:
43
+ create:
44
+ error: There was an error creating the authorization.
45
+ success: You've been successfully authorized.
46
+ first_login:
47
+ actions:
48
+ dummy_authorization_handler: Verify against the example authorization handler
49
+ dummy_authorization_workflow: Verify against the example authorization workflow
50
+ id_documents: Get verified by uploading your identity document
51
+ postal_letter: Get verified by receiving a verification code through postal mail
52
+ title: Verify your identity
53
+ verify_with_these_options: 'These are the available options to verify your identity:'
54
+ new:
55
+ authorize: Send
56
+ authorize_with: Verify with %{authorizer}
57
+ skip_verification: You can skip this for now and %{link}
58
+ start_exploring: start exploring
59
+ id_documents:
60
+ admin:
61
+ confirmations:
62
+ create:
63
+ error: Verification doesn't match. Try again or reject the verification so the user can amend it
64
+ success: User successfully verified
65
+ new:
66
+ introduce_user_data: Introduce the data in the picture
67
+ reject: Reject
68
+ verify: Verify
69
+ pending_authorizations:
70
+ index:
71
+ title: Pending verifications
72
+ verification_number: 'Verification #%{n}'
73
+ rejections:
74
+ create:
75
+ success: Verification rejected. User will be prompted to amend her documents
76
+ authorizations:
77
+ create:
78
+ error: There was a problem uploading your document
79
+ success: Document uploaded successfully
80
+ edit:
81
+ being_reviewed: We're reviewing your documents. You'll be verified shortly
82
+ rejection_clarity: Make sure the information is clearly visible in the uploaded image
83
+ rejection_correctness: Make sure the information entered is correct
84
+ rejection_notice: There was a problem with your verification. Please try again
85
+ send: Request verification again
86
+ new:
87
+ send: Request verification
88
+ title: Upload your identity document
89
+ update:
90
+ error: There was a problem reuploading your document
91
+ success: Document reuploaded successfully
92
+ dni: DNI
93
+ nie: NIE
94
+ passport: Passport
95
+ postal_letter:
96
+ admin:
97
+ pending_authorizations:
98
+ index:
99
+ address: Address
100
+ letter_sent_at: Letter sent at
101
+ mark_as_sent: Mark as sent
102
+ not_yet_sent: Not yet sent
103
+ title: Ongoing verifications
104
+ username: Username
105
+ verification_code: Verification code
106
+ postages:
107
+ create:
108
+ error: Error marking letter as sent
109
+ success: Letter successfully marked as sent
110
+ authorizations:
111
+ create:
112
+ error: There was a problem with your request
113
+ success: Thanks! We'll send a verification code to your address
114
+ edit:
115
+ send: Confirm
116
+ title: Introduce the verification code you received
117
+ waiting_for_letter: We'll be sending a letter to your address with your verification code soon
118
+ new:
119
+ send: Send me a letter
120
+ title: Request your verification code
121
+ update:
122
+ error: Your verification code doesn't match ours. Please double-check the letter we sent to you
123
+ success: Congratulations. You've been successfully verified
124
+ errors:
125
+ messages:
126
+ uppercase_only_letters_numbers: must be all uppercase and contain only letters and/or numbers