
  <h1 class="head"><%= image_tag(is_new ? '24-book-blue-add.png':'24-book-blue-mark.png',{:border => 0}) %> Benutzerrolle <%= is_new ? 'anlegen':'anpassen' %></h1>

<%= form_for(@team) do |f| %>
  <!-- f.error_messages -->
  <% if @team.errors.any? %>
    <div id="error_explanation">
      <h2>Fehler:</h2>
      <ul>
         <% @team.errors.full_messages.each { |msg| %>
            <li><%= msg %>
         <% } %>
      </ul>
    </div>
  <% end %>

  <table border="0">
    <tr valign="top"><td>Teamname:</td><td> <%= f.text_field :name %> </td></tr>
    <tr valign="top"><td>Berechtigungen:</td>
    <td>
      <% for p in Permission.all do %>
        <%=  check_box_tag('team[permission_ids][]', p.id, @team.permissions.include?(p)) %>
        <%= p.permission %>
        <br />
      <%  end %>
<% f.select(:permissions, Permission.find(:all, :order => 'id').collect {|p| [p.permission, p.id]}, {},{ :multiple=> true }) %> </td></tr>
  </table>
      <p>
        <button type="submit">
          <%= image_tag('16-em-check.png',{:border => 0}) %>
        </button>
        <a href="<%= url_for :action => "index" %>">
          <button type="button">
            <%= image_tag('16-em-cross.png',{:border => 0}) %>
          </button>
        </a>
      </p>
    <% end %>
  </div>
