Skip to content

Commit e09d9d0

Browse files
committed
added question-identifiers
1 parent a4d24e5 commit e09d9d0

2 files changed

Lines changed: 80 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<div class="col-md-3 bold">
2+
<%= _('Question Identifiers')%>
3+
</div>
4+
5+
<div class="row">
6+
<div class="col-md-3 bold mb-2">
7+
<%= _('Value')%>
8+
</div>
9+
<div class="col-md-3 bold mb-2">
10+
<%= _('Name')%>
11+
</div>
12+
<div class="col-md-3">
13+
</div>
14+
</div>
15+
16+
<% if q.question_identifiers.count == 0 %>
17+
<% q.question_identifiers.build %>
18+
<% q.question_identifiers.each {|qopt| qopt.id=0} %>
19+
<% end %>
20+
21+
<% q.question_identifiers.to_a.each do |q_identifiers| %>
22+
<%= f.fields_for :question_identifiers, q_identifiers do |op| %>
23+
<div class="row mb-2" data-attribute="question_identifier">
24+
<div class="col-md-3 pe-2">
25+
<%= op.text_field :value, as: :string, class: 'form-control', spellcheck: true %>
26+
</div>
27+
<div class="col-md-3 pe-2">
28+
<%= op.text_field :name, as: :string, class: 'form-control', spellcheck: true %>
29+
</div>
30+
<div class="col-md-3">
31+
<%= op.hidden_field :_destroy, class: 'destroy-question-identifier' %>
32+
<%= link_to _('Remove'), org_admin_question_identifier_path(q_identifiers), method: :delete %>
33+
</div>
34+
</div>
35+
<% end %>
36+
<% end %>
37+
38+
<!-- block responsible to add a new pair of Question Identifiers -->
39+
<div class="row">
40+
<div class="col-md-3 mb-2">
41+
<a href="#" class="new_question_identifier"><%= _('Add new Question Identifier') %></a>
42+
</div>
43+
</div>
44+
<% if q.question_identifiers.count > 0 %>
45+
<div class="row">
46+
<div class="col-md-3 mb-2">
47+
<button type="button" class="btn btn-primary" id="link_to_question_identifiers_list" data-bs-toggle="modal" data-bs-target="#questionIdentifiersListModal" data-remote="true" data-template-id="<%= q.section.phase.template_id %>"><%= _('Question Identifiers List')%></button>
48+
<%= render "/org_admin/question_identifiers/question_identifiers_list" %>
49+
</div>
50+
</div>
51+
<% end %>
52+
53+
54+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
<div class="modal fade" id="questionIdentifiersListModal" role="dialog" tabindex="-1" aria-labelledby="questionIdentifiersListModalLabel" aria-hidden="true">
3+
<div class="modal-dialog" role="document">
4+
<div class="modal-content">
5+
6+
<div class="modal-header">
7+
<h2 class="modal-title" id="questionIdentifiersListModalLabel"><%= _('Question Identifiers List ') %></h2>
8+
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
9+
<span aria-hidden="true">&times;</span>
10+
</button>
11+
</div>
12+
13+
<div class="modal-body" id="questionIdentifiersListBody" style="text-align: left">
14+
15+
</div>
16+
17+
<div class="modal-footer">
18+
<%= link_to _('Download list'), export_pdf_list_org_admin_question_identifier_path(), class: "btn btn-primary", id: "export_pdf_list_link" %>
19+
20+
<button type="button" class="close btn btn-primary" data-bs-dismiss="modal" aria-label="Close">
21+
<%= _('Close')%>
22+
</button>
23+
</div>
24+
</div>
25+
</div>
26+
</div>

0 commit comments

Comments
 (0)