Commit 5b62f3a2 authored by Martin Markech's avatar Martin Markech
Browse files

refactored admin views and fix admin ajax pagination

parent ddfd8168
......@@ -7,45 +7,45 @@
:url => refinery.photo_gallery_admin_collections_path
} %>
<% elsif params[:controller] == "refinery/photo_gallery/admin/albums" %>
<%= render :partial => "/refinery/admin/search",
:locals => {
:url => refinery.photo_gallery_admin_albums_path
} %>
<% end %>
</li>
</ul>
<%= render :partial => "/refinery/admin/search",
:locals => {
:url => refinery.photo_gallery_admin_albums_path
} %>
<% end %>
</li>
</ul>
<ul class='collapsible_menu'>
<li class='not_a_link'>
<%= link_to t('.collections.title'), '#',
:class => 'folder_icon' %>
</li>
<li>
<%= link_to t('.collections.manage'), refinery.photo_gallery_admin_collections_path,
:class => 'folder_edit_icon' %>
</li>
<li>
<%= link_to t('.collections.new'), refinery.new_photo_gallery_admin_collection_path,
:class => 'folder_add_icon' %>
</li>
</ul>
<ul class='collapsible_menu'>
<li class='not_a_link'>
<%= link_to t('.albums.title'), '#',
:class => 'album_icon' %>
</li>
<li>
<%= link_to t('.albums.manage'), refinery.photo_gallery_admin_albums_path,
:class => 'album_edit_icon' %>
</li>
<li>
<%= link_to t('.albums.new'), refinery.new_photo_gallery_admin_album_path,
:class => 'album_add_icon' %>
</li>
</ul>
<ul class='collapsible_menu'>
<li class='not_a_link'>
<%= link_to t('.albums.title'), '#',
:class => 'album_icon' %>
</li>
<li>
<%= link_to t('.albums.manage'), refinery.photo_gallery_admin_albums_path,
:class => 'album_edit_icon' %>
</li>
<li>
<%= link_to t('.albums.new'), refinery.new_photo_gallery_admin_album_path,
:class => 'album_add_icon' %>
</li>
</ul>
<ul class='collapsible_menu'>
<li class='not_a_link'>
<%= link_to t('.collections.title'), '#',
:class => 'folder_icon' %>
</li>
<li>
<%= link_to t('.collections.manage'), refinery.photo_gallery_admin_collections_path,
:class => 'folder_edit_icon' %>
</li>
<li>
<%= link_to t('.collections.new'), refinery.new_photo_gallery_admin_collection_path,
:class => 'folder_add_icon' %>
</li>
</ul>
</nav>
</nav>
<% content_for :stylesheets, stylesheet_link_tag('refinery/photo_gallery/admin/backend') %>
<% content_for :stylesheets, stylesheet_link_tag('refinery/photo_gallery/admin/backend') %>
<%= will_paginate @albums %>
<ul>
<%= render :partial => 'album', :collection => @albums %>
</ul>
\ No newline at end of file
<ul id='sortable_list'>
<%= render :partial => 'album', :collection => @albums %>
</ul>
<%= render :partial => "/refinery/admin/sortable_list",
:locals => {
:continue_reordering => (defined?(continue_reordering) ? continue_reordering : true)
} %>
<%= render :partial => '/refinery/photo_gallery/admin/submenu' %>
<div id='records'>
<section id='records'>
<% if searching? %>
<h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
<% if @albums.any? %>
<ul>
<%= render :partial => "album", :collection => @albums %>
</ul>
<% else %>
<p><%= t('no_results', :scope => 'refinery.admin.search') %></p>
<% end %>
<% else %>
<% if @albums.any? %>
<%= will_paginate @albums %>
<%= render :partial => "sortable_list" %>
<%= will_paginate @albums %>
<% else %>
<p>
<strong>
<%= t('.no_items_yet', :create => t('new', :scope => 'refinery.photo_gallery.admin.submenu.albums')) %>
</strong>
</p>
<% end %>
<% end %>
</div>
<div class='pagination_container'>
<% if @albums.any? %>
<%= render "albums" %>
<% else %>
<p>
<% unless searching? %>
<strong>
<%= t('.no_items_yet', :create => t('new', :scope => 'refinery.photo_gallery.admin.submenu.albums')) %>
</strong>
<% else %>
<%= t('no_results', :scope => 'refinery.admin.search') %>
<% end %>
</p>
<% end %>
</div>
</section>
<%= render :partial => '/refinery/photo_gallery/admin/submenu' %>
\ No newline at end of file
<%= will_paginate @collections %>
<ul>
<%= render :partial => 'collection', :collection => @collections %>
</ul>
\ No newline at end of file
<ul id='sortable_list'>
<%= render :partial => 'collection', :collection => @collections %>
</ul>
<%= render :partial => "/refinery/admin/sortable_list",
:locals => {
:continue_reordering => (defined?(continue_reordering) ? continue_reordering : true)
} %>
<%= render :partial => '/refinery/photo_gallery/admin/submenu' %>
<div id='records'>
<section id='records'>
<% if searching? %>
<h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
<% if @collections.any? %>
<ul>
<%= render :partial => "collection", :collection => @collections %>
</ul>
<% else %>
<p><%= t('no_results', :scope => 'refinery.admin.search') %></p>
<% end %>
<% else %>
<% if @collections.any? %>
<%= will_paginate @collections %>
<%= render :partial => "sortable_list" %>
<%= will_paginate @collections %>
<% else %>
<p>
<strong>
<%= t('.no_items_yet', :create => t('new', :scope => 'refinery.photo_gallery.admin.submenu.collections')) %>
</strong>
</p>
<% end %>
<% end %>
</div>
\ No newline at end of file
<div class='pagination_container'>
<% if @collections.any? %>
<%= render "collections" %>
<% else %>
<p>
<% unless searching? %>
<strong>
<%= t('.no_items_yet', :create => t('new', :scope => 'refinery.photo_gallery.admin.submenu.collections')) %>
</strong>
<% else %>
<%= t('no_results', :scope => 'refinery.admin.search') %>
<% end %>
</p>
<% end %>
</div>
</section>
<%= render :partial => '/refinery/photo_gallery/admin/submenu' %>
\ No newline at end of file
<%= 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>
<%= image_tag "delete-24x24.png", :class => "delete", :alt => "Delete" -%>
<% if album.photos.empty? %>
<%= album.title %>
<% else %>
<%= image_tag album.photos.first.file.album.url, :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 %>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment