Newer
Older
dmpopidor / app / views / guidances / new_edit.html.erb
<%# locals: { guidance, themes, guidance_groups, options } %>
<div class="row">
  <div class="col-xs-12">
    <h1><%= _('Guidance') %></h1>
  </div>
</div>
<div class="row">
  <div class="col-xs-12">
    <%= form_for(guidance, url: options[:url], html: { method: options[:method] , id: 'new_edit_guidance'}) do |f| %>
      <div class="form-group" data-toggle="tooltip" title="<%= _('Enter your guidance here. You can include links where needed.') %>">
        <%= f.label :text, class: 'control-label' %>
        <%= text_area_tag("guidance-text", guidance.text, class: "tinymce form-control", 'aria-required': true, rows: 10) %>
      </div>
      <div class="form-group">
        <%= f.label _('Themes'), for: :theme_ids, class: 'control-label' %>
        <%= f.collection_select(:theme_ids, themes,
                  :id, :title, {prompt: false}, {multiple: true, 'data-toggle': 'tooltip', title: _('Select which theme(s) this guidance relates to.'), class: 'form-control', 'aria-required': true}) %>
      </div>
      <div class="form-group">
        <%= f.label _('Guidance group'), for: :guidance_group_id, class: 'control-label' %>
        <%= f.collection_select(:guidance_group_id, guidance_groups,
                :id, :name, {prompt: false}, {multiple: false, 'data-toggle': 'tooltip', title: _('Select which group this guidance relates to.'), class: 'form-control', 'aria-required': true})%>
      </div>
      <div class="checkbox">
        <%= f.label :published, raw("#{f.check_box :published, as: :check_boxes, 'data-toggle': 'tooltip', title: _("Check this box when you are ready for this guidance to appear on user's plans.")} #{_('Published?')}") %>
      </div>

      <%= f.submit _('Save'), name: "edit_guidance_submit", class: "btn btn-primary" %>
      <%= link_to _('Cancel'), admin_index_guidance_path, class: "btn btn-primary", role: 'button' %>
    <%end%>
  </div>
</div>