diff --git a/app/views/org_admin/phases/_overview.html.erb b/app/views/org_admin/phases/_overview.html.erb index bbdf21d..fde9db7 100644 --- a/app/views/org_admin/phases/_overview.html.erb +++ b/app/views/org_admin/phases/_overview.html.erb @@ -1,72 +1,6 @@

<%= _('Template Overview') %>

-<% phases.each do |phase| %> -
-
-
-
-

- <%= phase.title %> -
- <% if template.customization_of.present? && template.latest? %> - <%= link_to _('Customize phase'), org_admin_template_phase_path(template.id, phase.id), { class: "btn btn-default", role: 'button' } %> - <% elsif modifiable %> - <%= link_to _('Edit phase'), edit_org_admin_template_phase_path(template.id, phase.id), { class: "btn btn-default", role: 'button' } %> - <% else %> - <%= link_to _('Show phase'), org_admin_template_phase_path(template.id, phase.id), { class: "btn btn-default", role: 'button' } %> - <% end %> - <% if template.latest? && phase.modifiable %> - <%= link_to _('Delete phase'), org_admin_template_phase_path(template.id, phase.id), - 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 }, - length: 20, omission: _('... (continued)') }, method: :delete, class: 'btn btn-default', role: 'button' %> - <% end %> -
-

-

- <%= raw phase.description %> -

-
-
-
-
-
- <% if phase.sections.length > 0 %> -
- - - - - - - - - <% phase.sections.each do |section| %> - - - - - <% end %> - -
<%= _('Sections')%><%= _('Questions')%>

<%= section.title %>

- <% if section.questions.present? %> -
    - <% section.questions.each do |question| %> -
  • - <%= raw question.text %> - <% if question.question_options.length > 0 %> -
      - <% question.question_options.each do |option| %> -
    • <%= option.text %>
    • - <% end %> -
    - <% end %> -
  • - <% end %> -
- <% end %> -
-
- <% end %> -
-
-<% end %> \ No newline at end of file +<%= render partial: "org_admin/phases/phase", + collection: phases, + locals: { template: template, + modifiable: modifiable } %> diff --git a/app/views/org_admin/phases/_phase.html.erb b/app/views/org_admin/phases/_phase.html.erb new file mode 100644 index 0000000..9f10f42 --- /dev/null +++ b/app/views/org_admin/phases/_phase.html.erb @@ -0,0 +1,67 @@ +
+
+
+
+

+ <%= phase.title %> +
+ <% if template.customization_of.present? && template.latest? %> + <%= link_to _('Customize phase'), org_admin_template_phase_path(template.id, phase.id), { class: "btn btn-default", role: 'button' } %> + <% elsif modifiable %> + <%= link_to _('Edit phase'), edit_org_admin_template_phase_path(template.id, phase.id), { class: "btn btn-default", role: 'button' } %> + <% else %> + <%= link_to _('Show phase'), org_admin_template_phase_path(template.id, phase.id), { class: "btn btn-default", role: 'button' } %> + <% end %> + <% if template.latest? && phase.modifiable %> + <%= link_to _('Delete phase'), org_admin_template_phase_path(template.id, phase.id), + 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 }, + length: 20, omission: _('... (continued)') }, method: :delete, class: 'btn btn-default', role: 'button' %> + <% end %> +
+

+

+ <%= raw phase.description %> +

+
+
+ +
+ <% if phase.sections.length > 0 %> +
+ + + + + + + + + <% phase.sections.each do |section| %> + + + + + <% end %> + +
<%= _('Sections')%><%= _('Questions')%>

<%= section.title %>

+ <% if section.questions.present? %> +
    + <% section.questions.each do |question| %> +
  • + <%= raw question.text %> + <% if question.question_options.length > 0 %> +
      + <% question.question_options.each do |option| %> +
    • <%= option.text %>
    • + <% end %> +
    + <% end %> +
  • + <% end %> +
+ <% end %> +
+
+ <% end %> +
+
diff --git a/app/views/org_admin/sections/_index.html.erb b/app/views/org_admin/sections/_index.html.erb index a663964..ea28203 100644 --- a/app/views/org_admin/sections/_index.html.erb +++ b/app/views/org_admin/sections/_index.html.erb @@ -55,7 +55,7 @@ aria-expanded="false" aria-controls="#collapseSectionNew"> -