simplifying pagination partials and renaming a few photo browser divs to better reflect a common naming policy
parent
77775bc753
commit
149f31f5fd
|
@ -41,7 +41,7 @@ module Merb
|
||||||
def pagination(div_name, base_url)
|
def pagination(div_name, base_url)
|
||||||
@pagination_block = div_name
|
@pagination_block = div_name
|
||||||
@base_pagination_url = base_url
|
@base_pagination_url = base_url
|
||||||
partial 'home/pagination_script'
|
partial 'home/pagination'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
%h1 Your favorite photos
|
%h1 Your favorite photos
|
||||||
|
|
||||||
|
#photo_browser_container
|
||||||
= pagination 'photo_browser', url(:favorites, :id => current_user.user_name)
|
= pagination 'photo_browser', url(:favorites, :id => current_user.user_name)
|
||||||
|
|
||||||
#browser_container.centered
|
|
||||||
= partial 'home/pagination_navigation'
|
|
||||||
#photo_browser
|
#photo_browser
|
||||||
= partial 'photos/photo_browser'
|
= partial 'photos/photo_browser'
|
||||||
|
|
|
@ -18,3 +18,15 @@
|
||||||
page = newpage;
|
page = newpage;
|
||||||
new Ajax.Updater('#{@pagination_block}', '#{@base_pagination_url}#{@base_pagination_url =~ /\?/ ? '&' : '?'}page=' + page, { method: 'get', onComplete: function(){ new Effect.Appear($('inner_#{@pagination_block}')); }, onSuccess: function(){ $('pagenum').innerHTML = parseInt(page) + 1; } });
|
new Ajax.Updater('#{@pagination_block}', '#{@base_pagination_url}#{@base_pagination_url =~ /\?/ ? '&' : '?'}page=' + page, { method: 'get', onComplete: function(){ new Effect.Appear($('inner_#{@pagination_block}')); }, onSuccess: function(){ $('pagenum').innerHTML = parseInt(page) + 1; } });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pagination_navigation
|
||||||
|
%p
|
||||||
|
%a{ :href => '#', :onclick => "scroll_box(0); return false;", :title => 'First page' }
|
||||||
|
%img{ :src => '/images/go-first.png' }
|
||||||
|
%a{ :href => '#', :onclick => "scroll_box(page - 1); return false;", :title => 'Previous page' }
|
||||||
|
%img{ :src => '/images/go-previous.png' }
|
||||||
|
== <span id="pagenum">#{@page + 1}</span> / #{@page_count}
|
||||||
|
%a{ :href => '#', :onclick => "scroll_box(page + 1); return false;", :title => 'Next page' }
|
||||||
|
%img{ :src => '/images/go-next.png' }
|
||||||
|
%a{ :href => '#', :onclick => "scroll_box(page_count - 1); return false;", :title => 'Next page' }
|
||||||
|
%img{ :src => '/images/go-last.png' }
|
|
@ -1,11 +0,0 @@
|
||||||
#pagination_navigation
|
|
||||||
%p
|
|
||||||
%a{ :href => '#', :onclick => "scroll_box(0); return false;", :title => 'First page' }
|
|
||||||
%img{ :src => '/images/go-first.png' }
|
|
||||||
%a{ :href => '#', :onclick => "scroll_box(page - 1); return false;", :title => 'Previous page' }
|
|
||||||
%img{ :src => '/images/go-previous.png' }
|
|
||||||
== <span id="pagenum">#{@page + 1}</span> / #{@page_count}
|
|
||||||
%a{ :href => '#', :onclick => "scroll_box(page + 1); return false;", :title => 'Next page' }
|
|
||||||
%img{ :src => '/images/go-next.png' }
|
|
||||||
%a{ :href => '#', :onclick => "scroll_box(page_count - 1); return false;", :title => 'Next page' }
|
|
||||||
%img{ :src => '/images/go-last.png' }
|
|
|
@ -1,8 +1,6 @@
|
||||||
%h1 Photos of oneness
|
%h1 Photos of oneness
|
||||||
|
|
||||||
|
#photo_browser_container
|
||||||
= pagination 'photo_browser', url(:photos)
|
= pagination 'photo_browser', url(:photos)
|
||||||
|
|
||||||
#browser_container.centered
|
|
||||||
= partial 'home/pagination_navigation'
|
|
||||||
#photo_browser
|
#photo_browser
|
||||||
= partial 'photos/photo_browser'
|
= partial 'photos/photo_browser'
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
= pagination 'scrolling_photo_block', url(:vote, :id => @user.user_name)
|
|
||||||
|
|
||||||
#scrolling_photo_block_container
|
#scrolling_photo_block_container
|
||||||
= partial 'home/pagination_navigation'
|
= pagination 'scrolling_photo_block', url(:vote, :id => @user.user_name)
|
||||||
#scrolling_photo_block
|
#scrolling_photo_block
|
||||||
= partial 'votes/stats_for_user'
|
= partial 'votes/stats_for_user'
|
||||||
|
|
||||||
|
|
Reference in New Issue