<p class='requiredTitle'><%= t('layouts.forms.required_field')%></p>
<%= form_for(@server, url: server_path(@server), html: { multipart: true }) do |f| %>

  <%= render :partial => 'shared/form_main_information', :locals => { :f => f } %>

  <%= render :partial => 'shared/form_linux_device_information', :locals => { :f => f } %>

  <h2><%= t('.automounts') %></h2>
  <table class="editForm">
    <tr>
      <th><%= f.label :puavoExport, nil, for: "puavoExport0" %></th>
      <td>
        <div id="server_puavoExport_list">
          <% if Array(@server.puavoExport).empty? %>
          <input id='puavoExport0' name='server[puavoExport][]' size='30' type='text' />
          <% else %>
          <% Array(@server.puavoExport).each_index do |index| %>
          <input id='puavoExport<%= index %>' name='server[puavoExport][]' size='30' type='text' value='<%= Array(@server.puavoExport)[index] %>' />
          <% end %>
          <% end %>
        </div>
        <%= link_to "#", class: "clone_prev_input_element btn" do %>
          <i class="icon-plus"></i><%= t('.add_puavoExport') %>
        <% end %>
      </td>
    </tr>
  </table>

  <h2><%= t('servers.school_limit.title') %></h2>
  <% if @server.puavoDeviceType == "ltspserver" %>
  <p>
    <%= t('servers.school_limit.ltsp_description_edit') %>
  </p>
  <% else %>
  <p><%= t('servers.school_limit.boot_description') %></p>
  <% end %>

  <ul class="noBullets">
  <% @schools.each do |school| %>
    <li>
      <label>
        <%= check_box_tag(
          "server[puavoSchool][]",
          school.dn,
          Array(@server.puavoSchool).include?(school.dn.to_s),
          :id => "school_limit_#{ school.puavoId }"
        ) %>
        <span><%= school.displayName %></span>
      </label>
    </li>
  <% end %>
  </ul>

  <br>

  <table class="editForm">
    <tr class="buttonRow">
      <td colspan="2">
        <%= f.submit submit_text, class: 'btn' %>
        <div class="cancel"> <%=link_to t('link.cancel'), server_path(@server), class: 'btn btn-danger' %> </div>
      </td>
    </tr>
  </table>
<% end %>
