decidim-forms 0.27.7 → 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/README.md +1 -1
- data/app/cells/decidim/forms/answer_readonly/show.erb +1 -1
- data/app/cells/decidim/forms/matrix_readonly/show.erb +1 -1
- data/app/cells/decidim/forms/question_readonly/show.erb +8 -8
- data/app/cells/decidim/forms/question_readonly/title_and_description.erb +8 -0
- data/app/cells/decidim/forms/question_readonly_cell.rb +7 -0
- data/app/cells/decidim/forms/step_navigation/show.erb +13 -26
- data/app/cells/decidim/forms/step_navigation_cell.rb +7 -0
- data/app/commands/decidim/forms/answer_questionnaire.rb +31 -11
- data/app/controllers/decidim/forms/admin/concerns/has_questionnaire.rb +4 -4
- data/app/controllers/decidim/forms/admin/concerns/has_questionnaire_answers.rb +1 -1
- data/app/controllers/decidim/forms/concerns/has_questionnaire.rb +3 -3
- data/app/forms/decidim/forms/answer_form.rb +7 -3
- data/app/forms/decidim/forms/questionnaire_form.rb +1 -1
- data/app/helpers/decidim/forms/admin/application_helper.rb +1 -1
- data/app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb +2 -2
- data/app/models/decidim/forms/answer.rb +1 -1
- data/app/models/decidim/forms/display_condition.rb +2 -2
- data/app/models/decidim/forms/question.rb +0 -4
- data/app/models/decidim/forms/questionnaire.rb +1 -1
- data/app/packs/entrypoints/decidim_forms.js +4 -0
- data/app/packs/src/decidim/forms/admin/collapsible_questions.js +12 -6
- data/app/packs/src/decidim/forms/admin/forms.js +7 -7
- data/app/packs/src/decidim/forms/display_conditions.component.js +3 -3
- data/app/packs/src/decidim/forms/forms.js +15 -9
- data/app/packs/src/decidim/forms/option_attached_inputs.component.js +1 -1
- data/app/packs/stylesheets/decidim/forms/forms.scss +82 -52
- data/app/packs/stylesheets/decidim/forms/questionnaire-answers-pdf.scss +13 -13
- data/app/presenters/decidim/forms/admin/questionnaire_participant_presenter.rb +2 -2
- data/app/presenters/decidim/forms/admin_log/questionnaire_presenter.rb +2 -2
- data/app/presenters/decidim/forms/answer_option_presenter.rb +1 -1
- data/app/queries/decidim/forms/questionnaire_participants.rb +1 -1
- data/app/views/decidim/forms/admin/questionnaires/_answer_option.html.erb +1 -1
- data/app/views/decidim/forms/admin/questionnaires/_answer_option_template.html.erb +1 -1
- data/app/views/decidim/forms/admin/questionnaires/_display_condition.html.erb +2 -2
- data/app/views/decidim/forms/admin/questionnaires/_display_condition_template.html.erb +1 -1
- data/app/views/decidim/forms/admin/questionnaires/_form.html.erb +52 -74
- data/app/views/decidim/forms/admin/questionnaires/_matrix_row.html.erb +1 -1
- data/app/views/decidim/forms/admin/questionnaires/_matrix_row_template.html.erb +1 -1
- data/app/views/decidim/forms/admin/questionnaires/_question.html.erb +147 -135
- data/app/views/decidim/forms/admin/questionnaires/_separator.html.erb +15 -13
- data/app/views/decidim/forms/admin/questionnaires/_title_and_description.html.erb +69 -63
- data/app/views/decidim/forms/admin/questionnaires/answers/export/_answer.html.erb +4 -4
- data/app/views/decidim/forms/admin/questionnaires/answers/export/pdf.html.erb +1 -1
- data/app/views/decidim/forms/admin/questionnaires/answers/index.html.erb +41 -45
- data/app/views/decidim/forms/admin/questionnaires/answers/show.html.erb +13 -18
- data/app/views/decidim/forms/admin/questionnaires/edit.html.erb +33 -6
- data/app/views/decidim/forms/questionnaires/_answer.html.erb +31 -27
- data/app/views/decidim/forms/questionnaires/_questionnaire.html.erb +78 -0
- data/app/views/decidim/forms/questionnaires/_questionnaire_readonly.html.erb +11 -0
- data/app/views/decidim/forms/questionnaires/answers/_files.html.erb +1 -1
- data/app/views/decidim/forms/questionnaires/answers/_long_answer.html.erb +3 -1
- data/app/views/decidim/forms/questionnaires/answers/_matrix_multiple.html.erb +44 -41
- data/app/views/decidim/forms/questionnaires/answers/_matrix_single.html.erb +44 -41
- data/app/views/decidim/forms/questionnaires/answers/_multiple_option.html.erb +7 -6
- data/app/views/decidim/forms/questionnaires/answers/_separator.html.erb +1 -1
- data/app/views/decidim/forms/questionnaires/answers/_short_answer.html.erb +3 -1
- data/app/views/decidim/forms/questionnaires/answers/_single_option.html.erb +13 -12
- data/app/views/decidim/forms/questionnaires/answers/_sorting.html.erb +9 -12
- data/app/views/decidim/forms/questionnaires/answers/_title_and_description.html.erb +1 -1
- data/app/views/decidim/forms/questionnaires/show.html.erb +35 -144
- data/config/initializers/wicked_pdf.rb +1 -1
- data/config/locales/ar.yml +0 -6
- data/config/locales/bg.yml +0 -177
- data/config/locales/ca.yml +7 -2
- data/config/locales/cs.yml +8 -3
- data/config/locales/de.yml +9 -4
- data/config/locales/el.yml +7 -2
- data/config/locales/en.yml +8 -3
- data/config/locales/es-MX.yml +7 -2
- data/config/locales/es-PY.yml +7 -2
- data/config/locales/es.yml +7 -2
- data/config/locales/eu.yml +8 -3
- data/config/locales/fi-plain.yml +7 -2
- data/config/locales/fi.yml +7 -2
- data/config/locales/fr-CA.yml +8 -3
- data/config/locales/fr.yml +8 -3
- data/config/locales/gl.yml +0 -4
- data/config/locales/hu.yml +3 -9
- data/config/locales/id-ID.yml +0 -4
- data/config/locales/it.yml +0 -6
- data/config/locales/ja.yml +6 -1
- data/config/locales/lb.yml +0 -6
- data/config/locales/lt.yml +7 -2
- data/config/locales/lv.yml +0 -6
- data/config/locales/nl.yml +0 -6
- data/config/locales/no.yml +0 -6
- data/config/locales/pl.yml +6 -8
- data/config/locales/pt-BR.yml +0 -25
- data/config/locales/pt.yml +0 -6
- data/config/locales/ro-RO.yml +19 -14
- data/config/locales/ru.yml +0 -3
- data/config/locales/sk.yml +0 -6
- data/config/locales/sv.yml +3 -6
- data/config/locales/tr-TR.yml +0 -6
- data/config/locales/zh-CN.yml +0 -6
- data/config/locales/zh-TW.yml +7 -2
- data/lib/decidim/forms/engine.rb +8 -0
- data/lib/decidim/forms/test/factories.rb +37 -51
- data/lib/decidim/forms/test/shared_examples/has_questionnaire.rb +129 -239
- data/lib/decidim/forms/test/shared_examples/manage_questionnaire_answers.rb +18 -18
- data/lib/decidim/forms/test/shared_examples/manage_questionnaires/add_display_conditions.rb +14 -14
- data/lib/decidim/forms/test/shared_examples/manage_questionnaires/add_questions.rb +60 -78
- data/lib/decidim/forms/test/shared_examples/manage_questionnaires/update_display_conditions.rb +6 -6
- data/lib/decidim/forms/test/shared_examples/manage_questionnaires/update_questions.rb +25 -25
- data/lib/decidim/forms/test/shared_examples/manage_questionnaires.rb +9 -9
- data/lib/decidim/forms/user_answers_serializer.rb +1 -1
- data/lib/decidim/forms/version.rb +1 -1
- metadata +23 -18
- data/app/packs/src/decidim/forms/autosortable_checkboxes.component.js +0 -83
- data/config/locales/he-IL.yml +0 -1
- data/decidim-forms.gemspec +0 -34
@@ -1,159 +1,171 @@
|
|
1
1
|
<% question = form.object %>
|
2
2
|
<% is_expanded = question.errors.any? %>
|
3
|
-
|
4
|
-
<div class="
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
-
form.translated(
|
44
|
-
:text_field,
|
45
|
-
:body,
|
46
|
-
tabs_id: id,
|
47
|
-
label: t(".statement"),
|
48
|
-
disabled: !editable
|
49
|
-
)
|
50
|
-
%>
|
3
|
+
<div class="card questionnaire-question" id="accordion-<%= id %>-field">
|
4
|
+
<div class="form__wrapper" data-component="accordion">
|
5
|
+
<div class="card-divider question-divider">
|
6
|
+
<h2 class="card-title flex items-center">
|
7
|
+
<span>
|
8
|
+
<% if editable %>
|
9
|
+
<%== icon("drag-move-2-fill") %>
|
10
|
+
<% end %>
|
11
|
+
<%= dynamic_title(translated_attribute(question.body), class: "question-title-statement", max_length: 50, omission: "...", placeholder: t(".question")) %>
|
12
|
+
</span>
|
13
|
+
|
14
|
+
<span class="ml-auto flex flex-row-reverse items-center gap-2">
|
15
|
+
<button type="button" class="question--collapse <%= "question-error" if is_expanded %>" data-controls="panel-<%= id %>-question-card">
|
16
|
+
<span class="icon-collapse">
|
17
|
+
<%== icon("arrow-up-s-line", aria_label: t(".collapse"), role: "img") %>
|
18
|
+
</span>
|
19
|
+
|
20
|
+
<span class="icon-expand">
|
21
|
+
<%== icon("arrow-down-s-line", aria_label: t(".expand"), role: "img") %>
|
22
|
+
</span>
|
23
|
+
</button>
|
24
|
+
|
25
|
+
<% if editable %>
|
26
|
+
<button class="button button__sm button__transparent-secondary small alert hollow move-up-question button--title">
|
27
|
+
<%= icon("arrow-up-line") %>
|
28
|
+
<%= t(".up") %>
|
29
|
+
</button>
|
30
|
+
|
31
|
+
<button class="button button__sm button__transparent-secondary small alert hollow move-down-question button--title">
|
32
|
+
<%= icon("arrow-down-line") %>
|
33
|
+
<%= t(".down") %>
|
34
|
+
</button>
|
35
|
+
|
36
|
+
<button class="button button__sm button__transparent-secondary small alert hollow remove-question button--title">
|
37
|
+
<%= icon("delete-bin-line") %>
|
38
|
+
<%= t(".remove") %>
|
39
|
+
</button>
|
40
|
+
<% end %>
|
41
|
+
</span>
|
42
|
+
</h2>
|
51
43
|
</div>
|
52
44
|
|
53
|
-
<div class="
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
45
|
+
<div id="panel-<%= id %>-question-card" class="panel-question-card card-section collapsible <%= "panel-error" if is_expanded %>">
|
46
|
+
<div class="row column">
|
47
|
+
<%=
|
48
|
+
form.translated(
|
49
|
+
:text_field,
|
50
|
+
:body,
|
51
|
+
tabs_id: id,
|
52
|
+
label: t(".statement"),
|
53
|
+
disabled: !editable
|
54
|
+
)
|
55
|
+
%>
|
56
|
+
</div>
|
65
57
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
58
|
+
<div class="row column">
|
59
|
+
<%=
|
60
|
+
form.translated(
|
61
|
+
:editor,
|
62
|
+
:description,
|
63
|
+
toolbar: :full,
|
64
|
+
tabs_id: id,
|
65
|
+
label: t(".description"),
|
66
|
+
disabled: !editable
|
67
|
+
)
|
68
|
+
%>
|
69
|
+
</div>
|
75
70
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
</div>
|
71
|
+
<div class="row column">
|
72
|
+
<%=
|
73
|
+
form.check_box(
|
74
|
+
:mandatory,
|
75
|
+
disabled: !editable,
|
76
|
+
label: t("activemodel.attributes.questionnaire_question.mandatory")
|
77
|
+
)
|
78
|
+
%>
|
79
|
+
</div>
|
86
80
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
81
|
+
<div class="row column">
|
82
|
+
<%=
|
83
|
+
form.number_field(
|
84
|
+
:max_characters,
|
85
|
+
disabled: !editable,
|
86
|
+
min: 0,
|
87
|
+
label: t("activemodel.attributes.questionnaire_question.max_characters")
|
88
|
+
)
|
89
|
+
%>
|
90
|
+
</div>
|
97
91
|
|
98
|
-
|
99
|
-
|
100
|
-
|
92
|
+
<div class="row column">
|
93
|
+
<%=
|
94
|
+
form.select(
|
95
|
+
:question_type,
|
96
|
+
options_from_collection_for_select(question_types, :first, :last, question.question_type),
|
97
|
+
{},
|
98
|
+
disabled: !editable
|
99
|
+
)
|
100
|
+
%>
|
101
|
+
</div>
|
101
102
|
|
102
|
-
|
103
|
-
|
103
|
+
<% if question.persisted? %>
|
104
|
+
<%= form.hidden_field :id, disabled: !editable %>
|
105
|
+
<% end %>
|
104
106
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
107
|
+
<%= form.hidden_field :position, value: question.position || 0, disabled: !editable %>
|
108
|
+
<%= form.hidden_field :deleted, disabled: !editable %>
|
109
|
+
|
110
|
+
<div class="row column">
|
111
|
+
<div class="questionnaire-question-matrix-rows" data-template="<%= matrix_row_template_selector %>">
|
112
|
+
<div class="questionnaire-question-matrix-rows-list">
|
113
|
+
<% question.matrix_rows_by_position.each do |matrix_row| %>
|
114
|
+
<%= fields_for "questionnaire[questions][#{question.to_param}][matrix_rows][]", matrix_row do |matrix_row_form| %>
|
115
|
+
<%= render "decidim/forms/admin/questionnaires/matrix_row", form: matrix_row_form, question:, editable: %>
|
116
|
+
<% end %>
|
117
|
+
<% end %>
|
118
|
+
</div>
|
119
|
+
|
120
|
+
<% if editable %>
|
121
|
+
<button class="button button__sm button__secondary add-matrix-row"><%= t(".add_matrix_row") %></button>
|
110
122
|
<% end %>
|
111
|
-
|
123
|
+
</div>
|
112
124
|
</div>
|
113
125
|
|
114
|
-
|
115
|
-
<
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
<div class="questionnaire-question-answer-options-list">
|
121
|
-
<% question.answer_options.each do |answer_option| %>
|
122
|
-
<%= fields_for "questionnaire[questions][#{question.to_param}][answer_options][]", answer_option do |answer_option_form| %>
|
123
|
-
<%= render "decidim/forms/admin/questionnaires/answer_option", form: answer_option_form, question: question, editable: editable %>
|
126
|
+
<div class="questionnaire-question-answer-options" data-template="<%= answer_option_template_selector %>">
|
127
|
+
<div class="questionnaire-question-answer-options-list">
|
128
|
+
<% question.answer_options.each do |answer_option| %>
|
129
|
+
<%= fields_for "questionnaire[questions][#{question.to_param}][answer_options][]", answer_option do |answer_option_form| %>
|
130
|
+
<%= render "decidim/forms/admin/questionnaires/answer_option", form: answer_option_form, question:, editable: %>
|
131
|
+
<% end %>
|
124
132
|
<% end %>
|
133
|
+
</div>
|
134
|
+
|
135
|
+
<% if editable %>
|
136
|
+
<div class="row column">
|
137
|
+
<button type="button" class="button button__sm button__secondary add-answer-option"><%= t(".add_answer_option") %></button>
|
138
|
+
</div>
|
125
139
|
<% end %>
|
126
140
|
</div>
|
127
141
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
{ include_blank: t(".any") },
|
139
|
-
disabled: !editable
|
140
|
-
)
|
141
|
-
%>
|
142
|
-
</div>
|
142
|
+
<div class="row column questionnaire-question-max-choices">
|
143
|
+
<%=
|
144
|
+
form.select(
|
145
|
+
:max_choices,
|
146
|
+
(2..question.number_of_options),
|
147
|
+
{ include_blank: t(".any") },
|
148
|
+
disabled: !editable
|
149
|
+
)
|
150
|
+
%>
|
151
|
+
</div>
|
143
152
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
153
|
+
<div class="questionnaire-question-display-conditions" data-template="<%= display_condition_template_selector %>">
|
154
|
+
<div class="questionnaire-question-display-conditions-list">
|
155
|
+
<% question.display_conditions.each do |display_condition| %>
|
156
|
+
<%= fields_for "questionnaire[questions][#{question.to_param}][display_conditions][]", display_condition do |display_condition_form| %>
|
157
|
+
<%= render "decidim/forms/admin/questionnaires/display_condition", form: display_condition_form, question:, editable: %>
|
158
|
+
<% end %>
|
149
159
|
<% end %>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
<% if editable %>
|
163
|
+
<% disabled = !question.persisted? %>
|
164
|
+
<div class="row column">
|
165
|
+
<button <%= "disabled" if disabled %> title="<%= disabled ? t(".add_display_condition_info") : t(".add_display_condition_info") %>" class="button button__sm button__secondary add-display-condition"><%= t(".add_display_condition") %></button>
|
166
|
+
</div>
|
150
167
|
<% end %>
|
151
168
|
</div>
|
152
|
-
|
153
|
-
<% if editable %>
|
154
|
-
<% disabled = !question.persisted? %>
|
155
|
-
<button <%= "disabled" if disabled %> title="<%= disabled ? t(".add_display_condition_info") : t(".add_display_condition_info") %>" class="button add-display-condition"><%= t(".add_display_condition") %></button>
|
156
|
-
<% end %>
|
157
169
|
</div>
|
158
170
|
</div>
|
159
171
|
</div>
|
@@ -2,27 +2,29 @@
|
|
2
2
|
|
3
3
|
<div class="card questionnaire-question" id="<%= id %>-field">
|
4
4
|
<div class="card-divider question-divider">
|
5
|
-
<h2 class="card-title">
|
5
|
+
<h2 class="card-title flex items-center">
|
6
6
|
<span>
|
7
7
|
<% if editable %>
|
8
|
-
<%== icon("move") %>
|
8
|
+
<%== icon("drag-move-2-fill") %>
|
9
9
|
<% end %>
|
10
10
|
<%= dynamic_title(t(".separator"), class: "question-title-statement", max_length: 50, omission: "...", placeholder: t(".separator")) %>
|
11
11
|
</span>
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
<div class="flex items-center gap-x-4 ml-auto">
|
14
|
+
<% if editable %>
|
15
|
+
<button class="button button__sm button__transparent button__transparent-secondary small alert hollow move-up-question button--title">
|
16
|
+
<%== "#{icon("arrow-up-line")} #{t(".up")}" %>
|
17
|
+
</button>
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
<button class="button button__sm button__transparent button__transparent-secondary small alert hollow move-down-question button--title">
|
20
|
+
<%== "#{icon("arrow-down-line")} #{t(".down")}" %>
|
21
|
+
</button>
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
<button class="button button__sm button__transparent button__transparent-secondary small alert hollow remove-question button--title">
|
24
|
+
<%= t(".remove") %>
|
25
|
+
</button>
|
26
|
+
<% end %>
|
27
|
+
</div>
|
26
28
|
</h2>
|
27
29
|
|
28
30
|
<%=
|
@@ -1,80 +1,86 @@
|
|
1
1
|
<% question = form.object %>
|
2
2
|
<% is_expanded = question.errors.any? %>
|
3
3
|
|
4
|
-
<div class="card questionnaire-question" id="
|
5
|
-
<div
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
<button type="button" class="button small secondary button--title question--collapse" data-toggle="<%= id %>-question-card button--collapse-question-<%= id %> button--expand-question-<%= id %>">
|
15
|
-
<span id="button--collapse-question-<%= id %>" data-toggler=".hide" class="icon-collapse <%= "hide" unless is_expanded %>">
|
16
|
-
<%== icon("caret-top", aria_label: t(".collapse"), role: "img") %>
|
17
|
-
</span>
|
18
|
-
|
19
|
-
<span id="button--expand-question-<%= id %>" data-toggler=".hide" class="icon-expand <%= "hide" if is_expanded %>">
|
20
|
-
<%== icon("caret-bottom", aria_label: t(".expand"), role: "img") %>
|
4
|
+
<div class="card questionnaire-question" id="accordion-<%= id %>-field">
|
5
|
+
<div data-component="accordion">
|
6
|
+
<div class="card-divider question-divider">
|
7
|
+
<h2 class="card-title flex items-center">
|
8
|
+
<span>
|
9
|
+
<% if editable %>
|
10
|
+
<%== icon("drag-move-2-fill") %>
|
11
|
+
<% end %>
|
12
|
+
<%= dynamic_title(translated_attribute(question.body), class: "question-title-statement", max_length: 50, omission: "...", placeholder: t(".title_and_description")) %>
|
21
13
|
</span>
|
22
|
-
|
14
|
+
<div class="ml-auto flex flex-row-reverse items-center gap-2">
|
15
|
+
<button type="button" class="question--collapse" data-controls="panel-<%= id %>-question-card">
|
16
|
+
<span class="icon-collapse">
|
17
|
+
<%== icon("arrow-up-s-line", aria_label: t(".collapse"), role: "img") %>
|
18
|
+
</span>
|
23
19
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
20
|
+
<span class="icon-expand">
|
21
|
+
<%== icon("arrow-down-s-line", aria_label: t(".expand"), role: "img") %>
|
22
|
+
</span>
|
23
|
+
</button>
|
28
24
|
|
29
|
-
|
30
|
-
|
31
|
-
|
25
|
+
<% if editable %>
|
26
|
+
<button class="button button__sm button__transparent button__transparent-secondary small alert hollow move-up-question button--title">
|
27
|
+
<%= icon("arrow-up-line") %>
|
28
|
+
<%= t(".up") %>
|
29
|
+
</button>
|
32
30
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
</h2>
|
38
|
-
</div>
|
31
|
+
<button class="button button__sm button__transparent button__transparent-secondary small alert hollow move-down-question button--title">
|
32
|
+
<%= icon("arrow-down-line") %>
|
33
|
+
<%= t(".down") %>
|
34
|
+
</button>
|
39
35
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
label: t(".title"),
|
48
|
-
disabled: !editable
|
49
|
-
)
|
50
|
-
%>
|
36
|
+
<button class="button button__sm button__transparent button__transparent-secondary small alert hollow remove-question button--title">
|
37
|
+
<%= icon("delete-bin-line") %>
|
38
|
+
<%= t(".remove") %>
|
39
|
+
</button>
|
40
|
+
<% end %>
|
41
|
+
</div>
|
42
|
+
</h2>
|
51
43
|
</div>
|
52
44
|
|
53
|
-
<div class="
|
45
|
+
<div id="panel-<%= id %>-question-card" class="card-section collapsible" aria-hidden="true">
|
46
|
+
<div class="row column">
|
47
|
+
<%=
|
48
|
+
form.translated(
|
49
|
+
:text_field,
|
50
|
+
:body,
|
51
|
+
tabs_id: id,
|
52
|
+
label: t(".title"),
|
53
|
+
disabled: !editable
|
54
|
+
)
|
55
|
+
%>
|
56
|
+
</div>
|
57
|
+
|
58
|
+
<div class="row column">
|
59
|
+
<%=
|
60
|
+
form.translated(
|
61
|
+
:editor,
|
62
|
+
:description,
|
63
|
+
toolbar: :full,
|
64
|
+
tabs_id: id,
|
65
|
+
label: t(".description"),
|
66
|
+
disabled: !editable
|
67
|
+
)
|
68
|
+
%>
|
69
|
+
</div>
|
70
|
+
|
54
71
|
<%=
|
55
|
-
form.
|
56
|
-
:
|
57
|
-
:
|
58
|
-
toolbar: :full,
|
59
|
-
tabs_id: id,
|
60
|
-
label: t(".description"),
|
61
|
-
disabled: !editable
|
72
|
+
form.hidden_field(
|
73
|
+
:question_type,
|
74
|
+
value: :title_and_description
|
62
75
|
)
|
63
76
|
%>
|
64
|
-
</div>
|
65
77
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
value: :title_and_description
|
70
|
-
)
|
71
|
-
%>
|
72
|
-
|
73
|
-
<% if question.persisted? %>
|
74
|
-
<%= form.hidden_field :id, disabled: !editable %>
|
75
|
-
<% end %>
|
78
|
+
<% if question.persisted? %>
|
79
|
+
<%= form.hidden_field :id, disabled: !editable %>
|
80
|
+
<% end %>
|
76
81
|
|
77
|
-
|
78
|
-
|
82
|
+
<%= form.hidden_field :position, value: question.position || 0, disabled: !editable %>
|
83
|
+
<%= form.hidden_field :deleted, disabled: !editable %>
|
84
|
+
</div>
|
79
85
|
</div>
|
80
86
|
</div>
|
@@ -5,10 +5,10 @@
|
|
5
5
|
<thead>
|
6
6
|
<tr>
|
7
7
|
<th class='token'><%= t("session_token", scope: "decidim.forms.user_answers_serializer") %></th>
|
8
|
-
<th><%= t("user_status",
|
9
|
-
<th><%= t("ip_hash",
|
10
|
-
<th><%= t("completion",
|
11
|
-
<th><%= t("created_at",
|
8
|
+
<th><%= t("user_status", scope: "decidim.forms.user_answers_serializer") %></th>
|
9
|
+
<th><%= t("ip_hash", scope: "decidim.forms.user_answers_serializer") %></th>
|
10
|
+
<th><%= t("completion", scope: "decidim.forms.user_answers_serializer") %></th>
|
11
|
+
<th><%= t("created_at", scope: "decidim.forms.user_answers_serializer") %></th>
|
12
12
|
</tr>
|
13
13
|
</thead>
|
14
14
|
<tbody>
|
@@ -9,5 +9,5 @@
|
|
9
9
|
<% end %>
|
10
10
|
</div>
|
11
11
|
|
12
|
-
<%= render partial: "decidim/forms/admin/questionnaires/answers/export/answer", collection
|
12
|
+
<%= render partial: "decidim/forms/admin/questionnaires/answers/export/answer", collection:, locals: { questionnaire: }, as: :participant %>
|
13
13
|
</div>
|
@@ -1,53 +1,49 @@
|
|
1
1
|
<div class="card" id="answers">
|
2
|
-
<div class="
|
3
|
-
<h2 class="
|
2
|
+
<div class="item_show__header">
|
3
|
+
<h2 class="item_show__header-title">
|
4
4
|
<%= t ".title", total: @total %>
|
5
|
-
|
6
|
-
<%= link_to t("actions.back", scope: "decidim.forms.admin.questionnaires"), questionnaire_url, class: "button tiny button--title new" %>
|
7
|
-
</div>
|
5
|
+
<%= link_to t("actions.back", scope: "decidim.forms.admin.questionnaires"), questionnaire_url, class: "button button__sm button__secondary new" %>
|
8
6
|
</h2>
|
9
7
|
</div>
|
10
|
-
<div class="
|
11
|
-
<
|
12
|
-
<
|
13
|
-
<
|
8
|
+
<div class="table-scroll">
|
9
|
+
<table class="table-list">
|
10
|
+
<thead>
|
11
|
+
<tr>
|
12
|
+
<th>#</th>
|
13
|
+
<th><%= first_table_th(@participants.first) %></th>
|
14
|
+
<th><%= t("user_status", scope: "decidim.forms.user_answers_serializer") %></th>
|
15
|
+
<th><%= t("ip_hash", scope: "decidim.forms.user_answers_serializer") %></th>
|
16
|
+
<th><%= t("completion", scope: "decidim.forms.user_answers_serializer") %></th>
|
17
|
+
<th><%= t("created_at", scope: "decidim.forms.user_answers_serializer") %></th>
|
18
|
+
<th></th>
|
19
|
+
</tr>
|
20
|
+
</thead>
|
21
|
+
<tbody>
|
22
|
+
<% @participants.each_with_index do |participant, idx| %>
|
14
23
|
<tr>
|
15
|
-
<
|
16
|
-
<
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
24
|
+
<td><%= idx + 1 + page_offset %></td>
|
25
|
+
<td>
|
26
|
+
<% if allowed_to? :show, :questionnaire_answers %>
|
27
|
+
<%= link_to first_table_td(participant), questionnaire_participant_answers_url(participant.session_token) %>
|
28
|
+
<% else %>
|
29
|
+
<%= first_table_td(participant) %></td>
|
30
|
+
<% end %>
|
31
|
+
<td><%= participant.status %></td>
|
32
|
+
<td><%= participant.ip_hash %></td>
|
33
|
+
<td><%= display_percentage(participant.completion) %></td>
|
34
|
+
<td><%= l participant.answered_at, format: :short %></td>
|
35
|
+
<td class="table-list__actions">
|
36
|
+
<% if allowed_to? :show, :questionnaire_answers %>
|
37
|
+
<%= icon_link_to "eye-line", questionnaire_participant_answers_url(participant.session_token), t("actions.show", scope: "decidim.forms.admin.questionnaires.answers"), class: "action-icon--eye", target: "_blank", data: { "external-link": false } %>
|
38
|
+
<% end %>
|
39
|
+
<% if allowed_to? :export_response, :questionnaire_answers %>
|
40
|
+
<%= icon_link_to "download-line", questionnaire_export_response_url(participant.session_token), t("actions.export", scope: "decidim.forms.admin.questionnaires.answers"), class: "action-icon--data-transfer-download" %>
|
41
|
+
<% end %>
|
42
|
+
</td>
|
22
43
|
</tr>
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
<tr>
|
27
|
-
<td><%= idx + 1 + page_offset %></td>
|
28
|
-
<td>
|
29
|
-
<% if allowed_to? :show, :questionnaire_answers %>
|
30
|
-
<%= link_to first_table_td(participant), questionnaire_participant_answers_url(participant.session_token) %>
|
31
|
-
<% else %>
|
32
|
-
<%= first_table_td(participant) %></td>
|
33
|
-
<% end %>
|
34
|
-
<td><%= participant.status %></td>
|
35
|
-
<td><%= participant.ip_hash %></td>
|
36
|
-
<td><%= display_percentage(participant.completion) %></td>
|
37
|
-
<td><%= l participant.answered_at, format: :short %></td>
|
38
|
-
<td class="table-list__actions">
|
39
|
-
<% if allowed_to? :show, :questionnaire_answers %>
|
40
|
-
<%= icon_link_to "eye", questionnaire_participant_answers_url(participant.session_token), t("actions.show", scope: "decidim.forms.admin.questionnaires.answers"), class: "action-icon--eye" %>
|
41
|
-
<% end %>
|
42
|
-
<% if allowed_to? :export_response, :questionnaire_answers %>
|
43
|
-
<%= icon_link_to "data-transfer-download", questionnaire_export_response_url(participant.session_token), t("actions.export", scope: "decidim.forms.admin.questionnaires.answers"), class: "action-icon--data-transfer-download" %>
|
44
|
-
<% end %>
|
45
|
-
</td>
|
46
|
-
</tr>
|
47
|
-
<% end %>
|
48
|
-
</tbody>
|
49
|
-
</table>
|
50
|
-
<%= paginate @query, theme: "decidim" %>
|
51
|
-
</div>
|
44
|
+
<% end %>
|
45
|
+
</tbody>
|
46
|
+
</table>
|
52
47
|
</div>
|
53
48
|
</div>
|
49
|
+
<%= decidim_paginate @query %>
|