Newer
Older
dmpopidor / app / views / templates / _edit_template.html.erb
<!-- edit template details A template is passed as an argument-->
<%= form_for(template, url: admin_update_template_path(template), html: { method: :put, class: 'form-horizontal' }) do |f| %>
  <div class="form-group">
    <%= f.label(:title, _('Title'), class: 'col-md-2 control-label') %>
    <div class="col-md-8">
      <%= f.text_field(
      :title,
      class: "form-control",
      "aria-required": false) %>
    </div>
    <div class="col-md-2">
      <%= render partial: '/shared/tooltip', locals: { aria_label: _('Title'), placement: 'top', title: _('Add tooltip Please enter a title for your template.') } %>
    </div>
  </div>
  <div class="form-group">
    <%= f.label(:description, _('Description'), class: 'col-md-2 control-label') %>
    <div class="col-md-8">
      <%= text_area_tag("template-desc", template.description, { class: 'form-control tinymce', "aria-required": false }) %>
    </div>
    <div class="col-md-2">
      <%= render partial: '/shared/popover', locals: { aria_label: _('Description'), placement: 'top', title: _('More information: Template descriptions'), content: _('Enter a description that helps you to differentiate between templates e.g. if you have ones for different audiences') } %>
    </div>
  </div>
  <div class="form-group">
    <%= label_tag(:status, _('Status'), class: 'col-md-2 control-label') %>
    <div class="col-md-10">
      <p class="form-control-static">
        <% if template_hash[:live].nil? %>
          <%= _('Unpublished') %>
        <% elsif template_hash[:current].dirty? %>
          <%= _('You have un-published changes') %>
        <% else %>
          <%= _('Published') %>
        <% end %>
      </p>
    </div>
  </div>
  <div class="form-group">
    <%= label_tag(:created_at, _('Created at'), class: 'col-md-2 control-label') %>
    <div class="col-md-10">
      <p class="form-control-static">
        <%= l template.created_at.to_date, formats: :short %>
      </p>
    </div>
  </div>
  <div class="form-group">
    <%= label_tag(:updated, _('Last updated'), class: 'col-md-2 control-label') %>
    <div class="col-md-10">
      <p class="form-control-static">
        <%= l template.updated_at.to_date, formats: :short %>
      </p>
    </div>
  </div>
  <div class="pull-right">
    <%= f.button(_('Save'), class: "btn btn-default", type: "submit") %>
    <%= link_to(_('Cancel'), '#', { class: "btn btn-default template_show_link", role: "button" }) %>
  </div>
<% end %>