%= form_for [refinery, :photo_gallery_admin, @album] do |f| -%>
<% album_photos_count = @album.photos.count #reduce sql queries%>
<%= render :partial => "/refinery/admin/error_messages",
:locals => {
:object => f.object,
:include_object_name => true
} %>
<%= f.label :title, :class=>"required" %>
<%= f.text_field :title, {:class => 'larger widest'} %>
<%# TODO use pop up to create collection %>
<%= label :collection, t('.album_belongs_to_collection') %>
<%= collection_select(:album, :collection_ids, Refinery::PhotoGallery::Collection.all(:order=> "title ASC"), :id, :title,
{ },
{ :data => {:placeholder=> t('.choose_collection')}, :multiple=> true, :class=> "chzn-select", :style=>"width:400px;"}) %>
<% if @album.title.blank? || @album.path.blank? # during creating album %>
<%= f.label :path_prefix, t('.path_prefix') %>
<%= f.text_field :path_prefix, :size=> 5, :maxlength=> 5 %>
<% elsif album_photos_count == 0 # allow to edit path only if there are no photos in album %>
<%#TODO if there are some photos in album, we must change folder paths on disk %>
<%= f.label :path %>
<%= f.text_field :path %>
<% end %>
<%= f.label :description %>
<%= f.text_area :description, :cols=>'65', :rows=>'7' %>
<%= f.label :address %>
<%= f.text_area :address, { :rows => 3} %>
<%= f.label :latitude %>
<%= f.text_field :latitude %>
<%= f.label :longitude %>
<%= f.text_field :longitude %>
<%= f.label :note %>
<%= f.text_area :note, :cols=>65, :rows=> 7 %>
<%= t('.number_of_photos', :number=> album_photos_count ) %>
<%= render :partial => "/refinery/admin/form_actions",
:locals => {
:f => f,
:continue_editing => false,
:delete_title => t('delete', :scope => 'refinery.photo_gallery.admin.albums.album')
} %>
<% end %>