<p class="requiredTitle"><%= t('layouts.forms.required_field')%></p>

<%= form_for(@ldap_service, :url => path, :html => { :method => method })  do |f| %>
<table class="editForm">
  <% if action_name == "new" || action_name == "create" %>
  <tr>
    <th class="requiredField"><%= f.label :uid %></th>
    <td><%= f.text_field :uid, :required => 'required', :autofocus => true %></td>
  </tr>
  <% end %>

  <tr>
    <th><%= f.label :description %></th>
    <td><%= f.text_field :description %></td>
  </tr>

  <tr>
    <th class="requiredField"><%= f.label :userPassword %></th>
    <td><%= f.password_field :userPassword, :value => '' %></td>
  </tr>

  <tr>
    <th><%= f.label :groups %></th>
    <td>
      <ul class="no-list-bullets margin-0 padding-0">
      <% @system_groups.each do |g| %>
        <li>
          <label><input <%= ldap_service_group_checked?(f.object, g) %> id="group_<%= g.cn %>" name="ldap_service[groups][]" type="checkbox" value="<%= g.id %>" /><%= h g.description %></label>
        </li>
      <% end %>
      </ul>
    </td>
  </tr>

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