<%= render :partial => "submenu" %>

<div id="main"><!-- メイン -->

  <h2>会員規約設定</h2>
  <br />
  <div class="btn_t">
    <input type="button" class="btn_s" value="新規登録" onclick="parent.location.href='/admin/shops/kiyaku_index'">
  </div>
  <br />
  <%=h flash[:notice] %>
  <%=h flash[:error] %>
  <% form_tag :action => @status do%>
    <%= render :partial => "kiyaku_form" %>
    <div class="btn_box" style="padding-bottom:18px;">
      <%= submit_tag "この内容で登録する", :onclick => "return #{confirm_javascript_function("登録しても宜しいですか")}", :class => "btn" %>
      <img class="btn_side" width="6" height="34" src="/images/btn_side.gif">
    </div>
  <%end-%>

  <table class="data2" cellspacing="1">
   <tr>
    <th>規約タイトル</th>
    <th>編集</th>
    <th>削除</th>
    <th>移動</th>
   </tr>
   <% @kiyakus.each_with_index do | kiyaku,index | %>
    <tr>
     <td><%=h  kiyaku.name  %></td>
     <td class="t_center"><%= link_to '編集', :action => 'kiyaku_index', :id => kiyaku.id %></td>
     <td class="t_center"><%= link_to '削除', {:action => 'destroy', :id => kiyaku.id, :model => @model_name,:return_act=>"kiyaku_index"}, :confirm=>"本当に削除しますか？", :method=>:delete %></td>
     <td class="t_center">
       <% if index > 0 -%>
         <%= link_to "上へ ", { :action => "up", :id => kiyaku.id, :model => @model_name ,:return_act=>"kiyaku_index"} %>
       <% end -%>
       <% if index < @kiyakus.size-1 -%>
         <%= link_to "下へ", { :action => "down", :id => kiyaku.id, :model => @model_name ,:return_act=>"kiyaku_index"} %>
       <% end -%>
     </td>
    </tr>
   <% end %>
  </table>

</div><!-- /メイン -->

