<div class="sectionHeader">お届け先の追加・変更</div>

   <div><%= flash[:notice] %></div>
   <div><%= flash[:error] %></div>
   <%= error_messages_for :delivery_address if @delivery_address %>
   <% if @delivery_addresses.count < 20 %>
   <p>
   <%= link_to @delivery_addresses.count == 0 ? '新しいお届け先の追加・変更' : '新しいお届け先を追加する', {:action => :delivery_new}, :class => 'rosy small_button delivery_edit text' %>

   </p>
   <% end %>
   <% if @delivery_addresses.count == 0 %>
   <div class="text">新しいお届け先はありません</div>
   <% else %>
	<% @delivery_addresses.each_with_index do | address, i | %>
		<div class="sectionSubheader">お届け先住所　<%= i+1 %></div>
		<div class="addressEntry">
			〒<%= address.zipcode01 %>-<%= address.zipcode02 %><br />
			<%=h address.prefecture.name %><%=h address.address_city %><br /><%=h address.address_detail %><br />
			<%=h address.family_name %> <%=h address.first_name %>
			<div>
			      <%= link_to '変更', {:action => :delivery_edit, :id => address.id}, :class => "rosy small_button" %>
			      <%= link_to '削除', {:action => :delivery_destroy, :id => address.id}, :class => "rosy small_button", :confirm => '本当に削除しますか？' %>
			</div>
		</div>
	<% end %>
   <% end %>
