Skip to content

Commit 0064cc5

Browse files
committed
added question-identifiers
1 parent 386c4db commit 0064cc5

1 file changed

Lines changed: 21 additions & 17 deletions

File tree

app/views/org_admin/phases/_phase.html.erb

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@
22
<div class="row" id="<%= dom_id(phase) %>">
33
<div class="col-md-12">
44
<div>
5-
<h3>
6-
<%= phase.title %>
7-
<div class="float-end">
8-
<% if template.customization_of.present? && template.latest? %>
9-
<%= link_to _('Customise phase'), org_admin_template_phase_path(template.id, phase.id), { class: "btn btn-secondary", role: 'button' } %>
10-
<% elsif modifiable %>
11-
<%= link_to _('Edit phase'), edit_org_admin_template_phase_path(template.id, phase.id), { class: "btn btn-secondary", role: 'button' } %>
12-
<% else %>
13-
<%= link_to _('Show phase'), org_admin_template_phase_path(template.id, phase.id), { class: "btn btn-secondary", role: 'button' } %>
14-
<% end %>
15-
<% if template.latest? && phase.modifiable %>
16-
<%= link_to _('Delete phase'), org_admin_template_phase_path(template.id, phase.id),
17-
data: { confirm: _("You are about to delete the '%{phase_title}' phase. This will remove all of the sections and questions listed below. Are you sure?") % { phase_title: phase.title },
18-
length: 20, omission: _('... (continued)') }, method: :delete, class: 'btn btn-secondary', role: 'button' %>
19-
<% end %>
20-
</div>
21-
</h3>
5+
<div class="float-end">
6+
<!-- Question identifiers list button -->
7+
<% org = Org.find(template.org_id)%>
8+
<% if org.can_add_question_identifiers? %>
9+
<% if template.template_has_any_question_identifiers(template.id) == true %>
10+
<%= link_to _('Download question identifiers list'), download_pdf_list_org_admin_question_identifier_path(), class: "btn btn-primary", id: "download_pdf_list_link" %>
11+
<% end %>
12+
<% end %>
13+
<% if template.customization_of.present? && template.latest? %>
14+
<%= link_to _('Customise phase'), org_admin_template_phase_path(template.id, phase.id), { class: "btn btn-secondary", role: 'button' } %>
15+
<% elsif modifiable %>
16+
<%= link_to _('Edit phase'), edit_org_admin_template_phase_path(template.id, phase.id), { class: "btn btn-secondary", role: 'button' } %>
17+
<% else %>
18+
<%= link_to _('Show phase'), org_admin_template_phase_path(template.id, phase.id), { class: "btn btn-secondary", role: 'button' } %>
19+
<% end %>
20+
<% if template.latest? && phase.modifiable %>
21+
<%= link_to _('Delete phase'), org_admin_template_phase_path(template.id, phase.id),
22+
data: { confirm: _("You are about to delete the '%{phase_title}' phase. This will remove all of the sections and questions listed below. Are you sure?") % { phase_title: phase.title },
23+
length: 20, omission: _('... (continued)') }, method: :delete, class: 'btn btn-secondary', role: 'button' %>
24+
<% end %>
25+
</div>
2226
<p class="float-start">
2327
<div class="display-readonly-textarea-content">
2428
<%= sanitize phase.description %>

0 commit comments

Comments
 (0)