<% javascript 'views/guidances/admin_edit.js' %>

<h1>
  <%= _('Guidance') %>
</h1>

<div class="content">
  <%= form_for(@guidance, url: admin_update_guidance_path(@guidance), html: { method: :put , id: 'edit_guidance_form', class: 'roadmap-form bordered'}) do |f| %>
  <fieldset class="side-by-side">
    <div class="form-input">
      <%= f.label _('Text'), for: @guidance.text %>
      <%= text_area_tag("guidance-text", @guidance.text, class: "tinymce") %>
      <div class="inline">
        <%= link_to( image_tag('help_button.png'), '#', "data-toggle": "popover", rel: "popover", 'data-html' => "true", 'data-content' => _('Enter your guidance here. You can include links where needed.'))%>
      </div>
    </div>
    <div class="form-input">
      <%= f.label _('Themes'), for: :theme_ids %>
      <%= f.collection_select(:theme_ids, @themes, :id, :title,
                  {prompt: false, include_blank: 'None'}, {multiple: true})%>
      <div class="inline">
        <%= link_to( image_tag('help_button.png'), '#', class: 'input-medium', "data-toggle": "popover", rel: "popover", 'data-html' => "true", 'data-content' => _('Select which theme(s) this guidance relates to.'))%>
      </div>
    </div>
    <div class="form-input">
      <%= f.label :published %>
      <%= f.check_box :published , as: :check_boxes%>
    </div>
    <div class="form-input">
      <%= f.label _('Guidance group'), for: :guidance_group_id %>
      <%= f.collection_select(:guidance_group_id, @guidance_groups,
                :id, :name, {prompt: false, include_blank: 'None'}, {multiple: false})%>
      <div class="inline">
        <%= link_to( image_tag('help_button.png'), '#', class: 'input-medium', "data-toggle": "popover", rel: "popover", 'data-html' => "true", 'data-content' => _('Select which group this guidance relates to.'))%>
      </div>
    </div>
    
    <br />
    <div class="form-input">
      <div class="button-spacer">&nbsp;</div>
      <input type="submit" id="edit_guidance_submit" href="#edit_guidance_alert_dialog" class="btn btn-primary" value="<%= _('Save')%>" />
    </div>
  </fieldset>
<%end%>

<%= tinymce :content_css => asset_path('application.css') %>

<!-- alert for the default template-->
<div id="edit_guidance_alert_dialog" class="modal" style="display:none">
  <ul id="missing_fields_edit_guidance"></ul>
</div>