<%= stylesheet_link_tag "admin" %>

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

<div id="main"><!-- メイン -->
<h2>特集管理</h2>
<% form_for [:admin, @feature], :url => {:action => :new}, :html => {:multipart => true} do |f| %>
  <%= render :partial => "select_type_form", :locals => {:f => f} %>
<% end %>


<h3>特集一覧</h3>
<%= flash[:notice] %>
<%= flash[:error] %>
<table class="data2" cellspacing="1">
  <tr>
    <th>特集名</th>
	<th>公開／非公開</th>
    <th>タイプ</th>
    <th>商品登録</th>
    <th>編集</th>
    <th>削除</th>
  </tr>
  <% unless @features.empty? -%>
    <% @features.each_with_index do | record, index | -%>
    <% @record = record -%>
  <tr>
    <td><%=h record.name %></td>
	<td><%=h record.permit_label %></td>
	<td><%=h Feature::TYPE_LIST[record.feature_type] %></td>
	<td>
	<% if record.feature_type == Feature::PRODUCT%>
    <%=link_to "商品登録",:controller =>"/admin/feature_products",:action =>"index",:feature_id => record.id %>   
    <% else%>
	-
    <% end%>
	</td>
    <td class="t_center"><%= link_to "編集", edit_admin_feature_path(record)%></td>
    <td class="t_center"><%= link_to "削除", { :action => "destroy", :id => record.id}, :confirm => "本当に削除しますか？", :method => "delete" %></td>
  </tr>
    <% end -%>
  <% end -%>
</table>
</div><!-- メイン -->
