Mailinglist Archive: opensuse-buildservice (354 mails)

< Previous Next >
[opensuse-buildservice] Redirect fix for build monitor (PATCH)
  • From: Dirk Stoecker <opensuse@xxxxxxxxxxxx>
  • Date: Tue, 13 Feb 2007 09:18:23 +0100 (CET)
  • Message-id: <Pine.LNX.4.64.0702130917170.16306@xxxxxxxxxxxxxxxxx>
Hello,

the trigger build redirects to wrong page, when called from monitor page.
I added a correct redirect in attached patch.

Ciao
--
http://www.dstoecker.eu/ (PGP key available)Index: app/controllers/package_controller.rb
===================================================================
--- app/controllers/package_controller.rb (Revision 1218)
+++ app/controllers/package_controller.rb (Arbeitskopie)
@@ -500,10 +500,17 @@

frontend.cmd_package( project, package, "rebuild", options )

- flash[:note] = "Triggered rebuild."
- logger.debug( "Triggeried Rebuild for #{package}, options=#{options.to_json.to_s}" )
+ logger.debug( "Triggered Rebuild for #{package}, options=#{options.to_json.to_s}" )

- redirect_to :action => "show", :project => project, :package => package
+ redirect = params[:redirect]
+ if redirect = "monitor"
+ flash[:note] = "Triggered rebuild for package #{package}."
+ redirect_to :controller => "project", :action => "monitor",
+ :project => project
+ else
+ flash[:note] = "Triggered rebuild."
+ redirect_to :action => "show", :project => project, :package => package
+ end
end

def check_params
Index: app/views/project/monitor.rhtml
===================================================================
--- app/views/project/monitor.rhtml (Revision 1218)
+++ app/views/project/monitor.rhtml (Arbeitskopie)
@@ -61,7 +61,7 @@
:title => "rebuild package #{packname} for #{repo}/#{arch}" ),
:controller => 'package', :action => 'trigger_rebuild',
:package => packname, :project => @project.to_s,
- :repo => repo, :arch => arch -%>
+ :repo => repo, :arch => arch, :redirect => 'monitor' -%>
<% end %>
<%= link_to status, :action => :live_build_log,
:package => packname, :project => @project.to_s, :arch => arch,
@@ -73,7 +73,7 @@
<%= link_to image_tag( 'rebuild', :border => 0,
:title => "rebuild package #{packname}" ), :controller => 'package',
:action => 'trigger_rebuild', :package => packname,
- :project => @project.to_s if @failed[packname] -%>
+ :project => @project.to_s, :redirect => 'monitor' if @failed[packname] -%>
</td>
</tr>
<% end -%>
< Previous Next >