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(r: current_tab), html: { class: 'form-horizontal' }} do |f| %>
  <%= f.hidden_field :phase_id, value: phase.id %>
  <div class="panel panel-default">
    <div class="panel-heading">
      <h4 class="panel-title">
        <div class="col-md-10">
          <%= f.text_field(:title, { class: "form-control", 'aria-required': false, placeholder: _('Enter a title for the section') } ) %>
        </div>
        <div class="clearfix"/>
      </h4>
    </div>
    <div class="panel-body">
      <div class="col-md-10">
        <%= f.label(:number, _('Order of display'), class: "control-label") %>
      </div>
      <div class="col-md-4">
        <%= f.number_field(:number, in: 1..15, class: "form-control", 'aria-required': false, 'data-toggle': 'tooltip', title: _('This allows you to order sections.')) %>
      </div>

      <div class="col-md-10">
        <%= f.label(:description, _('Description'), class: "control-label") %>
        <div data-toggle="tooltip" title="<%= _("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.") %>">
        <%= text_area_tag('section-desc', '', class: 'tinymce form-control') %>
        </div>
      </div>

      <div class="col-md-4 col-md-offset-8 pull-right">
        <%= f.button(_('Save'), class: 'btn btn-default', type: "submit") %>
        <%= link_to(_('Cancel'), '#', { class: 'btn btn-default section_new_cancel', role: "button" }) %>
      </div>
    </div>
  </div>
<% end %>