Newer
Older
dmpopidor / app / views / sections / _add_section.html.erb
<!-- add a section and one question. Version is passed as an argument-->

<% @new_section = Section.new %>
<% @new_section.number = phase.sections.count + 1 %>


<%= form_for @new_section, url: admin_create_section_path do |f| %>
  <%= f.hidden_field :phase_id, value: phase.id %>

  <div class="accordion-group">
    <div class="accordion-heading">
      <div class="accordion-toggle">
        <div class="accordion_heading_text">

          <%= f.text_field :title, as: :string, class: "text_field", placeholder: _('New section title')%>
        </div>
        <!-- + or - icon-->
              <span class="icon-minus icon-white accordion-icon"> </span>
          </div>

    </div>
    <div id="collapse-sec" class="accordion-body section-collapse in collapse">
      <div class="accordion-inner">
        <table class="dmp_details_table">
          <tr>
            <td class="first_template"><%= _('Order of display') %></td>
            <td>
              <% range = @phase.template.customization_of.present? ? 0..15 : 1..15 %>
              <%= f.number_field :number, in: range, class: "number_field has-tooltip", "data-toggle" => "tooltip", title: _('This allows you to order sections.') %>
            </td>
          </tr>
          <tr>
            <td class="first_template"><%= _('Description') %></td>
            <td class="tinymce">
              <div class="div_left_icon">
                <%= text_area_tag("section-desc", "" , class: "tinymce") %>
              </div>
              <div class="div_right_icon">
                <a href="#" data-toggle="popover" rel: "popover" data-html: "true"
                   data-content="<%= _("Enter a basic description. This could be a summary of what is covered in the section or instructions on how to answer. This text will be displayed in the coloured banner once a section is opened to edit.") %>">
                <span class="fa fa-question-circle"></span></a>
              </div>
            </td>
          </tr>
        </table>
        <!-- save buttons-->
        <div class="move_2_right">
          <%= f.submit _('Save'), class: "btn btn-primary" %>
          <%= link_to _('Cancel'), "#", id: "", class: "btn cancel" %>
        </div>
        <div class="two-column-clear"></div>
      </div>
    </div>
  </div>
<% end %>