<% departments_url = admin_edit_org_path(@org_id) + '#departments' %>
<div class="row">
  <div class="col-md-12">
    <h1><%= d_('dmpopidor', 'Edit the Structure') %></h1>
    <%= link_to d_('dmpopidor', 'View all structures'), departments_url, class: 'btn btn-default pull-right' %>
  </div>
</div>

<div class="row">
  <div class="col-md-12">
    <%= form_for :department, url: org_department_path(org_id: @org_id, id: @department.id), html: { method: :put, id: 'edit_department_form' } do |f| %>
        <%= f.hidden_field :org_id, value: @org_id %>
        <div class="form-group col-xs-8">
          <%= f.label _('Name'), for: :name, class: "control-label" %>
          <%= f.text_field :name, as: :string, class: "form-control", spellcheck: true, 'aria-required': true, 'data-toggle': 'tooltip', title: _('Add the name of a structure.') %>
        </div>
        <div class="form-group col-xs-8">
          <%= f.label _('Abbreviated Name or Code'), for: :code, class: "control-label" %>
          <%= f.text_field :code, as: :string, class: "form-control", 'aria-required': false, 'data-toggle': 'tooltip', title: d_('dmpopidor', 'Add the abbreviated name or code for the structure.') %>
        </div>
        <!-- submit buttons -->
        <div class="form-group col-xs-8">
          <%= f.submit _('Save'), name: "draft", class: "btn btn-primary" %>
          <%= link_to _('Cancel'), departments_url, class: "btn btn-primary", role: 'button' %>
        </div>
    <% end %>
  </div>
</div>