Newer
Older
dmpopidor / app / views / templates / admin_template.html.erb
<%= stylesheet_link_tag "admin" %>
<% javascript 'admin.js' %>

<h1>
  <%= @template.title %>
  <!-- link button to add new guidance -->
  <div class="move_2_right">
    <%= link_to _('View all templates'),
                admin_index_template_path,
                class: 'btn btn-primary' %>
  </div>
</h1>

<div class="div_clear"></div>

<!-- render navigation tabs for the template-->
<%= render partial: "templates/admin_nav_tabs", locals: {template: @template, active: "show_template"} %>

<!-- body -->
<div class="dmp_details_body">
  <div class="dmp_details">
    <% if @template.org.funder? || current_user.org.funder? then %>
      <div id="edit_template_div" style="display: none">
        <%= render partial: "templates/edit_template", locals: {template: @template}%>
      </div>
    <%end%>
    <div id="show_template_div">
      <%= render partial: "templates/show_template", locals: {template: @template}%>
    </div>
  </div>
  <!-- If template has phases-->
  <% if !@template.phases.nil? then %>
    <% if @template.phases.count == 1 then %>
      <% @template.phases.each do |phase| %>
        <!--render the display block with the phase, sections and questions information-->
        <%= render partial: 'templates/show_phases_sections', locals: {phase: phase}%>
      <%end%>
    <%else%>
      <% @template.phases.order(:number).each do |phase| %>
        <div class="accordion" id="project-accordion">
          <div class="accordion-group">
            <div class="accordion-heading">
              <a class="accordion-toggle" data-toggle="collapse" data-parent="#project-accordion" href="#<%= phase.id %>">
                <h3><%= phase.title %><span class="plus-laranja"> </span>
                </h3>
              </a>
            </div>
            <div id="<%= phase.id %>" class="accordion-project collapse">
              <div class="accordion-inner">
                <!--render the display block with the phase, sections and questions information-->
                <%= render partial: 'templates/show_phases_sections', locals: {phase: phase}%>
              </div>
            </div>
          </div>
        </div>
      <%end%>
    <%end%>
  <%end%>
</div>

<%= tinymce content_css: asset_path('application.css') %>