|
18 | 18 | <%= sanitize question.text %> |
19 | 19 | </div> |
20 | 20 | </dd> |
| 21 | + <!--Question Identifiers block - This verifies if org has permission to add question Identifiers--> |
| 22 | + <% org = Org.find(question.section.phase.template.org_id)%> |
| 23 | + <% if org.can_add_question_identifiers? && question.question_identifiers.present? |
| 24 | + # Check if any element has non-empty name and value |
| 25 | + has_valid_identifiers = question.question_identifiers.any? do |identifier| |
| 26 | + if !identifier[:name].blank? && !identifier[:value].blank? %> |
| 27 | + <dt><%= _('Question Identifiers')%></dt> |
| 28 | + <% question.question_identifiers.to_a.each do |q_identifier| %> |
| 29 | + <dd><%= raw _('<b>Value:</b>')%> <%= q_identifier.value %></dd> |
| 30 | + <dd><%= raw _('<b>Name:</b>')%> <%= q_identifier.name %></dd> |
| 31 | + <% end %> |
| 32 | + <br> |
| 33 | + <% end %> |
| 34 | + <% end %> |
| 35 | + <% end %> |
21 | 36 | <!-- question.option_based? --> |
22 | 37 | <% if question.option_based? %> |
23 | 38 | <dt><%= _('Question options') %></dt> |
24 | 39 | <dd><%= question.question_options.order(:number).collect(&:text).join(', ') %></dd> |
| 40 | + <br> |
25 | 41 | <% end %> |
26 | 42 | <!-- Default value --> |
27 | 43 | <% if q_format.textfield? || q_format.textarea? %> |
28 | | - <% if !question.default_value.nil? %> |
29 | | - <dt><%= _('Default value')%></dt> |
| 44 | + <% if !question.default_value.nil? && !question.default_value.empty? %> |
| 45 | + <dt><%= _('Default value') %></dt> |
30 | 46 | <dd> |
31 | 47 | <% if q_format.textarea? %> |
32 | 48 | <div class="display-readonly-textarea-content"> |
|
48 | 64 | <%= _('No additional comment area will be displayed.')%> |
49 | 65 | <% end %> |
50 | 66 | </dd> |
51 | | - |
| 67 | + <br> |
| 68 | + |
52 | 69 | <!-- question conditions --> |
53 | 70 | <% if conditions.count > 0 %> |
54 | 71 | <dt><%= _('Question conditions') %></dt> |
|
0 commit comments