<%= flash[:notice] %>
<%= flash[:error] %>
<%= error_messages_for :authority %>

<% form_for [:admin, @authority] do |f| %>
<p class="req"><span class="pnt">※</span>は必須入力です</p>
<table class="data" cellspacing="1">
  <tr>
    <th>名前 <span class="pnt">※</span></th>
    <td><%= f.text_field :name, :class => "data_m" %></td>
  </tr>
</table>
<h3>許可機能</h3>

<%functions = to_table(Function.find(:all, :order => "position"),2)%>
<table>
<% functions.each do | function | %>
  <tr>
  <% function.each do |fn|%>
	<td class="t_left">
	 <% if @selected_functions
      select_flg = @selected_functions.include?(fn.id)
      end  %>
      <p class="space10_left space100_right">
        <%= check_box_tag("functions[#{fn.id}]", "#{fn.id}",select_flg)%>
        <label for="functions_<%=h fn.id %>"><%=h fn.name%>
      </p>
	 </td>
	<% end%>
  </tr>
<% end %>
</table>
<br />
<div class="btn_box">
  <%= f.submit 'この内容で登録する', :class => "btn"%>
  <%= image_tag("btn_side.gif", :width => "6", :height => "34", :alt => "", :class => "btn_side") %>
</div>

<% end %>
