decidim-templates 0.27.5 → 0.28.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/commands/decidim/templates/admin/apply_questionnaire_template.rb +1 -1
- data/app/commands/decidim/templates/admin/copy_proposal_answer_template.rb +21 -0
- data/app/commands/decidim/templates/admin/copy_questionnaire_template.rb +3 -33
- data/app/commands/decidim/templates/admin/copy_template.rb +43 -0
- data/app/commands/decidim/templates/admin/create_block_user_template.rb +15 -0
- data/app/commands/decidim/templates/admin/create_proposal_answer_template.rb +47 -0
- data/app/commands/decidim/templates/admin/create_questionnaire_template.rb +6 -19
- data/app/commands/decidim/templates/admin/create_template.rb +54 -0
- data/app/commands/decidim/templates/admin/destroy_questionnaire_template.rb +22 -0
- data/app/commands/decidim/templates/admin/update_proposal_answer_template.rb +51 -0
- data/app/commands/decidim/templates/admin/update_template.rb +6 -0
- data/app/controllers/decidim/templates/admin/application_controller.rb +0 -8
- data/app/controllers/decidim/templates/admin/block_user_templates_controller.rb +124 -0
- data/app/controllers/decidim/templates/admin/concerns/templatable.rb +1 -1
- data/app/controllers/decidim/templates/admin/proposal_answer_templates_controller.rb +173 -0
- data/app/controllers/decidim/templates/admin/questionnaire_templates_controller.rb +4 -4
- data/app/forms/decidim/templates/admin/proposal_answer_template_form.rb +23 -0
- data/app/helpers/decidim/templates/admin/application_helper.rb +18 -0
- data/app/models/decidim/templates/template.rb +0 -6
- data/app/packs/entrypoints/decidim_templates_admin.js +2 -0
- data/app/packs/src/decidim/templates/admin/block_user_template_chooser.js +20 -0
- data/app/packs/src/decidim/templates/admin/proposal_answer_template_chooser.js +31 -0
- data/app/packs/stylesheets/decidim/templates/templates.scss +3 -12
- data/app/presenters/decidim/templates/admin_log/template_presenter.rb +2 -2
- data/app/views/decidim/templates/admin/block_user_templates/_form.html.erb +13 -0
- data/app/views/decidim/templates/admin/block_user_templates/_template_chooser.html.erb +12 -0
- data/app/views/decidim/templates/admin/block_user_templates/edit.html.erb +18 -0
- data/app/views/decidim/templates/admin/block_user_templates/index.html.erb +45 -0
- data/app/views/decidim/templates/admin/block_user_templates/new.html.erb +18 -0
- data/app/views/decidim/templates/admin/proposal_answer_templates/_form.html.erb +38 -0
- data/app/views/decidim/templates/admin/proposal_answer_templates/_template_chooser.html.erb +16 -0
- data/app/views/decidim/templates/admin/proposal_answer_templates/edit.html.erb +18 -0
- data/app/views/decidim/templates/admin/proposal_answer_templates/index.html.erb +51 -0
- data/app/views/decidim/templates/admin/proposal_answer_templates/new.html.erb +18 -0
- data/app/views/decidim/templates/admin/questionnaire_templates/_choose.html.erb +35 -35
- data/app/views/decidim/templates/admin/questionnaire_templates/_form.html.erb +9 -12
- data/app/views/decidim/templates/admin/questionnaire_templates/_preview.html.erb +52 -60
- data/app/views/decidim/templates/admin/questionnaire_templates/edit.html.erb +31 -16
- data/app/views/decidim/templates/admin/questionnaire_templates/index.html.erb +6 -8
- data/app/views/decidim/templates/admin/questionnaire_templates/new.html.erb +18 -7
- data/app/views/decidim/templates/admin/questionnaire_templates/preview.js.erb +3 -0
- data/app/views/layouts/decidim/admin/templates.html.erb +1 -9
- data/config/assets.rb +2 -1
- data/config/locales/ar.yml +8 -2
- data/config/locales/ca.yml +47 -8
- data/config/locales/cs.yml +47 -8
- data/config/locales/de.yml +47 -8
- data/config/locales/en.yml +47 -8
- data/config/locales/es-MX.yml +47 -8
- data/config/locales/es-PY.yml +47 -8
- data/config/locales/es.yml +47 -8
- data/config/locales/eu.yml +47 -8
- data/config/locales/fi-plain.yml +47 -8
- data/config/locales/fi.yml +47 -8
- data/config/locales/fr-CA.yml +33 -8
- data/config/locales/fr.yml +47 -8
- data/config/locales/ga-IE.yml +6 -2
- data/config/locales/gl.yml +6 -10
- data/config/locales/hu.yml +6 -10
- data/config/locales/it.yml +6 -10
- data/config/locales/ja.yml +28 -8
- data/config/locales/kaa.yml +4 -1
- data/config/locales/lt.yml +18 -8
- data/config/locales/nl.yml +6 -11
- data/config/locales/no.yml +6 -10
- data/config/locales/pl.yml +6 -10
- data/config/locales/pt-BR.yml +6 -13
- data/config/locales/pt.yml +6 -10
- data/config/locales/ro-RO.yml +18 -8
- data/config/locales/sv.yml +6 -2
- data/config/locales/tr-TR.yml +8 -10
- data/config/locales/zh-CN.yml +6 -11
- data/config/locales/zh-TW.yml +18 -8
- data/db/migrate/20221006055954_add_field_values_and_target_to_decidim_templates.rb +21 -0
- data/db/seeds.rb +6 -6
- data/lib/decidim/templates/admin_engine.rb +22 -17
- data/lib/decidim/templates/engine.rb +4 -0
- data/lib/decidim/templates/menu.rb +48 -0
- data/lib/decidim/templates/test/factories.rb +16 -1
- data/lib/decidim/templates/test/shared_examples/copies_all_questionnaire_contents_examples.rb +3 -3
- data/lib/decidim/templates/test/shared_examples/uses_questionnaire_templates.rb +8 -6
- data/lib/decidim/templates/version.rb +1 -1
- metadata +47 -17
- data/config/environment.rb +0 -3
data/config/locales/nl.yml
CHANGED
@@ -14,18 +14,11 @@ nl:
|
|
14
14
|
templates:
|
15
15
|
apply:
|
16
16
|
error: Er is een fout opgetreden bij het bijwerken van dit template.
|
17
|
-
success: Template met succes toegepast
|
18
17
|
copy:
|
19
18
|
error: Er is een fout opgetreden bij het kopiëren van dit template.
|
20
|
-
success: Template met succes gekopieerd
|
21
19
|
create:
|
22
20
|
error: Er is een fout opgetreden bij het maken van dit template.
|
23
|
-
success: Template met succes aangemaakt
|
24
|
-
destroy:
|
25
|
-
success: Template met succes verwijderd
|
26
21
|
empty: Er zijn nog geen templates.
|
27
|
-
update:
|
28
|
-
success: Template met succes bijgewerkt
|
29
22
|
titles:
|
30
23
|
template_types:
|
31
24
|
questionnaires: Vragenlijst templates
|
@@ -41,6 +34,12 @@ nl:
|
|
41
34
|
name: Template
|
42
35
|
templates:
|
43
36
|
admin:
|
37
|
+
block_user_templates:
|
38
|
+
form:
|
39
|
+
save: Opslaan
|
40
|
+
proposal_answer_templates:
|
41
|
+
form:
|
42
|
+
save: Opslaan
|
44
43
|
questionnaire_templates:
|
45
44
|
choose:
|
46
45
|
create_from_template: Met template aanmaken
|
@@ -50,11 +49,7 @@ nl:
|
|
50
49
|
skip_template: Overslaan
|
51
50
|
edit:
|
52
51
|
edit: Bewerk
|
53
|
-
empty: Er zijn nog geen vragen
|
54
52
|
questionnaire: Vragenlijst
|
55
|
-
form:
|
56
|
-
save: Opslaan
|
57
|
-
template_title: Template informatie
|
58
53
|
index:
|
59
54
|
confirm_delete: Weet je zeker dat je dit template wilt verwijderen?
|
60
55
|
title: Vragenlijst templates
|
data/config/locales/no.yml
CHANGED
@@ -14,18 +14,11 @@
|
|
14
14
|
templates:
|
15
15
|
apply:
|
16
16
|
error: Det oppstod et problem med å bruke denne malen.
|
17
|
-
success: Mal lagt til
|
18
17
|
copy:
|
19
18
|
error: Det oppstod et problem under kopiering av denne malen.
|
20
|
-
success: Malen ble kopiert
|
21
19
|
create:
|
22
20
|
error: Det oppstod et problem under oppretting av malen.
|
23
|
-
success: Malen er opprettet
|
24
|
-
destroy:
|
25
|
-
success: Malen ble slettet
|
26
21
|
empty: Det finnes ingen maler enda.
|
27
|
-
update:
|
28
|
-
success: Mal oppdatert
|
29
22
|
titles:
|
30
23
|
template_types:
|
31
24
|
questionnaires: Maler for spørreskjema
|
@@ -41,6 +34,12 @@
|
|
41
34
|
name: Mal
|
42
35
|
templates:
|
43
36
|
admin:
|
37
|
+
block_user_templates:
|
38
|
+
form:
|
39
|
+
save: Lagre
|
40
|
+
proposal_answer_templates:
|
41
|
+
form:
|
42
|
+
save: Lagre
|
44
43
|
questionnaire_templates:
|
45
44
|
choose:
|
46
45
|
create_from_template: Opprett fra mal
|
@@ -50,11 +49,8 @@
|
|
50
49
|
skip_template: Hopp over
|
51
50
|
edit:
|
52
51
|
edit: Rediger
|
53
|
-
empty: Det er ingen spørsmål enda
|
54
52
|
questionnaire: Spørreskjema
|
55
53
|
form:
|
56
|
-
save: Lagre
|
57
|
-
template_title: Informasjon om mal
|
58
54
|
title: Spørreskjema mal %{questionnaire_for}
|
59
55
|
index:
|
60
56
|
confirm_delete: Er du sikker på at du vil slette denne malen?
|
data/config/locales/pl.yml
CHANGED
@@ -7,18 +7,11 @@ pl:
|
|
7
7
|
templates:
|
8
8
|
apply:
|
9
9
|
error: Wystąpił błąd z zastosowaniem tego szablonu.
|
10
|
-
success: Szablon został zastosowany
|
11
10
|
copy:
|
12
11
|
error: Wystąpił błąd podczas kopiowania tego szablonu.
|
13
|
-
success: Szablon został skopiowany
|
14
12
|
create:
|
15
13
|
error: Wystąpił błąd podczas tworzenia tego szablonu.
|
16
|
-
success: Szablon został utworzony
|
17
|
-
destroy:
|
18
|
-
success: Szablon został usunięty
|
19
14
|
empty: Brak szablonów.
|
20
|
-
update:
|
21
|
-
success: Szablon został zaktualizowany
|
22
15
|
titles:
|
23
16
|
template_types:
|
24
17
|
questionnaires: Szablony kwestionariusza
|
@@ -34,6 +27,12 @@ pl:
|
|
34
27
|
name: Szablon
|
35
28
|
templates:
|
36
29
|
admin:
|
30
|
+
block_user_templates:
|
31
|
+
form:
|
32
|
+
save: Zapisz
|
33
|
+
proposal_answer_templates:
|
34
|
+
form:
|
35
|
+
save: Zapisz
|
37
36
|
questionnaire_templates:
|
38
37
|
choose:
|
39
38
|
create_from_template: Utwórz z szablonu
|
@@ -43,11 +42,8 @@ pl:
|
|
43
42
|
skip_template: Pomiń
|
44
43
|
edit:
|
45
44
|
edit: Edytuj
|
46
|
-
empty: Nie ma jeszcze żadnych pytań
|
47
45
|
questionnaire: Kwestionariusz
|
48
46
|
form:
|
49
|
-
save: Zapisz
|
50
|
-
template_title: Informacje o szablonie
|
51
47
|
title: Szablon kwestionariusza %{questionnaire_for}
|
52
48
|
index:
|
53
49
|
confirm_delete: Czy na pewno chcesz usunąć ten szablon?
|
data/config/locales/pt-BR.yml
CHANGED
@@ -14,18 +14,11 @@ pt-BR:
|
|
14
14
|
templates:
|
15
15
|
apply:
|
16
16
|
error: Ocorreu um erro ao aplicar este modelo.
|
17
|
-
success: Modelo aplicado com sucesso
|
18
17
|
copy:
|
19
18
|
error: Ocorreu um erro ao copiar este modelo.
|
20
|
-
success: Modelo copiado com sucesso
|
21
19
|
create:
|
22
20
|
error: Ocorreu um erro ao criar este modelo.
|
23
|
-
success: Modelo criado com sucesso
|
24
|
-
destroy:
|
25
|
-
success: Modelo excluído com sucesso
|
26
21
|
empty: Ainda não existem modelos.
|
27
|
-
update:
|
28
|
-
success: Modelo atualizado com sucesso
|
29
22
|
titles:
|
30
23
|
template_types:
|
31
24
|
questionnaires: Modelos de questionário
|
@@ -41,6 +34,12 @@ pt-BR:
|
|
41
34
|
name: Modelo
|
42
35
|
templates:
|
43
36
|
admin:
|
37
|
+
block_user_templates:
|
38
|
+
form:
|
39
|
+
save: Salvar
|
40
|
+
proposal_answer_templates:
|
41
|
+
form:
|
42
|
+
save: Salvar
|
44
43
|
questionnaire_templates:
|
45
44
|
choose:
|
46
45
|
create_from_template: Criar a partir de modelo
|
@@ -50,11 +49,8 @@ pt-BR:
|
|
50
49
|
skip_template: Ignorar
|
51
50
|
edit:
|
52
51
|
edit: Editar
|
53
|
-
empty: Ainda não há questões
|
54
52
|
questionnaire: Questionário
|
55
53
|
form:
|
56
|
-
save: Salvar
|
57
|
-
template_title: Informações do Template
|
58
54
|
title: Modelo de questionário %{questionnaire_for}
|
59
55
|
index:
|
60
56
|
confirm_delete: Tem certeza de que deseja excluir este modelo?
|
@@ -63,8 +59,5 @@ pt-BR:
|
|
63
59
|
current_step: Passo %{step}
|
64
60
|
of_total_steps: de %{total_steps}
|
65
61
|
tos_agreement: Ao participar você aceita os Termos de Serviço
|
66
|
-
admin_log:
|
67
|
-
template:
|
68
|
-
update: "%{user_name} atualizou o modelo de questionário %{resource_name}"
|
69
62
|
template_types:
|
70
63
|
questionnaires: Questionários
|
data/config/locales/pt.yml
CHANGED
@@ -14,18 +14,11 @@ pt:
|
|
14
14
|
templates:
|
15
15
|
apply:
|
16
16
|
error: Houve um problema ao aplicar este modelo
|
17
|
-
success: Modelo aplicado com êxito
|
18
17
|
copy:
|
19
18
|
error: Houve um problema ao copiar este modelo
|
20
|
-
success: Modelo copiado com êxito
|
21
19
|
create:
|
22
20
|
error: Houve um problema ao criar este modelo.
|
23
|
-
success: Modelo criado com êxito
|
24
|
-
destroy:
|
25
|
-
success: Modelo eliminado com êxito
|
26
21
|
empty: Ainda não há modelos.
|
27
|
-
update:
|
28
|
-
success: Modelo actualizado com êxito
|
29
22
|
titles:
|
30
23
|
template_types:
|
31
24
|
questionnaires: Modelos de questionário
|
@@ -41,6 +34,12 @@ pt:
|
|
41
34
|
name: Modelo
|
42
35
|
templates:
|
43
36
|
admin:
|
37
|
+
block_user_templates:
|
38
|
+
form:
|
39
|
+
save: Guardar
|
40
|
+
proposal_answer_templates:
|
41
|
+
form:
|
42
|
+
save: Guardar
|
44
43
|
questionnaire_templates:
|
45
44
|
choose:
|
46
45
|
create_from_template: Criar a partir do modelo
|
@@ -50,11 +49,8 @@ pt:
|
|
50
49
|
skip_template: Saltar
|
51
50
|
edit:
|
52
51
|
edit: Editar
|
53
|
-
empty: Ainda não há questões
|
54
52
|
questionnaire: Questionário
|
55
53
|
form:
|
56
|
-
save: Guardar
|
57
|
-
template_title: Informação do modelo
|
58
54
|
title: Modelo de questionário %{questionnaire_for}
|
59
55
|
index:
|
60
56
|
confirm_delete: Tem a certeza que quer apagar este modelo?
|
data/config/locales/ro-RO.yml
CHANGED
@@ -14,19 +14,19 @@ ro:
|
|
14
14
|
templates:
|
15
15
|
apply:
|
16
16
|
error: A apărut o eroare la aplicarea acestui șablon.
|
17
|
-
success:
|
17
|
+
success: Șablonul a fost aplicat cu succes.
|
18
18
|
copy:
|
19
19
|
error: A apărut o eroare la copierea acestui model.
|
20
|
-
success:
|
20
|
+
success: Șablonul a fost copiat cu succes.
|
21
21
|
create:
|
22
22
|
error: A apărut o eroare la crearea acestui model.
|
23
|
-
success:
|
23
|
+
success: Șablonul a fost creat cu succes.
|
24
24
|
destroy:
|
25
|
-
success:
|
25
|
+
success: Șablonul a fost șters cu succes.
|
26
26
|
empty: Nu există încă nici un model.
|
27
27
|
update:
|
28
28
|
error: A apărut o eroare la actualizarea acestui șablon.
|
29
|
-
success:
|
29
|
+
success: Șablonul a fost importat cu succes.
|
30
30
|
titles:
|
31
31
|
template_types:
|
32
32
|
questionnaires: Şabloane chestionar
|
@@ -42,6 +42,17 @@ ro:
|
|
42
42
|
name: Model
|
43
43
|
templates:
|
44
44
|
admin:
|
45
|
+
block_user_templates:
|
46
|
+
form:
|
47
|
+
save: Salvează
|
48
|
+
index:
|
49
|
+
confirm_delete: Sunteți sigur că doriți să ștergeți acest șablon?
|
50
|
+
title: Blochează mesajele utilizatorilor
|
51
|
+
template_chooser:
|
52
|
+
select_template: Selectați un răspuns șablon
|
53
|
+
proposal_answer_templates:
|
54
|
+
form:
|
55
|
+
save: Salvează
|
45
56
|
questionnaire_templates:
|
46
57
|
choose:
|
47
58
|
create_from_template: Creează după model
|
@@ -51,11 +62,9 @@ ro:
|
|
51
62
|
skip_template: Treci peste
|
52
63
|
edit:
|
53
64
|
edit: Editează
|
54
|
-
empty: Nu există încă întrebări
|
65
|
+
empty: Nu există încă întrebări.
|
55
66
|
questionnaire: Chestionar
|
56
67
|
form:
|
57
|
-
save: Salvează
|
58
|
-
template_title: Informatii despre model
|
59
68
|
title: Model de chestionar %{questionnaire_for}
|
60
69
|
index:
|
61
70
|
confirm_delete: Sigur dorești să ștergi acest model?
|
@@ -71,4 +80,5 @@ ro:
|
|
71
80
|
duplicate: "%{user_name} a duplicat șablonul chestionarului %{resource_name}"
|
72
81
|
update: "%{user_name} a actualizat șablonul chestionarului %{resource_name}"
|
73
82
|
template_types:
|
83
|
+
block_user: Blochează mesajele utilizatorilor
|
74
84
|
questionnaires: Chestionare
|
data/config/locales/sv.yml
CHANGED
@@ -20,6 +20,12 @@ sv:
|
|
20
20
|
name: Mall
|
21
21
|
templates:
|
22
22
|
admin:
|
23
|
+
block_user_templates:
|
24
|
+
form:
|
25
|
+
save: Spara
|
26
|
+
proposal_answer_templates:
|
27
|
+
form:
|
28
|
+
save: Spara
|
23
29
|
questionnaire_templates:
|
24
30
|
choose:
|
25
31
|
label: Välj mall
|
@@ -28,8 +34,6 @@ sv:
|
|
28
34
|
edit:
|
29
35
|
edit: Redigera
|
30
36
|
questionnaire: Enkät
|
31
|
-
form:
|
32
|
-
save: Spara
|
33
37
|
preview:
|
34
38
|
current_step: Steg %{step} av
|
35
39
|
of_total_steps: av %{total_steps}
|
data/config/locales/tr-TR.yml
CHANGED
@@ -5,20 +5,15 @@ tr:
|
|
5
5
|
menu:
|
6
6
|
templates: Şablonlar
|
7
7
|
templates:
|
8
|
+
actions:
|
9
|
+
new_template: Yeni şablon
|
8
10
|
apply:
|
9
11
|
error: Bu şablonu uygularken bir sorun oluştu.
|
10
|
-
success: Şablon başarıyla uygulandı
|
11
12
|
copy:
|
12
13
|
error: Bu şablonu kopyalarken bir sorun oluştu.
|
13
|
-
success: Şablon başarıyla kopyalandı
|
14
14
|
create:
|
15
15
|
error: Bu şablonu oluştururken bir hata oluştu.
|
16
|
-
success: Şablon başarıyla oluşturuldu
|
17
|
-
destroy:
|
18
|
-
success: Şablon başarıyla silindi
|
19
16
|
empty: Burada henüz şablon yok.
|
20
|
-
update:
|
21
|
-
success: Şablon başarıyla güncellendi
|
22
17
|
titles:
|
23
18
|
template_types:
|
24
19
|
questionnaires: Anket şablonları
|
@@ -34,6 +29,12 @@ tr:
|
|
34
29
|
name: Şablon
|
35
30
|
templates:
|
36
31
|
admin:
|
32
|
+
block_user_templates:
|
33
|
+
form:
|
34
|
+
save: Kaydet
|
35
|
+
proposal_answer_templates:
|
36
|
+
form:
|
37
|
+
save: Kaydet
|
37
38
|
questionnaire_templates:
|
38
39
|
choose:
|
39
40
|
create_from_template: Şablondan Oluştur
|
@@ -43,11 +44,8 @@ tr:
|
|
43
44
|
skip_template: Atla
|
44
45
|
edit:
|
45
46
|
edit: Düzenle
|
46
|
-
empty: Henüz bir soru yok
|
47
47
|
questionnaire: Anket
|
48
48
|
form:
|
49
|
-
save: Kaydet
|
50
|
-
template_title: Şablon Bilgisi
|
51
49
|
title: '%{questionnaire_for} için anket şablonu'
|
52
50
|
index:
|
53
51
|
confirm_delete: Bu şablonu silmek istediğinizden emin misiniz?
|
data/config/locales/zh-CN.yml
CHANGED
@@ -7,18 +7,11 @@ zh-CN:
|
|
7
7
|
templates:
|
8
8
|
apply:
|
9
9
|
error: 应用此模板时出现问题。
|
10
|
-
success: 模板应用成功
|
11
10
|
copy:
|
12
11
|
error: 复制此模板时出现问题。
|
13
|
-
success: 模板复制成功
|
14
12
|
create:
|
15
13
|
error: 创建此模板时出现问题。
|
16
|
-
success: 模板创建成功
|
17
|
-
destroy:
|
18
|
-
success: 模板删除成功
|
19
14
|
empty: 尚无模板。
|
20
|
-
update:
|
21
|
-
success: 模板更新成功
|
22
15
|
titles:
|
23
16
|
template_types:
|
24
17
|
questionnaires: 问卷模板
|
@@ -34,6 +27,12 @@ zh-CN:
|
|
34
27
|
name: 模板
|
35
28
|
templates:
|
36
29
|
admin:
|
30
|
+
block_user_templates:
|
31
|
+
form:
|
32
|
+
save: 保存
|
33
|
+
proposal_answer_templates:
|
34
|
+
form:
|
35
|
+
save: 保存
|
37
36
|
questionnaire_templates:
|
38
37
|
choose:
|
39
38
|
create_from_template: 从模板创建
|
@@ -43,11 +42,7 @@ zh-CN:
|
|
43
42
|
skip_template: 跳过
|
44
43
|
edit:
|
45
44
|
edit: 编辑
|
46
|
-
empty: 还没有问题
|
47
45
|
questionnaire: Questionnaire
|
48
|
-
form:
|
49
|
-
save: 保存
|
50
|
-
template_title: 模板信息
|
51
46
|
index:
|
52
47
|
confirm_delete: 您确定要删除此模板吗?
|
53
48
|
title: 问卷模板
|
data/config/locales/zh-TW.yml
CHANGED
@@ -14,19 +14,19 @@ zh-TW:
|
|
14
14
|
templates:
|
15
15
|
apply:
|
16
16
|
error: 套用此範本時發生問題。
|
17
|
-
success:
|
17
|
+
success: 範本成功應用.
|
18
18
|
copy:
|
19
19
|
error: 複製此範本時發生問題。
|
20
|
-
success:
|
20
|
+
success: 範本成功複製.
|
21
21
|
create:
|
22
22
|
error: 建立此範本時發生問題。
|
23
|
-
success:
|
23
|
+
success: 範本建立成功.
|
24
24
|
destroy:
|
25
|
-
success:
|
25
|
+
success: 範本删除成功.
|
26
26
|
empty: 尚未有範本。
|
27
27
|
update:
|
28
28
|
error: 更新此範本時發生問題。
|
29
|
-
success:
|
29
|
+
success: 範本更新成功
|
30
30
|
titles:
|
31
31
|
template_types:
|
32
32
|
questionnaires: 問卷範本
|
@@ -42,6 +42,17 @@ zh-TW:
|
|
42
42
|
name: 範本
|
43
43
|
templates:
|
44
44
|
admin:
|
45
|
+
block_user_templates:
|
46
|
+
form:
|
47
|
+
save: 儲存
|
48
|
+
index:
|
49
|
+
confirm_delete: 您是否確定要刪除本範本?
|
50
|
+
title: 封鎖使用者訊息
|
51
|
+
template_chooser:
|
52
|
+
select_template: 選擇範本回答
|
53
|
+
proposal_answer_templates:
|
54
|
+
form:
|
55
|
+
save: 儲存
|
45
56
|
questionnaire_templates:
|
46
57
|
choose:
|
47
58
|
create_from_template: 從範本建立
|
@@ -51,11 +62,9 @@ zh-TW:
|
|
51
62
|
skip_template: 略過
|
52
63
|
edit:
|
53
64
|
edit: 編輯
|
54
|
-
empty:
|
65
|
+
empty: 目前為止還沒有什麼問題.
|
55
66
|
questionnaire: 問題調查
|
56
67
|
form:
|
57
|
-
save: 儲存
|
58
|
-
template_title: 範本資訊
|
59
68
|
title: 問卷範本 %{questionnaire_for}
|
60
69
|
index:
|
61
70
|
confirm_delete: 您是否確定要刪除本範本?
|
@@ -71,4 +80,5 @@ zh-TW:
|
|
71
80
|
duplicate: "%{user_name} 複製了 %{resource_name} 問卷模板"
|
72
81
|
update: "%{user_name} 更新了 %{resource_name} 問卷模板"
|
73
82
|
template_types:
|
83
|
+
block_user: 封鎖使用者訊息
|
74
84
|
questionnaires: 問題調查
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddFieldValuesAndTargetToDecidimTemplates < ActiveRecord::Migration[6.0]
|
4
|
+
class Template < ApplicationRecord
|
5
|
+
self.table_name = :decidim_templates_templates
|
6
|
+
end
|
7
|
+
|
8
|
+
def change
|
9
|
+
add_column :decidim_templates_templates, :field_values, :json, default: {}
|
10
|
+
add_column :decidim_templates_templates, :target, :string
|
11
|
+
|
12
|
+
reversible do |direction|
|
13
|
+
direction.up do
|
14
|
+
# rubocop:disable Rails/SkipsModelValidations
|
15
|
+
Template.where(templatable_type: "Decidim::Forms::Questionnaire").update_all(target: "questionnaire")
|
16
|
+
Template.where(templatable_type: "Decidim::Organization").update_all(target: "user_block")
|
17
|
+
# rubocop:enable Rails/SkipsModelValidations
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/db/seeds.rb
CHANGED
@@ -6,7 +6,7 @@ if !Rails.env.production? || ENV.fetch("SEED", nil)
|
|
6
6
|
require "decidim/faker/localized"
|
7
7
|
|
8
8
|
# Since we usually migrate and seed in the same process, make sure
|
9
|
-
# that we
|
9
|
+
# that we do not have invalid or cached information after a migration.
|
10
10
|
decidim_tables = ActiveRecord::Base.connection.tables.select do |table|
|
11
11
|
table.starts_with?("decidim_")
|
12
12
|
end
|
@@ -17,7 +17,7 @@ if !Rails.env.production? || ENV.fetch("SEED", nil)
|
|
17
17
|
organization = Decidim::Organization.first
|
18
18
|
|
19
19
|
questionnaire_template = Decidim::Templates::Template.create!(
|
20
|
-
organization
|
20
|
+
organization:,
|
21
21
|
name: Decidim::Faker::Localized.sentence(word_count: 2),
|
22
22
|
description: Decidim::Faker::Localized.paragraph
|
23
23
|
)
|
@@ -35,7 +35,7 @@ if !Rails.env.production? || ENV.fetch("SEED", nil)
|
|
35
35
|
|
36
36
|
%w(short_answer long_answer).each_with_index do |text_question_type, index|
|
37
37
|
Decidim::Forms::Question.create!(
|
38
|
-
questionnaire
|
38
|
+
questionnaire:,
|
39
39
|
body: Decidim::Faker::Localized.paragraph,
|
40
40
|
question_type: text_question_type,
|
41
41
|
position: index
|
@@ -44,7 +44,7 @@ if !Rails.env.production? || ENV.fetch("SEED", nil)
|
|
44
44
|
|
45
45
|
%w(single_option multiple_option).each_with_index do |multiple_choice_question_type, index|
|
46
46
|
question = Decidim::Forms::Question.create!(
|
47
|
-
questionnaire
|
47
|
+
questionnaire:,
|
48
48
|
body: Decidim::Faker::Localized.paragraph,
|
49
49
|
question_type: multiple_choice_question_type,
|
50
50
|
position: index + 2
|
@@ -56,7 +56,7 @@ if !Rails.env.production? || ENV.fetch("SEED", nil)
|
|
56
56
|
|
57
57
|
question.display_conditions.create!(
|
58
58
|
condition_question: questionnaire.questions.find_by(position: question.position - 2),
|
59
|
-
question
|
59
|
+
question:,
|
60
60
|
condition_type: :answered,
|
61
61
|
mandatory: true
|
62
62
|
)
|
@@ -64,7 +64,7 @@ if !Rails.env.production? || ENV.fetch("SEED", nil)
|
|
64
64
|
|
65
65
|
%w(matrix_single matrix_multiple).each do |matrix_question_type|
|
66
66
|
question = Decidim::Forms::Question.create!(
|
67
|
-
questionnaire
|
67
|
+
questionnaire:,
|
68
68
|
body: Decidim::Faker::Localized.paragraph,
|
69
69
|
question_type: matrix_question_type
|
70
70
|
)
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "decidim/templates/menu"
|
4
|
+
|
3
5
|
module Decidim
|
4
6
|
module Templates
|
5
7
|
# This is the engine that runs on the public interface of `Templates`.
|
@@ -10,6 +12,15 @@ module Decidim
|
|
10
12
|
paths["lib/tasks"] = nil
|
11
13
|
|
12
14
|
routes do
|
15
|
+
resources :proposal_answer_templates do
|
16
|
+
member do
|
17
|
+
post :copy
|
18
|
+
end
|
19
|
+
collection do
|
20
|
+
get :fetch
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
13
24
|
## Routes for Questionnaire Templates
|
14
25
|
resources :questionnaire_templates do
|
15
26
|
member do
|
@@ -24,32 +35,26 @@ module Decidim
|
|
24
35
|
get :preview # To provide a preview for the template in the object creation view
|
25
36
|
end
|
26
37
|
end
|
38
|
+
resources :block_user_templates do
|
39
|
+
member do
|
40
|
+
post :copy
|
41
|
+
end
|
42
|
+
collection do
|
43
|
+
get :fetch
|
44
|
+
end
|
45
|
+
end
|
27
46
|
|
28
47
|
get "/questionnaire_template/questionnaire/answer_options", to: "questionnaires#answer_options", as: "answer_options_template"
|
29
48
|
|
30
49
|
root to: "questionnaire_templates#index"
|
31
50
|
end
|
32
51
|
|
33
|
-
initializer "
|
34
|
-
Decidim.
|
35
|
-
template_types.each_pair do |name, url|
|
36
|
-
menu.add_item name, name, url,
|
37
|
-
if: allowed_to?(:index, :templates),
|
38
|
-
active: is_active_link?(url)
|
39
|
-
end
|
40
|
-
end
|
52
|
+
initializer "decidim_templates_admin.participatory_processes_menu" do
|
53
|
+
Decidim::Templates::Menu.register_admin_template_types_menu!
|
41
54
|
end
|
42
55
|
|
43
56
|
initializer "decidim_templates_admin.menu" do
|
44
|
-
Decidim.
|
45
|
-
menu.add_item :questionnaire_templates,
|
46
|
-
I18n.t("menu.templates", scope: "decidim.admin", default: "Templates"),
|
47
|
-
decidim_admin_templates.questionnaire_templates_path,
|
48
|
-
icon_name: "document",
|
49
|
-
position: 12,
|
50
|
-
active: :inclusive,
|
51
|
-
if: allowed_to?(:read, :templates)
|
52
|
-
end
|
57
|
+
Decidim::Templates::Menu.register_admin_menu!
|
53
58
|
end
|
54
59
|
|
55
60
|
def load_seed
|
@@ -15,6 +15,10 @@ module Decidim
|
|
15
15
|
# root to: "templates#index"
|
16
16
|
end
|
17
17
|
|
18
|
+
initializer "decidim_templates.register_icons" do
|
19
|
+
Decidim.icons.register(name: "user-forbid-line", icon: "user-forbid-line", category: "system", description: "", engine: :templates)
|
20
|
+
end
|
21
|
+
|
18
22
|
initializer "decidim_templates.webpacker.assets_path" do
|
19
23
|
Decidim.register_assets_path File.expand_path("app/packs", root)
|
20
24
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Templates
|
5
|
+
class Menu
|
6
|
+
def self.register_admin_template_types_menu!
|
7
|
+
Decidim.menu :admin_template_types_menu do |menu|
|
8
|
+
menu.add_item :questionnaires,
|
9
|
+
I18n.t("template_types.questionnaires", scope: "decidim.templates"),
|
10
|
+
decidim_admin_templates.questionnaire_templates_path,
|
11
|
+
icon_name: "clipboard-line",
|
12
|
+
if: allowed_to?(:index, :templates),
|
13
|
+
active: (
|
14
|
+
is_active_link?(decidim_admin_templates.questionnaire_templates_path) ||
|
15
|
+
is_active_link?(decidim_admin_templates.root_path)
|
16
|
+
) && !is_active_link?(decidim_admin_templates.block_user_templates_path) &&
|
17
|
+
!is_active_link?(decidim_admin_templates.proposal_answer_templates_path)
|
18
|
+
|
19
|
+
menu.add_item :user_reports,
|
20
|
+
I18n.t("template_types.block_user", scope: "decidim.templates"),
|
21
|
+
decidim_admin_templates.block_user_templates_path,
|
22
|
+
icon_name: "user-forbid-line",
|
23
|
+
if: allowed_to?(:index, :templates),
|
24
|
+
active: is_active_link?(decidim_admin_templates.block_user_templates_path)
|
25
|
+
|
26
|
+
menu.add_item :proposal_answers,
|
27
|
+
I18n.t("template_types.proposal_answer_templates", scope: "decidim.templates"),
|
28
|
+
decidim_admin_templates.proposal_answer_templates_path,
|
29
|
+
icon_name: "file-copy-line",
|
30
|
+
if: allowed_to?(:index, :templates),
|
31
|
+
active: is_active_link?(decidim_admin_templates.proposal_answer_templates_path)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.register_admin_menu!
|
36
|
+
Decidim.menu :admin_menu do |menu|
|
37
|
+
menu.add_item :questionnaire_templates,
|
38
|
+
I18n.t("menu.templates", scope: "decidim.admin", default: "Templates"),
|
39
|
+
decidim_admin_templates.questionnaire_templates_path,
|
40
|
+
icon_name: "file-copy-line",
|
41
|
+
position: 12,
|
42
|
+
active: is_active_link?(decidim_admin_templates.root_path),
|
43
|
+
if: allowed_to?(:read, :templates)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|