Skip to content

Commit adfffdf

Browse files
committed
added the question-identifiers
1 parent 65af543 commit adfffdf

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

app/views/org_admin/questions/_form.html.erb

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323
<%= f.text_area(:text, class: "question", spellcheck: true, "aria-required": true) %>
2424
</div>
2525

26+
<!--Question Identifiers block - This verifies if org has permission to add question Identifiers-->
27+
<% org = Org.find(question.section.phase.template.org_id)%>
28+
<% if org.can_add_question_identifiers? %>
29+
<div class="form-control mb-3 col-md-10" data-attribute="question_identifier">
30+
<%= render "/org_admin/question_identifiers/question_identifier_block", f: f, q: question %>
31+
</div>
32+
<% end %>
33+
2634
<!-- Question format -->
2735
<div class="form-control mb-3 col-md-4">
2836
<%= f.label(:question_format_id, _('Answer format'), class: "form-label") %>
@@ -31,11 +39,12 @@
3139
:id,
3240
:title,
3341
question.question_format_id),
34-
{},
35-
class: "form-select question_format",
42+
{ include_blank: _("--Select--") },
43+
{ class: "form-select question_format",
3644
'data-toggle': 'tooltip',
3745
'data-html': true,
3846
title: _("You can choose from:<ul><li>- text area (large box for paragraphs);</li> <li>- text field (for a short answer);</li> <li>- checkboxes where options are presented in a list and multiple values can be selected;</li> <li>- radio buttons where options are presented in a list but only one can be selected;</li> <li>- dropdown like this box - only one option can be selected;</li> <li>- multiple select box allows users to select several options from a scrollable list, using the CTRL key;</li></ul>")
47+
}
3948
%>
4049
</div>
4150

@@ -47,16 +56,15 @@
4756
</div>
4857

4958
<% if question.id != nil && question.question_options[0].text != nil %>
50-
<% cond_lbl = conditions&.any? ? 'Edit Conditions' : 'Add Conditions' %>
51-
<%= link_to cond_lbl, org_admin_question_open_conditions_path(question_id: question.id, conditions: conditions), class: "add-logic btn btn-secondary", 'data-loaded': (conditions.size > 0).to_s, remote: true %>
59+
<%= link_to _('Add Conditions'), org_admin_question_open_conditions_path(question_id: question.id, conditions: conditions), class: "add-logic btn btn-secondary", 'data-loaded': (conditions.size > 0).to_s, remote: true %>
5260
<div id="content" class="col-md-offset-2">
5361
<p>
5462
<%= render partial: 'org_admin/conditions/container', locals: { f: f, question: question, conditions: conditions } %>
5563
</p>
5664
</div>
5765
<% else %>
5866
<div class="form-control mb-3" data-toggle="tooltip", title="<%= _('Save this question before adding conditions.') %>" >
59-
<%= link_to _('Edit Conditions'), '#', class: "add-logic btn btn-secondary disabled" %>
67+
<%= link_to _('Add Conditions'), '#', class: "add-logic btn btn-secondary disabled" %>
6068
</div>
6169
<% end %>
6270
</div>
@@ -90,12 +98,12 @@
9098
<% end %>
9199
<% end %>
92100
<!-- Themes -->
93-
<div class="form-control mb-3 col-md-10">
101+
<div class="form-group mb-3 col-md-10">
94102
<%= render partial: 'org_admin/shared/theme_selector',
95103
locals: { f: f, all_themes: Theme.all.order("title"), as_radio: false,
96104
popover_message: _('Select one or more themes that are relevant to this question. This will allow similarly themed organisation-level guidance to appear alongside your question.') } %>
97105
</div>
98-
<div class="form-control mb-3 col-md-10">
106+
<div class="form-group mb-3 col-md-10">
99107
<div class="float-end">
100108
<%= f.submit _('Save'), class: "btn btn-secondary", role:'button' %>
101109
<% if question.id.present? %>

0 commit comments

Comments
 (0)