From 881a040a4a92b950db1574097036dd35730df4ea Mon Sep 17 00:00:00 2001 From: Michel Felipe de Oliveira Ferreira Date: Wed, 11 Nov 2015 16:28:30 -0300 Subject: [PATCH] Changes to fix problem about lose filter params if perform a submit post action in a task list --- controllers/myprofile/proposals_discussion_plugin_tasks_controller.rb | 8 ++++++++ views/proposals_discussion_plugin_tasks/index.html.erb | 10 ++++++++++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/controllers/myprofile/proposals_discussion_plugin_tasks_controller.rb b/controllers/myprofile/proposals_discussion_plugin_tasks_controller.rb index 5c1e191..5cf6bb3 100644 --- a/controllers/myprofile/proposals_discussion_plugin_tasks_controller.rb +++ b/controllers/myprofile/proposals_discussion_plugin_tasks_controller.rb @@ -44,6 +44,14 @@ class ProposalsDiscussionPluginTasksController < TasksController @failed = params ? params[:failed] : {} @responsible_candidates = profile.members.by_role(profile.roles.reject {|r| !r.has_permission?('perform_task')}).order('name asc') if profile.organization? + + @params_tags = [] + params.each do |key,value| + if key =~ /filter_/ && value + @params_tags << view_context.hidden_field_tag(key, value) + end + end + end def save_categories diff --git a/views/proposals_discussion_plugin_tasks/index.html.erb b/views/proposals_discussion_plugin_tasks/index.html.erb index a68b424..d958358 100644 --- a/views/proposals_discussion_plugin_tasks/index.html.erb +++ b/views/proposals_discussion_plugin_tasks/index.html.erb @@ -51,6 +51,16 @@

<% else %> <%= form_tag :action => 'close' do%> + + <% if !@params_tags.empty? %> +

+ <% @params_tags.each do |hidden_tag| %> + + <%= hidden_tag %> + <% end %> +

+ <% end %> + <% button_bar(:class => 'task-actions') do %> <%# FiXME button(:edit, _('View my requests'), :action => 'list_requested') %> <%# FIXME button('menu-mail', _('Send request'), :action => 'new') %> -- libgit2 0.21.2