decidim-direct_verifications 1.0.1 → 1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +24 -0
  3. data/app/commands/decidim/direct_verifications/verification/create_import.rb +19 -10
  4. data/app/controllers/concerns/decidim/direct_verifications/admin/needs_verification_snippets.rb +61 -0
  5. data/app/controllers/decidim/direct_verifications/verification/admin/application_controller.rb +15 -0
  6. data/app/controllers/decidim/direct_verifications/verification/admin/authorizations_controller.rb +3 -1
  7. data/app/controllers/decidim/direct_verifications/verification/admin/direct_verifications_controller.rb +1 -1
  8. data/app/controllers/decidim/direct_verifications/verification/admin/imports_controller.rb +1 -1
  9. data/app/controllers/decidim/direct_verifications/verification/admin/stats_controller.rb +2 -2
  10. data/app/controllers/decidim/direct_verifications/verification/admin/user_authorizations_controller.rb +64 -0
  11. data/app/jobs/decidim/direct_verifications/authorize_users_job.rb +2 -0
  12. data/app/jobs/decidim/direct_verifications/base_import_job.rb +22 -6
  13. data/app/jobs/decidim/direct_verifications/register_users_job.rb +1 -0
  14. data/app/jobs/decidim/direct_verifications/revoke_users_job.rb +1 -0
  15. data/app/packs/entrypoints/decidim_direct_verifications.js +4 -0
  16. data/app/packs/entrypoints/decidim_direct_verifications.scss +1 -0
  17. data/app/packs/entrypoints/decidim_direct_verifications_participants.js +1 -0
  18. data/app/packs/src/decidim/direct_verifications/admin/checkboxes.js +5 -0
  19. data/app/packs/src/decidim/direct_verifications/admin/participants.js +88 -0
  20. data/app/{assets/stylesheets/decidim/direct_verifications → packs/stylesheets/decidim/direct_verifications/admin}/authorizations.scss +1 -1
  21. data/app/permissions/decidim/direct_verifications/admin/permissions.rb +19 -0
  22. data/app/views/decidim/direct_verifications/verification/admin/authorizations/index.html.erb +2 -1
  23. data/app/views/decidim/direct_verifications/verification/admin/direct_verifications/index.html.erb +1 -1
  24. data/app/views/decidim/direct_verifications/verification/admin/imports/new.html.erb +1 -1
  25. data/app/views/decidim/direct_verifications/verification/admin/stats/index.html.erb +3 -1
  26. data/app/views/decidim/direct_verifications/verification/admin/user_authorizations/show.html.erb +27 -0
  27. data/config/assets.rb +25 -0
  28. data/config/locales/ca.yml +14 -29
  29. data/config/locales/cs.yml +25 -18
  30. data/config/locales/en.yml +35 -17
  31. data/config/locales/es.yml +14 -28
  32. data/config/locales/fr.yml +26 -22
  33. data/lib/decidim/direct_verifications/parsers/metadata_parser.rb +5 -11
  34. data/lib/decidim/direct_verifications/verification/admin.rb +2 -0
  35. data/lib/decidim/direct_verifications/verification/admin_engine.rb +9 -5
  36. data/lib/decidim/direct_verifications/version.rb +3 -3
  37. data/lib/decidim/direct_verifications.rb +6 -0
  38. data/package.json +192 -0
  39. metadata +19 -10
  40. data/app/assets/config/direct_verifications_admin_manifest.css +0 -3
  41. data/app/assets/config/direct_verifications_admin_manifest.js +0 -1
  42. data/app/assets/javascripts/decidim/direct_verifications/verification/admin/direct_verifications_admin.js.es6 +0 -7
@@ -1,4 +1,3 @@
1
- ---
2
1
  ca:
3
2
  decidim:
4
3
  admin:
@@ -11,10 +10,10 @@ ca:
11
10
  admin:
12
11
  direct_verifications:
13
12
  help:
14
- - 'Permet la introducció massiva de participants per tal de:'
15
- - Registrar-les directament a la organització amb l'enviament d'invitacions
16
- - Verificar-les amb qualsevol mètode de verificació actiu
17
- - Revocar la verificació amb qualsevol mètode de verificació actiu
13
+ - 'Permet la introducció massiva de participants per tal de:'
14
+ - Registrar-les directament a la organització amb l'enviament d'invitacions
15
+ - Verificar-les amb qualsevol mètode de verificació actiu
16
+ - Revocar la verificació amb qualsevol mètode de verificació actiu
18
17
  direct_verifications:
19
18
  explanation: Verificació manual per part de les administradores de l'organització
20
19
  name: Verificació directa
@@ -31,33 +30,21 @@ ca:
31
30
  user_name: Nom de la participant
32
31
  direct_verifications:
33
32
  create:
34
- authorized: S'han verificat correctament %{authorized} participants utilitzant
35
- [%{handler}] (%{count} detectats, %{errors} errors)
36
- info: S'han detectat %{count} participants, de les quals %{registered} estan
37
- registrades, %{authorized} autoritzades utilitzant [%{handler}] (%{unconfirmed}
38
- sense confirmar)
33
+ authorized: "S'han verificat correctament %{authorized} participants utilitzant [%{handler}] (%{count} detectats, %{errors} errors)"
34
+ info: "S'han detectat %{count} participants, de les quals %{registered} estan registrades, %{authorized} autoritzades utilitzant [%{handler}] (%{unconfirmed} sense confirmar)"
39
35
  missing_header: Si us plau, proporcioneu una fila d'encapçalament
40
- registered: S'han registrat correctament %{registered} participants (%{count}
41
- detectades, %{errors} errors)
42
- revoked: S'ha revocat correctament la verificació de %{revoked} participants
43
- utilitzant [%{handler}] (%{count} detectades, %{errors} errors)
44
- gdpr_disclaimer: Feu-ho sota la vostra responsabilitat. Recordeu que heu
45
- de tenir el consentiment explícit de les vostres participants per a registrar-les.
46
- En cas contrari, estareu infringint la regulació GDPR als països de
47
- la UE.
36
+ registered: "S'han registrat correctament %{registered} participants (%{count} detectades, %{errors} errors)"
37
+ revoked: S'ha revocat correctament la verificació de %{revoked} participants utilitzant [%{handler}] (%{count} detectades, %{errors} errors)
38
+ gdpr_disclaimer: Feu-ho sota la vostra responsabilitat. Recordeu que heu de tenir el consentiment explícit de les vostres participants per a registrar-les. En cas contrari, estareu infringint la regulació GDPR als països de la UE.
48
39
  imports:
49
40
  create:
50
41
  error: No s'ha pogut importar el fitxer
51
42
  success: S'ha importat el fitxer. Rebràs un email quan totes les participants hagin estat importades.
52
43
  mailer:
53
- authorized: "%{successful} participants han estat verificades utilitzant
54
- [%{handler}] (%{count} detectades, %{errors} errors)"
55
- info: "%{count} participants detectades, de les quals %{registered} estan registrades,
56
- %{authorized} autoritzades utilitzant [%{handler}] (%{unconfirmed} sense confirmar)"
57
- registered: "%{successful} participants han estat registrades (%{count}
58
- detectades, %{errors} errors) "
59
- revoked: S'ha revocat correctament la verificació de %{successful} participants utilitzant
60
- [%{handler}] (%{count} detectades, %{errors} errors)
44
+ authorized: "%{successful} participants han estat verificades utilitzant [%{handler}] (%{count} detectades, %{errors} errors)"
45
+ info: "%{count} participants detectades, de les quals %{registered} estan registrades, %{authorized} autoritzades utilitzant [%{handler}] (%{unconfirmed} sense confirmar)"
46
+ registered: "%{successful} participants han estat registrades (%{count} detectades, %{errors} errors) "
47
+ revoked: S'ha revocat correctament la verificació de %{successful} participants utilitzant [%{handler}] (%{count} detectades, %{errors} errors)
61
48
  subject: Resultats de la importació
62
49
  new:
63
50
  file: Fitxer CSV amb dades de participants
@@ -71,9 +58,7 @@ ca:
71
58
  authorization_handler: Mètode de verificació
72
59
  authorize: Autoritza les participants
73
60
  check: Comprova l'estat de les participants
74
- info_html: Pots <a href=%{link}>importar un fitxer CSV</a> o introduir els emails
75
- aquí, un per línia. Si els emails estan precedits
76
- per un text, aquest s'interpretarà com el nom de la participant
61
+ info_html: Pots <a href=%{link}>importar un fitxer CSV</a> o introduir els emails aquí, un per línia. Si els emails estan precedits per un text, aquest s'interpretarà com el nom de la participant
77
62
  register: Registra les participants a la plataforma (si existeixen s'ignoraran)
78
63
  revoke: Revoca l'autorització de les participants
79
64
  submit: Envia i processa el llistat
@@ -1,4 +1,3 @@
1
- ---
2
1
  cs:
3
2
  decidim:
4
3
  admin:
@@ -11,10 +10,10 @@ cs:
11
10
  admin:
12
11
  direct_verifications:
13
12
  help:
14
- - 'Umožňuje masivní zavedení uživatelů:'
15
- - Přímá registrace v organizaci a odeslání pozvánek
16
- - Ověřit je pomocí jakékoliv metody aktivního ověření
17
- - Zrušit jejich ověření pomocí jakékoli metody aktivního ověření
13
+ - 'Umožňuje masivní zavedení uživatelů:'
14
+ - Přímá registrace v organizaci a odeslání pozvánek
15
+ - Ověřit je pomocí jakékoliv metody aktivního ověření
16
+ - Zrušit jejich ověření pomocí jakékoli metody aktivního ověření
18
17
  direct_verifications:
19
18
  explanation: Ruční ověření správcem organizace
20
19
  name: Přímé ověření
@@ -31,17 +30,26 @@ cs:
31
30
  user_name: Uživatelské jméno
32
31
  direct_verifications:
33
32
  create:
34
- authorized: "%{authorized} uživatelů bylo úspěšně ověřeno pomocí [%{handler}]
35
- (%{count} detekováno, %{errors} chyb)"
36
- info: Zjištěno %{count} uživatelů, z nichž %{registered} jsou registrováni,
37
- %{authorized} autorizováni pomocí [%{handler}] (%{unconfirmed} nepotvrzeno)
38
- registered: "%{registered} uživatelů bylo úspěšně zaregistrováno (%{count}
39
- detekováno, %{errors} chyb) "
40
- revoked: Ověření od %{revoked} uživatelů bylo zrušeno pomocí [%{handler}]
41
- (%{count} detekováno, %{errors} chyb)
42
- gdpr_disclaimer: Udělejte to v rámci vaší odpovědnosti. Nezapomeňte, že
43
- potřebujete mít výslovný souhlas svých uživatelů, abyste je mohli zaregistrovat.
44
- V opačném případě můžete porušovat nařízení o GDPR v zemích EU.
33
+ authorized: "%{authorized} uživatelů bylo úspěšně ověřeno pomocí [%{handler}] (%{count} detekováno, %{errors} chyb)"
34
+ info: "Zjištěno %{count} uživatelů, z nichž %{registered} jsou registrováni, %{authorized} autorizováni pomocí [%{handler}] (%{unconfirmed} nepotvrzeno)"
35
+ missing_header: Zadejte řádek záhlaví
36
+ registered: "%{registered} uživatelů bylo úspěšně zaregistrováno (%{count} detekováno, %{errors} chyb) "
37
+ revoked: Ověření od %{revoked} uživatelů bylo zrušeno pomocí [%{handler}] (%{count} detekováno, %{errors} chyb)
38
+ gdpr_disclaimer: Udělejte to v rámci vaší odpovědnosti. Nezapomeňte, že potřebujete mít výslovný souhlas svých uživatelů, abyste je mohli zaregistrovat. V opačném případě můžete porušovat nařízení o GDPR v zemích EU.
39
+ imports:
40
+ create:
41
+ error: Při importu souboru došlo k chybě
42
+ success: Soubor byl úspěšně nahrán. budou importováni všichni účastníci, pošleme vám e-mail.
43
+ mailer:
44
+ authorized: "%{successful} účastníků bylo úspěšně ověřeno pomocí [%{handler}] (%{count} detekováno, %{errors} chyby)"
45
+ info: "%{count} účastníků detekováno, z toho %{registered} jsou registrováni, %{authorized} povoleno pomocí [%{handler}] (%{unconfirmed} nepotvrzeno)"
46
+ registered: "%{successful} účastníků bylo úspěšně registrováno (%{count} detekováno, %{errors} chyb) "
47
+ revoked: Ověření od %{successful} účastníků bylo zrušeno pomocí [%{handler}] (%{count} detekováno, %{errors} chyby)
48
+ subject: Výsledky importu souboru
49
+ new:
50
+ file: Soubor CSV s daty účastníků
51
+ info: Importovat CSV soubor s účastníkem na řádku, který zkopíruje formát z příkladu
52
+ submit: Nahrát soubor
45
53
  index:
46
54
  authorizations: Autorizovaní uživatelé
47
55
  stats: Statistiky uživatelů
@@ -50,8 +58,7 @@ cs:
50
58
  authorization_handler: Ověřovací metoda
51
59
  authorize: Autorizovat uživatele
52
60
  check: Zkontrolovat stav uživatelů
53
- info: Zadejte e-maily zde, jeden na řádek. Pokud e-mailům předchází text,
54
- bude interpretován jako jméno uživatele
61
+ info_html: Můžete <a href=%{link}>importovat CSV</a> nebo zde zadat e-maily, jedno na řádek. Pokud e-mailům předchází text, bude interpretován jako jméno účastníka.
55
62
  register: Registrovat uživatele na platformě (pokud existují, budou ignorováni)
56
63
  revoke: Zrušit autorizaci od uživatelů
57
64
  submit: Odeslat a zpracovat seznam
@@ -19,6 +19,11 @@ en:
19
19
  explanation: Manual verification by the administrators of the organization
20
20
  name: Direct verification
21
21
  direct_verifications:
22
+ participants:
23
+ modal:
24
+ button_title: See authorizations
25
+ modal_close_button: Close
26
+ modal_title: Available authorizations
22
27
  verification:
23
28
  admin:
24
29
  authorizations:
@@ -31,37 +36,37 @@ en:
31
36
  user_name: Participant name
32
37
  direct_verifications:
33
38
  create:
34
- authorized: "%{authorized} participants have been successfully verified using
35
- [%{handler}] (%{count} detected, %{errors} errors)"
39
+ authorized: "%{authorized} participants have been successfully verified
40
+ using [%{handler}] (%{count} detected, %{errors} errors)"
36
41
  info: "%{count} participants detected, of which %{registered} are registered,
37
42
  %{authorized} authorized using [%{handler}] (%{unconfirmed} unconfirmed)"
38
43
  missing_header: Please, provide a header row
39
- registered: "%{registered} participants have been successfully registered (%{count}
40
- detected, %{errors} errors) "
41
- revoked: Verification from %{revoked} participants have been revoked using
42
- [%{handler}] (%{count} detected, %{errors} errors)
44
+ registered: "%{registered} participants have been successfully registered
45
+ (%{count} detected, %{errors} errors) "
46
+ revoked: Verification from %{revoked} participants have been revoked
47
+ using [%{handler}] (%{count} detected, %{errors} errors)
43
48
  gdpr_disclaimer: Do this under your responsibility. Remember that you
44
- need to have explicit consent from your participants in order to register them.
45
- Otherwise you will be infringing the GDPR regulation in EU countries.
49
+ need to have explicit consent from your participants in order to register
50
+ them. Otherwise you will be infringing the GDPR regulation in EU countries.
46
51
  imports:
47
52
  create:
48
53
  error: There was an error importing the file
49
54
  success: File successfully uploaded. We'll email you when all participants
50
55
  are imported.
51
56
  mailer:
52
- authorized: "%{successful} participants have been successfully verified using
53
- [%{handler}] (%{count} detected, %{errors} errors)"
57
+ authorized: "%{successful} participants have been successfully verified
58
+ using [%{handler}] (%{count} detected, %{errors} errors)"
54
59
  info: "%{count} participants detected, of which %{registered} are registered,
55
60
  %{authorized} authorized using [%{handler}] (%{unconfirmed} unconfirmed)"
56
- registered: "%{successful} participants have been successfully registered (%{count}
57
- detected, %{errors} errors) "
58
- revoked: Verification from %{successful} participants have been revoked using
59
- [%{handler}] (%{count} detected, %{errors} errors)
61
+ registered: "%{successful} participants have been successfully registered
62
+ (%{count} detected, %{errors} errors) "
63
+ revoked: Verification from %{successful} participants have been revoked
64
+ using [%{handler}] (%{count} detected, %{errors} errors)
60
65
  subject: File import results
61
66
  new:
62
67
  file: CSV file with participants data
63
- info: Import a CSV file with a participant entry per line copying the format
64
- from the example below
68
+ info: Import a CSV file with a participant entry per line copying the
69
+ format from the example below
65
70
  submit: Upload file
66
71
  index:
67
72
  authorizations: Authorized participants
@@ -74,7 +79,8 @@ en:
74
79
  info_html: You can <a href=%{link}>import a CSV</a> or enter the emails
75
80
  here, one per line. If the emails are preceded by a text, it will be
76
81
  interpreted as the participant's name.
77
- register: Register participants in the platform (if they exist they will be ignored)
82
+ register: Register participants in the platform (if they exist they will
83
+ be ignored)
78
84
  revoke: Revoke authorization from participants
79
85
  submit: Send and process the list
80
86
  textarea: Emails list
@@ -85,6 +91,18 @@ en:
85
91
  global: "- Any verification method -"
86
92
  registered: Registered
87
93
  unconfirmed: Unconfirmed
94
+ user_authorizations:
95
+ destroy:
96
+ error: Error while trying to delete the authorization %{name} (%{message})
97
+ success: Authorization %{name} deleted successfully
98
+ show:
99
+ grant: Authorize user with this method
100
+ granted: Granted
101
+ not_granted: Not granted
102
+ revoke: Revoke the authorization
103
+ update:
104
+ error: Error while trying to authorize the user using %{name}
105
+ success: User authorized successfully using %{name}
88
106
  authorizations:
89
107
  new:
90
108
  no_action: This method requires an administrator that verifies you
@@ -1,4 +1,3 @@
1
- ---
2
1
  es:
3
2
  decidim:
4
3
  admin:
@@ -11,10 +10,10 @@ es:
11
10
  admin:
12
11
  direct_verifications:
13
12
  help:
14
- - 'Permite la introducción masiva de participantes con el fin de:'
15
- - Registrarlas directamente en la organización con el envío de invitaciones
16
- - Verificarlas con cualquier método de verificación activo
17
- - Revocar la verificación con cualquier método de verificación activo
13
+ - 'Permite la introducción masiva de participantes con el fin de:'
14
+ - Registrarlas directamente en la organización con el envío de invitaciones
15
+ - Verificarlas con cualquier método de verificación activo
16
+ - Revocar la verificación con cualquier método de verificación activo
18
17
  direct_verifications:
19
18
  explanation: Verificación manual por parte de las administradoras de la organización
20
19
  name: Verificación directa
@@ -31,33 +30,21 @@ es:
31
30
  user_name: Nombre de la participante
32
31
  direct_verifications:
33
32
  create:
34
- authorized: Se han verificado correctamente %{authorized} participantes usando
35
- [%{handler}] (%{count} detectadas, %{errors} errores)
36
- info: Se han detectado %{count} participantes, de las cuales %{registered}
37
- están registradas, %{authorized} autorizadas usando [%{handler}] (%{unconfirmed}
38
- sin confirmar)
33
+ authorized: "Se han verificado correctamente %{authorized} participantes usando [%{handler}] (%{count} detectadas, %{errors} errores)"
34
+ info: "Se han detectado %{count} participantes, de las cuales %{registered} están registradas, %{authorized} autorizadas usando [%{handler}] (%{unconfirmed} sin confirmar)"
39
35
  missing_header: Por favor, proporciona una fila de encabezamiento
40
- registered: Se han registrado correctamente %{registered} participantes (%{count}
41
- detectadas, %{errors} errores)
42
- revoked: Se ha revocado correctamente la verificación de %{revoked} participantes
43
- usando [%{handler}] (%{count} detectadas, %{errors} errores)
44
- gdpr_disclaimer: Haz esto bajo tu responsabilidad. Recuerda que debes
45
- contar con el consentimiento explícito de las participantes para poder registrarlas.
46
- De lo contrario, estarás infringiendo la regulación GDPR en los países
47
- de la UE.
36
+ registered: "Se han registrado correctamente %{registered} participantes (%{count} detectadas, %{errors} errores)"
37
+ revoked: Se ha revocado correctamente la verificación de %{revoked} participantes usando [%{handler}] (%{count} detectadas, %{errors} errores)
38
+ gdpr_disclaimer: Haz esto bajo tu responsabilidad. Recuerda que debes contar con el consentimiento explícito de las participantes para poder registrarlas. De lo contrario, estarás infringiendo la regulación GDPR en los países de la UE.
48
39
  imports:
49
40
  create:
50
41
  error: Ha habido un error al importar el archivo.
51
42
  success: Se ha importado el archivo. Recibirás un email cuando todas las participantes hayan sido importadas.
52
43
  mailer:
53
- authorized: "%{successful} participantes han sido verificadas usando
54
- [%{handler}] (%{count} detectades, %{errors} errores)"
55
- info: "%{count} participantes detectadas, de las cuales %{registered} están registradas,
56
- %{authorized} autorizadas usando [%{handler}] (%{unconfirmed} sin confirmar)"
57
- registered: "%{successful} participantes han sido registradas (%{count}
58
- detectadas, %{errors} errores) "
59
- revoked: Se ha revocado correctamente la verificación de %{successful} participantes usando
60
- [%{handler}] (%{count} detectadas, %{errors} errores)
44
+ authorized: "%{successful} participantes han sido verificadas usando [%{handler}] (%{count} detectades, %{errors} errores)"
45
+ info: "%{count} participantes detectadas, de las cuales %{registered} están registradas, %{authorized} autorizadas usando [%{handler}] (%{unconfirmed} sin confirmar)"
46
+ registered: "%{successful} participantes han sido registradas (%{count} detectadas, %{errors} errores) "
47
+ revoked: Se ha revocado correctamente la verificación de %{successful} participantes usando [%{handler}] (%{count} detectadas, %{errors} errores)
61
48
  subject: Resultados de la importación
62
49
  new:
63
50
  file: Archivo CSV con datos de participantes
@@ -71,8 +58,7 @@ es:
71
58
  authorization_handler: Método de verificación
72
59
  authorize: Autoriza las participantes
73
60
  check: Comprueba el estado de las participantes
74
- info_html: Puedes <a href=%{link}>importar un fichero CSV</a> o introducir aquí los emails, uno por linea. Si los emails están precedidos
75
- por un texto, éste se interpretará como el nombre de la participante
61
+ info_html: Puedes <a href=%{link}>importar un fichero CSV</a> o introducir aquí los emails, uno por linea. Si los emails están precedidos por un texto, éste se interpretará como el nombre de la participante
76
62
  register: Registra las participantes a la plataforma (si existen se ignorarán)
77
63
  revoke: Revoca la autorización de las participantes
78
64
  submit: Envía y procesa el listado
@@ -1,4 +1,3 @@
1
- ---
2
1
  fr:
3
2
  decidim:
4
3
  admin:
@@ -11,10 +10,10 @@ fr:
11
10
  admin:
12
11
  direct_verifications:
13
12
  help:
14
- - 'Permet l''introduction massive des utilisateurs afin de :'
15
- - Inscription directe au sein de l'organisation et envoie des invitations
16
- - Vérifiez-les avec n'importe quelle méthode de vérification active
17
- - Révoquer leur vérification dans toute méthode de vérification active
13
+ - 'Permet l''introduction massive des utilisateurs afin de :'
14
+ - Inscription directe au sein de l'organisation et envoie des invitations
15
+ - Vérifiez-les avec n'importe quelle méthode de vérification active
16
+ - Révoquer leur vérification dans toute méthode de vérification active
18
17
  direct_verifications:
19
18
  explanation: Vérification manuelle par les administrateurs de l'organisation
20
19
  name: Vérification directe
@@ -31,19 +30,26 @@ fr:
31
30
  user_name: Nom de l'utilisateur
32
31
  direct_verifications:
33
32
  create:
34
- authorized: "%{authorized} utilisateurs ont été vérifiés avec succès
35
- en utilisant [%{handler}] (%{count} détectés, %{errors} erreurs)"
36
- info: "%{count} utilisateurs détectés, dont %{registered} sont enregistrés,
37
- %{authorized} autorisés à utiliser [%{handler}] (%{unconfirmed} non
38
- confirmés)"
39
- registered: "%{registered} utilisateurs ont été enregistrés avec succès
40
- (%{count} détectés, %{errors} erreurs) "
41
- revoked: La vérification de %{revoked} utilisateurs ont été révoqués
42
- en utilisant [%{handler}] (%{count} détectés, %{errors} erreurs)
43
- gdpr_disclaimer: Faites-le sous votre responsabilité. N'oubliez pas que
44
- vous devez avoir le consentement explicite de vos utilisateurs afin
45
- de les enregistrer. Dans le cas contraire, vous enfreindrez le règlement
46
- du RGPD dans les pays de l'UE.
33
+ authorized: "%{authorized} utilisateurs ont été vérifiés avec succès en utilisant [%{handler}] (%{count} détectés, %{errors} erreurs)"
34
+ info: "%{count} utilisateurs détectés, dont %{registered} sont enregistrés, %{authorized} autorisés à utiliser [%{handler}] (%{unconfirmed} non confirmés)"
35
+ missing_header: Please, provide a header row
36
+ registered: "%{registered} utilisateurs ont été enregistrés avec succès (%{count} détectés, %{errors} erreurs) "
37
+ revoked: La vérification de %{revoked} utilisateurs ont été révoqués en utilisant [%{handler}] (%{count} détectés, %{errors} erreurs)
38
+ gdpr_disclaimer: Faites-le sous votre responsabilité. N'oubliez pas que vous devez avoir le consentement explicite de vos utilisateurs afin de les enregistrer. Dans le cas contraire, vous enfreindrez le règlement du RGPD dans les pays de l'UE.
39
+ imports:
40
+ create:
41
+ error: There was an error importing the file
42
+ success: File successfully uploaded. We'll email you when all participants are imported.
43
+ mailer:
44
+ authorized: "%{successful} participants have been successfully verified using [%{handler}] (%{count} detected, %{errors} errors)"
45
+ info: "%{count} participants detected, of which %{registered} are registered, %{authorized} authorized using [%{handler}] (%{unconfirmed} unconfirmed)"
46
+ registered: "%{successful} participants have been successfully registered (%{count} detected, %{errors} errors) "
47
+ revoked: Verification from %{successful} participants have been revoked using [%{handler}] (%{count} detected, %{errors} errors)
48
+ subject: File import results
49
+ new:
50
+ file: CSV file with participants data
51
+ info: Import a CSV file with a participant entry per line copying the format from the example below
52
+ submit: Upload file
47
53
  index:
48
54
  authorizations: Utilisateurs autorisés
49
55
  stats: Statistiques des utilisateurs
@@ -52,10 +58,8 @@ fr:
52
58
  authorization_handler: Méthode de vérification
53
59
  authorize: Utilisateurs autorisés
54
60
  check: Vérifier le statut des utilisateurs
55
- info: Entrez les e-mails ici, un par ligne. Si les e-mails sont précédés
56
- d'un texte, il sera interprété comme le nom de l'utilisateur
57
- register: Inscrire des utilisateurs sur la plateforme (si ils existent,
58
- ils seront ignorés)
61
+ info_html: You can <a href=%{link}>import a CSV</a> or enter the emails here, one per line. If the emails are preceded by a text, it will be interpreted as the participant's name.
62
+ register: Inscrire des utilisateurs sur la plateforme (si ils existent, ils seront ignorés)
59
63
  revoke: Révoquer l'autorisation des utilisateurs
60
64
  submit: Envoyer et traiter la liste
61
65
  textarea: Liste d'emails
@@ -10,9 +10,9 @@ module Decidim
10
10
 
11
11
  def header
12
12
  @header ||= begin
13
- header_row = lines[0].chomp
14
- header_row = tokenize(header_row)
15
- normalize_header(header_row)
13
+ raise InputParserError, I18n.t("#{I18N_SCOPE}.create.missing_header") if lines.count <= 1
14
+
15
+ tokenize(lines[0].chomp).map { |h| h.to_s.downcase }
16
16
  end
17
17
  end
18
18
 
@@ -25,6 +25,8 @@ module Decidim
25
25
 
26
26
  hash = {}
27
27
  header.each_with_index do |column, index|
28
+ next if column.blank?
29
+
28
30
  value = tokens[index]
29
31
  next if value&.include?(email)
30
32
 
@@ -40,14 +42,6 @@ module Decidim
40
42
  token&.strip
41
43
  end
42
44
  end
43
-
44
- def normalize_header(line)
45
- line.map do |field|
46
- raise InputParserError, I18n.t("#{I18N_SCOPE}.create.missing_header") if field.nil?
47
-
48
- field.to_sym.downcase
49
- end
50
- end
51
45
  end
52
46
  end
53
47
  end
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Decidim
4
4
  module DirectVerifications
5
+ module Admin
6
+ end
5
7
  module Verification
6
8
  # This module contains all the domain logic associated to Decidim's DirectVerifications
7
9
  # component admin panel.
@@ -12,15 +12,19 @@ module Decidim
12
12
  resources :stats, only: [:index]
13
13
  resources :authorizations, only: [:index, :destroy]
14
14
  resources :imports, only: [:new, :create]
15
+ resources :user_authorizations, only: [:show, :update, :destroy]
15
16
 
16
17
  root to: "direct_verifications#index"
17
18
  end
18
19
 
19
- initializer "decidim_direct_verifications.admin_assets" do |app|
20
- app.config.assets.precompile += %w(
21
- direct_verifications_admin_manifest.js
22
- direct_verifications_admin_manifest.css
23
- )
20
+ config.after_initialize do
21
+ if Decidim::DirectVerifications.participants_modal.present?
22
+ Decidim::Admin::OfficializationsController.include(Decidim::DirectVerifications::Admin::NeedsVerificationSnippets)
23
+ end
24
+ end
25
+
26
+ initializer "decidim_notify.webpacker.assets_path" do
27
+ Decidim.register_assets_path File.expand_path("app/packs", root)
24
28
  end
25
29
  end
26
30
  end
@@ -3,8 +3,8 @@
3
3
  module Decidim
4
4
  # This holds the decidim-direct_verifications version.
5
5
  module DirectVerifications
6
- VERSION = "1.0.1"
7
- DECIDIM_VERSION = "0.24.3"
8
- MIN_DECIDIM_VERSION = ">= 0.23.0"
6
+ VERSION = "1.2"
7
+ DECIDIM_VERSION = "0.26.1"
8
+ MIN_DECIDIM_VERSION = ">= 0.25.0"
9
9
  end
10
10
  end
@@ -28,6 +28,12 @@ module Decidim
28
28
  :name_parser
29
29
  end
30
30
 
31
+ # add a button to the participants list to be able to handle verifications from there
32
+ # Manageable Verifications need to be registered in :manage_workflows
33
+ config_accessor :participants_modal do
34
+ true
35
+ end
36
+
31
37
  def self.find_parser_class(manifest)
32
38
  "Decidim::DirectVerifications::Parsers::#{manifest.to_s.camelize}".safe_constantize || Decidim::DirectVerifications::Parsers::NameParser
33
39
  end