aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-04-03 17:42:50 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2012-04-03 17:42:50 +0200
commit7340aef64ecd0a0912a96cba2a6ca34cd704e4aa (patch)
tree8740816b868dcd7a318aba0379e9fe5cdfa328df
parent1144331b32d3c9065af161227f40fc0cac9338a0 (diff)
downloadsonarqube-7340aef64ecd0a0912a96cba2a6ca34cd704e4aa.tar.gz
sonarqube-7340aef64ecd0a0912a96cba2a6ca34cd704e4aa.zip
SONAR-3383 keep context of tab, page and search filter
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_groups.html.erb7
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_users.html.erb5
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb12
4 files changed, 16 insertions, 10 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb
index a4831834b37..eae03bffe58 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb
@@ -78,6 +78,6 @@ class RolesController < ApplicationController
private
def redirect
- redirect_to(:action => params['redirect'] || 'global')
+ redirect_to(:action => params['redirect'] || 'global', :q => params[:q], :qualifier => params[:qualifier], :page => params[:page])
end
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_groups.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_groups.html.erb
index fec44e938a9..d62f6f7dd34 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_groups.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_groups.html.erb
@@ -9,7 +9,7 @@
title="Global #{role_name(@role)}"
end
%>
-<div class="subtitle">&raquo; <a href="<%= url_for :action => params[:redirect] -%>">Back</a></div>
+<div class="subtitle">&raquo; <a href="<%= url_for :action => params[:redirect], :q => params[:q], :qualifier => params[:qualifier] -%>">Back</a></div>
<h1><%= title %></h1>
<br/>
<div>
@@ -17,6 +17,9 @@
<input name="resource" value="<%= params[:resource] -%>" type="hidden"/>
<input name="role" value="<%= @role -%>" type="hidden"/>
<input name="redirect" value="<%= params[:redirect] -%>" type="hidden"/>
+ <input name="q" value="<%= params[:q] -%>" type="hidden" />
+ <input name="qualifier" value="<%= params[:qualifier] -%>" type="hidden" />
+ <input name="page" value="<%= params[:page] -%>" type="hidden" />
<table>
<tbody>
<tr>
@@ -43,7 +46,7 @@
<% end %>
</select><br>
- <div style="padding: 5px 0pt;">
+ <div style="padding: 5px 0;">
<input id="save" value="Save" onclick="SelectBox.select_all('to');submit();return false;" type="submit">
</div>
</td>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_users.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_users.html.erb
index 7c724973203..295a56ec59e 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_users.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_users.html.erb
@@ -9,7 +9,7 @@
title="Global #{role_name(@role)}"
end
%>
-<div class="subtitle">&raquo; <a href="<%= url_for :action => params[:redirect] -%>">Back</a></div>
+<div class="subtitle">&raquo; <a href="<%= url_for :action => params[:redirect], :q => params[:q], :qualifier => params[:qualifier] -%>">Back</a></div>
<h1><%= title %></h1>
<br/>
<div id="main_content">
@@ -17,6 +17,9 @@
<input name="resource" value="<%= params[:resource] -%>" type="hidden"/>
<input name="role" value="<%= @role -%>" type="hidden" />
<input name="redirect" value="<%= params[:redirect] -%>" type="hidden" />
+ <input name="q" value="<%= params[:q] -%>" type="hidden" />
+ <input name="qualifier" value="<%= params[:qualifier] -%>" type="hidden" />
+ <input name="page" value="<%= params[:page] -%>" type="hidden" />
<table>
<tbody>
<tr>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb
index f268b703363..0da89fb8185 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb
@@ -102,9 +102,9 @@
groups=project.group_roles.select { |gr| gr.role=='admin' }.map { |gr| group_name(gr.group) }
%>
<%= users.join(', ') %>
- (<%= link_to "select users", {:action => 'edit_users', :role => 'admin', :resource => project.id, :redirect => 'projects'}, :class => 'link-action' %>)<br/>
+ (<a href="<%= ApplicationController.root_context -%>/roles/edit_users?redirect=projects&role=admin&resource=<%= project.id -%>&q=<%= u params[:q] -%>&qualifier=<%= @qualifier -%>&page=<%= params[:page] -%>" class="link-action">select users</a>)<br/>
<%= groups.join(', ') %>
- (<%= link_to "select groups", {:action => 'edit_groups', :role => 'admin', :resource => project.id, :redirect => 'projects'}, :class => 'link-action' %>)
+ (<a href="<%= ApplicationController.root_context -%>/roles/edit_groups?redirect=projects&role=admin&resource=<%= project.id -%>&q=<%= u params[:q] -%>&qualifier=<%= @qualifier -%>&page=<%= params[:page] -%>" class="link-action">select groups</a>)
</td>
<td valign="top">
<%
@@ -112,9 +112,9 @@
groups=project.group_roles.select { |gr| gr.role=='user' }.map { |gr| group_name(gr.group) }
%>
<%= users.join(', ') %>
- (<%= link_to "select users", {:action => 'edit_users', :role => 'user', :resource => project.id, :redirect => 'projects'}, :class => 'link-action' %>)<br/>
+ (<a href="<%= ApplicationController.root_context -%>/roles/edit_users?redirect=projects&role=user&resource=<%= project.id -%>&q=<%= u params[:q] -%>&qualifier=<%= @qualifier -%>&page=<%= params[:page] -%>" class="link-action">select users</a>)<br/>
<%= groups.join(', ') %>
- (<%= link_to "select groups", {:action => 'edit_groups', :role => 'user', :resource => project.id, :redirect => 'projects'}, :class => 'link-action' %>)
+ (<a href="<%= ApplicationController.root_context -%>/roles/edit_groups?redirect=projects&role=user&resource=<%= project.id -%>&q=<%= u params[:q] -%>&qualifier=<%= @qualifier -%>&page=<%= params[:page] -%>" class="link-action">select groups</a>)
</td>
<td valign="top">
<%
@@ -122,9 +122,9 @@
groups=project.group_roles.select { |gr| gr.role=='codeviewer' }.map { |gr| group_name(gr.group) }
%>
<%= users.join(', ') %>
- (<%= link_to "select users", {:action => 'edit_users', :role => 'codeviewer', :resource => project.id, :redirect => 'projects'}, :class => 'link-action' %>)<br/>
+ (<a href="<%= ApplicationController.root_context -%>/roles/edit_users?redirect=projects&role=codeviewer&resource=<%= project.id -%>&q=<%= u params[:q] -%>&qualifier=<%= @qualifier -%>&page=<%= params[:page] -%>" class="link-action">select users</a>)<br/>
<%= groups.join(', ') %>
- (<%= link_to "select groups", {:action => 'edit_groups', :role => 'codeviewer', :resource => project.id, :redirect => 'projects'}, :class => 'link-action' %>)
+ (<a href="<%= ApplicationController.root_context -%>/roles/edit_groups?redirect=projects&role=codeviewer&resource=<%= project.id -%>&q=<%= u params[:q] -%>&qualifier=<%= @qualifier -%>&page=<%= params[:page] -%>" class="link-action">select groups</a>)
</td>
</tr>
<%