photomix/app/views/collections/_form.html.erb

38 lines
1 KiB
Plaintext
Raw Normal View History

2009-06-03 22:12:11 +02:00
<%= form.label :title, :Title, {:class => 'big'} %><br />
<%= form.text_field :title, {:class => 'big'} %><br />
<%= form.label :description %><br />
<%= form.text_area :description %><br />
<% unless @collection.albums.empty? %>
<%= form.label :albums %><br />
<div id="collection_albums">
<% for album in @collection.albums %>
<% form.fields_for :album_list do |album_fields| %>
<span>
<img src="/images/delete-24x24.png" border="" class="delete" />
<% if album.photos.empty? %>
2009-10-26 16:29:59 +01:00
<%= album.title %>
<% else %>
2009-10-26 16:29:59 +01:00
<%= image_tag album.photos.first.path_modified_public('album'), :alt => album.title %>
<% end %>
<%= album_fields.hidden_field album.id %>
</span>
<% end %>
<% end %>
</div>
<p class="clear">
<%
grouped_options = [
['Available albums',[['Choose album to add','']]],
['Not used', Album.unused.map{|album|[album.title, album.id]} ],
['In use', Album.used.map{|album|[album.title, album.id]} ]
]
grouped_options_for_select(grouped_options)
%>
<%= select_tag 'available_albums', grouped_options_for_select(grouped_options) %>
</p>
<% end %>