<!-- devices/_form starts -->
<p class='requiredTitle'><%= t('layouts.forms.required_field')%></p>

<%= form_for(@device, :url => path, :html => { :method => method, :multipart => true }) do |f| %>
  <% if f.object.classes.include?('puavoPrinter') || f.object.classes.include?('puavoOtherDevice') %>
    <%= f.hidden_field :puavoDeviceType %>
    <% Array(Puavo::CONFIG["device_types"][@device.puavoDeviceType]["classes"]).each do |device_objectClass| %>
      <%= hidden_field_tag "device[classes][]", device_objectClass %>
    <% end %>
  <% end %>

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

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

  <% if f.object.classes.include?('puavoPrinter') %>
    <%= render :partial => 'form_cups', :locals => { :f => f } %>
  <% end %>

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

<% end %>
<!-- devices/_form ends -->
