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 />
|
2009-06-12 01:04:57 +02:00
|
|
|
|
2010-04-13 00:40:47 +02:00
|
|
|
<% unless @collection.albums.empty? %>
|
2009-08-06 15:01:39 +02:00
|
|
|
<%= form.label :albums %><br />
|
|
|
|
<div id="collection_albums">
|
|
|
|
<% for album in @collection.albums %>
|
2010-09-17 18:53:40 +02:00
|
|
|
<%= form.fields_for :album_list do |album_fields| %>
|
2009-08-06 15:01:39 +02:00
|
|
|
<span>
|
2010-11-21 12:29:57 +01:00
|
|
|
<%= image_tag "delete-24x24.png", :class => "delete", :alt => "Delete" -%>
|
|
|
|
|
2009-10-26 16:26:42 +01:00
|
|
|
<% if album.photos.empty? %>
|
2009-10-26 16:29:59 +01:00
|
|
|
<%= album.title %>
|
2009-10-26 16:26:42 +01:00
|
|
|
<% else %>
|
2010-07-28 00:27:47 +02:00
|
|
|
<%= image_tag album.photos.first.file.album.url, :alt => album.title %>
|
2009-10-26 16:26:42 +01:00
|
|
|
<% end %>
|
2009-08-06 15:01:39 +02:00
|
|
|
<%= 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) %>
|
2010-04-13 00:40:47 +02:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<% end %>
|