diff options
author | mr <mr@mrautenberg.de> | 2011-10-19 13:11:24 +0200 |
---|---|---|
committer | mr <mr@mrautenberg.de> | 2011-10-19 13:11:24 +0200 |
commit | d89c87e844e81d016ab3ba8a240e03a609a7015e (patch) | |
tree | 6d5323fee132cfdaa492f9844704a9f855ff2635 /views/models_navigation_bottom.haml | |
parent | 778c58cad1c6a5b81655d731992c64a0efcec592 (diff) | |
parent | f53928a35754c29f7ee912ed5f405731d451f49e (diff) |
Merge branch 'release/v3.0.1'v3.0.1
Diffstat (limited to 'views/models_navigation_bottom.haml')
-rw-r--r-- | views/models_navigation_bottom.haml | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/views/models_navigation_bottom.haml b/views/models_navigation_bottom.haml new file mode 100644 index 0000000..b2425fa --- /dev/null +++ b/views/models_navigation_bottom.haml @@ -0,0 +1,42 @@ +.models_navigation + - js = "" + - if @models.size > 5 + Models: + - if @models.size < 5*@page+5 + - last = @models.size + - else + - last = 5*@page+5 + = "#{5*@page+1}-#{last} / #{@models.size}" + | Page: + - unless @page.to_i == 0 + #prevbot{:class => "link"} + %img{:src => "arrow_left.png", :alt => 'previous', :title => 'previous'}/ + -else + %img{:src => "arrow_left_inactive.png", :alt => '', :title => ''}/ + + - (0..(@models.size/5).to_f.ceil-1).each do |p| + -if p != @page.to_f + %a{:href => '#', :id => "page_linkbot_#{p}", :class => "page page_link"} #{p+1} + - js += "$('#page_linkbot_#{p}').click(function() \{ \n" + - js += " $('#page').val('#{p}');\n" + - js += " $('#nav').submit();\n" + - js += "});\n" + -else + %span{:class => "page page_active"} #{p+1} + + - unless 5*@page.to_i+5 >= @models.size + #nextbot{:class => "link"} + %img{:src => "arrow_right.png", :alt => 'next', :title => 'next'}/ + -else + %img{:src => "arrow_right_inactive.png", :alt => '', :title => ''}/ + + :javascript + $("#prevbot").click(function() { + $("#page").val(#{@page-1}); + $("#nav").submit(); + }); + $("#nextbot").click(function() { + $("#page").val(#{@page+1}); + $("#nav").submit(); + }); + #{js}
\ No newline at end of file |