diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e6b480b9f..6779fdef8 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -243,39 +243,36 @@ module ApplicationHelper url_param.clear if url_param.has_key?(:set_filter) html = '' - html << link_to_remote(('« ' + l(:label_previous)), - {:update => 'content', - :url => url_param.merge(page_param => paginator.current.previous), - :complete => 'window.scrollTo(0,0)'}, - {:href => url_for(:params => url_param.merge(page_param => paginator.current.previous))}) + ' ' if paginator.current.previous + if paginator.current.previous + html << link_to_remote_content_update('« ' + l(:label_previous), url_param.merge(page_param => paginator.current.previous)) + ' ' + end html << (pagination_links_each(paginator, options) do |n| - link_to_remote(n.to_s, - {:url => {:params => url_param.merge(page_param => n)}, - :update => 'content', - :complete => 'window.scrollTo(0,0)'}, - {:href => url_for(:params => url_param.merge(page_param => n))}) + link_to_remote_content_update(n.to_s, url_param.merge(page_param => n)) end || '') - - html << ' ' + link_to_remote((l(:label_next) + ' »'), - {:update => 'content', - :url => url_param.merge(page_param => paginator.current.next), - :complete => 'window.scrollTo(0,0)'}, - {:href => url_for(:params => url_param.merge(page_param => paginator.current.next))}) if paginator.current.next + + if paginator.current.next + html << ' ' + link_to_remote_content_update((l(:label_next) + ' »'), url_param.merge(page_param => paginator.current.next)) + end unless count.nil? - html << [" (#{paginator.current.first_item}-#{paginator.current.last_item}/#{count})", per_page_links(paginator.items_per_page)].compact.join(' | ') + html << [ + " (#{paginator.current.first_item}-#{paginator.current.last_item}/#{count})", + per_page_links(paginator.items_per_page) + ].compact.join(' | ') end html end - + def per_page_links(selected=nil) url_param = params.dup url_param.clear if url_param.has_key?(:set_filter) links = Setting.per_page_options_array.collect do |n| - n == selected ? n : link_to_remote(n, {:update => "content", :url => params.dup.merge(:per_page => n)}, + n == selected ? n : link_to_remote(n, {:update => "content", + :url => params.dup.merge(:per_page => n), + :method => :get}, {:href => url_for(url_param.merge(:per_page => n))}) end links.size > 1 ? l(:label_display_per_page, links.join(', ')) : nil @@ -664,4 +661,12 @@ module ApplicationHelper extend helper return self end + + def link_to_remote_content_update(text, url_params) + link_to_remote(text, + {:url => url_params, :method => :get, :update => 'content', :complete => 'window.scrollTo(0,0)'}, + {:href => url_for(:params => url_params)} + ) + end + end diff --git a/app/helpers/sort_helper.rb b/app/helpers/sort_helper.rb index ed520e748..85ae8151c 100644 --- a/app/helpers/sort_helper.rb +++ b/app/helpers/sort_helper.rb @@ -121,7 +121,7 @@ module SortHelper url_options = params.has_key?(:set_filter) ? sort_options : params.merge(sort_options) link_to_remote(caption, - {:update => "content", :url => url_options}, + {:update => "content", :url => url_options, :method => :get}, {:href => url_for(url_options)}) + (icon ? nbsp(2) + image_tag(icon) : '') end diff --git a/app/views/projects/changelog.rhtml b/app/views/projects/changelog.rhtml index e4d32a393..e44d1d1ee 100644 --- a/app/views/projects/changelog.rhtml +++ b/app/views/projects/changelog.rhtml @@ -26,7 +26,7 @@ <% end %> <% content_for :sidebar do %> -<% form_tag do %> +<% form_tag({},:method => :get) do %>

<%= l(:label_change_log) %>

<% @trackers.each do |tracker| %>