aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-11-03 11:04:26 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-11-03 11:04:26 +0000
commit7fb6c24c478db3b8f60cc41baa771402339fb21b (patch)
tree61af03cf74de96e5cffeb36fe1e6934ce0cf606e /sonar-server
parent1c83344e651d1b69b4e44f5e4dac5f3fa0a7f414 (diff)
downloadsonarqube-7fb6c24c478db3b8f60cc41baa771402339fb21b.tar.gz
sonarqube-7fb6c24c478db3b8f60cc41baa771402339fb21b.zip
SONAR-1643 change URL format for permalinks and breadcrumb
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb22
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb6
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/edit_layout.html.erb10
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb2
11 files changed, 28 insertions, 28 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb
index b554f01d01a..293a45ff67d 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb
@@ -44,7 +44,7 @@ class DashboardController < ApplicationController
end
def set_layout
- dashboard=Dashboard.find(params[:id].to_i)
+ dashboard=Dashboard.find(params[:did].to_i)
if dashboard.editable_by?(current_user)
dashboard.column_layout=params[:layout]
if dashboard.save
@@ -55,7 +55,7 @@ class DashboardController < ApplicationController
end
end
end
- redirect_to :action => 'index', :id => dashboard.id, :resource => params[:resource]
+ redirect_to :action => 'index', :did => dashboard.id, :id => params[:id]
end
def set_dashboard
@@ -84,7 +84,7 @@ class DashboardController < ApplicationController
end
def add_widget
- dashboard=Dashboard.find(params[:id].to_i)
+ dashboard=Dashboard.find(params[:did].to_i)
widget_id=nil
if dashboard.editable_by?(current_user)
definition=java_facade.getWidget(params[:widget])
@@ -97,12 +97,12 @@ class DashboardController < ApplicationController
widget_id=new_widget.id
end
end
- redirect_to :action => 'configure', :id => dashboard.id, :resource => params[:resource], :highlight => widget_id
+ redirect_to :action => 'configure', :did => dashboard.id, :id => params[:id], :highlight => widget_id
end
def save_widget
- widget=Widget.find(params[:id].to_i)
+ widget=Widget.find(params[:wid].to_i)
#TODO check owner of dashboard
definition=java_facade.getWidget(widget.widget_key)
errors_by_property_key={}
@@ -124,7 +124,7 @@ class DashboardController < ApplicationController
widget.save
widget.properties.each {|p| p.save}
render :update do |page|
- page.redirect_to(url_for(:action => :configure, :id => widget.dashboard_id, :resource => params[:resource]))
+ page.redirect_to(url_for(:action => :configure, :did => widget.dashboard_id, :id => params[:id]))
end
else
widget.configured=false
@@ -140,8 +140,8 @@ class DashboardController < ApplicationController
def load_dashboard
@active=nil
if logged_in?
- if params[:id]
- @active=ActiveDashboard.find(:first, :include => 'dashboard', :conditions => ['active_dashboards.dashboard_id=? AND active_dashboards.user_id=?', params[:id].to_i, current_user.id])
+ if params[:did]
+ @active=ActiveDashboard.find(:first, :include => 'dashboard', :conditions => ['active_dashboards.dashboard_id=? AND active_dashboards.user_id=?', params[:did].to_i, current_user.id])
elsif params[:name]
@active=ActiveDashboard.find(:first, :include => 'dashboard', :conditions => ['dashboards.name=? AND active_dashboards.user_id=?', params[:name], current_user.id])
else
@@ -151,8 +151,8 @@ class DashboardController < ApplicationController
if @active.nil?
# anonymous or not found in user dashboards
- if params[:id]
- @active=ActiveDashboard.find(:first, :include => 'dashboard', :conditions => ['active_dashboards.dashboard_id=? AND active_dashboards.user_id IS NULL', params[:id].to_i])
+ if params[:did]
+ @active=ActiveDashboard.find(:first, :include => 'dashboard', :conditions => ['active_dashboards.dashboard_id=? AND active_dashboards.user_id IS NULL', params[:did].to_i])
elsif params[:name]
@active=ActiveDashboard.find(:first, :include => 'dashboard', :conditions => ['dashboards.name=? AND active_dashboards.user_id IS NULL', params[:name]])
else
@@ -163,7 +163,7 @@ class DashboardController < ApplicationController
end
def load_resource
- @resource=Project.by_key(params[:resource])
+ @resource=Project.by_key(params[:id])
if @resource.nil?
# TODO display error page
redirect_to home_path
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb
index 69b6296a12b..a27e5c595dc 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb
@@ -50,7 +50,7 @@ class DashboardsController < ApplicationController
add_default_dashboards_if_first_user_dashboard
last_active_dashboard=current_user.active_dashboards.max{|x,y| x.order_index<=>y.order_index}
current_user.active_dashboards.create(:dashboard => @dashboard, :user_id => current_user.id, :order_index => (last_active_dashboard ? last_active_dashboard.order_index+1: 1))
- redirect_to :controller => 'dashboard', :action => 'configure', :id => @dashboard.id, :resource => params[:resource]
+ redirect_to :controller => 'dashboard', :action => 'configure', :did => @dashboard.id, :id => params[:resource]
else
flash[:error]=@dashboard.errors.full_messages.join('<br/>')
redirect_to :controller => 'dashboards', :action => 'index', :resource => params[:resource]
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb
index 11f71379f6c..ef27c1109be 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb
@@ -300,7 +300,7 @@ module ApplicationHelper
def link_to_resource(resource, name=nil, options={})
if resource.display_dashboard?
if options[:dashboard]
- link_to(name || resource.name, {:overwrite_params => {:controller => 'project', :action => 'index', :id => resource.copy_resource_id || resource.id}}, :title => options[:title])
+ link_to(name || resource.name, {:overwrite_params => {:controller => 'dashboard', :action => 'index', :id => resource.copy_resource_id || resource.id}}, :title => options[:title])
else
# stay on the same page (for example components)
link_to(name || resource.name, {:overwrite_params => {:id => resource.copy_resource_id || resource.id}}, :title => options[:title])
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb
index db775bfe743..94f8cbc6375 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb
@@ -18,7 +18,7 @@
<div class="widget_props" id="widget_props_<%= widget.id -%>" style="<%= 'display:none' if widget.configured -%>">
- <% form_remote_tag :url => {:action => 'save_widget', :id => widget.id, :resource => params[:resource]}, :method => :post do -%>
+ <% form_remote_tag :url => {:action => 'save_widget', :wid => widget.id, :id => params[:id]}, :method => :post do -%>
<table class="form">
<tbody>
<% definition.getProperties().each do |property_def|
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb
index c68cee1a18b..040d8ba867f 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb
@@ -2,11 +2,11 @@
<% if logged_in? %>
<ul class="operations">
<% if back %>
- <li class="last"><%= link_to 'Back to dashboard', {:action => 'index', :id => @dashboard.id, :resource => @resource.id } -%></li>
+ <li class="last"><%= link_to 'Back to dashboard', {:action => 'index', :did => @dashboard.id, :id => @resource.id } -%></li>
<% else %>
<% if @dashboard.editable_by?(current_user) %>
- <li><%= link_to 'Configure widgets', {:action => 'configure', :id => @dashboard.id, :resource => @resource.id } -%></li>
- <li><%= link_to 'Edit layout', {:action => 'edit_layout', :id => @dashboard.id, :resource => @resource.id } -%></li>
+ <li><%= link_to 'Configure widgets', {:action => 'configure', :did => @dashboard.id, :id => @resource.id } -%></li>
+ <li><%= link_to 'Edit layout', {:action => 'edit_layout', :did => @dashboard.id, :id => @resource.id } -%></li>
<% end %>
<li class="last"><%= link_to 'Manage dashboards', {:controller => 'dashboards', :action => 'index', :resource => @resource.id } -%></li>
<% end %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb
index 03a6bcd7a70..592313173f9 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb
@@ -17,7 +17,7 @@
%>
<% else %>
<div class="widget">
- <p>Please <a href="<%= url_for :action => :configure, :id => @dashboard.id, :resource => @resource.id -%>">configure</a> the widget <b><%= definition.getTitle() -%></b>.</p>
+ <p>Please <a href="<%= url_for :action => :configure, :did => @dashboard.id, :id => @resource.id -%>">configure</a> the widget <b><%= definition.getTitle() -%></b>.</p>
</div>
<% end %>
<div style="clear: both;"></div>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb
index 880d5a1ca99..ef2dd5203db 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb
@@ -2,7 +2,7 @@
<div class="widget_def" id="def_<%= definition.getId().tr('_', '') -%>">
<p><b><%= h definition.getTitle() -%></b></p>
<p><%= h definition.getDescription() -%></p>
-<%= form_tag :action => 'add_widget', :id => @dashboard.id, :resource => params[:resource], :widget => definition.getId() %>
+<%= form_tag :action => 'add_widget', :did => @dashboard.id, :id => params[:id], :widget => definition.getId() %>
<input type="submit" value="Add widget" >
</form>
</div>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb
index 656b86a4429..bcb71d3b551 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb
@@ -14,7 +14,7 @@
highlight_duration: 2,
highlight_startcolor: '#cae3f2',
highlight_endcolor: '#ffffff',
- saveurl: '<%= url_for :action => 'set_dashboard', :id => @dashboard.id, :resource => @resource.id -%>'
+ saveurl: '<%= url_for :action => 'set_dashboard', :did => @dashboard.id, :id => @resource.id -%>'
};
var portal;
function init_dashboard() {
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/edit_layout.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/edit_layout.html.erb
index 5006a908a77..3dcb0ad4d02 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/edit_layout.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/edit_layout.html.erb
@@ -5,23 +5,23 @@
<p class="note">Click to choose the layout: </p><br/>
<!--100%-->
<div class="select-layout <%= 'selected' if @dashboard.layout=='100' -%>" style="text-align:center;width: 20%;">
- <%= link_to image_tag('layout100.png'), {:action => 'set_layout', :id => @dashboard.id, :resource => @resource.id, :layout => "100"}, :method => :post %>
+ <%= link_to image_tag('layout100.png'), {:action => 'set_layout', :did => @dashboard.id, :id => @resource.id, :layout => "100"}, :method => :post %>
</div>
<!--50%-50%-->
<div class="select-layout <%= 'selected' if @dashboard.layout=="50-50" -%>" style="text-align:center;width: 20%;">
- <%= link_to image_tag('layout5050.png'), {:action => 'set_layout', :id => @dashboard.id, :resource => @resource.id, :layout => "50-50"}, :method => :post %>
+ <%= link_to image_tag('layout5050.png'), {:action => 'set_layout', :did => @dashboard.id, :id => @resource.id, :layout => "50-50"}, :method => :post %>
</div>
<!--30%-70%-->
<div class="select-layout <%= 'selected' if @dashboard.layout=="30-70" -%>" style="text-align:center;width: 20%;">
- <%= link_to image_tag('layout3070.png'), {:action => 'set_layout', :id => @dashboard.id, :resource => @resource.id, :layout => "30-70"}, :method => :post %>
+ <%= link_to image_tag('layout3070.png'), {:action => 'set_layout', :did => @dashboard.id, :id => @resource.id, :layout => "30-70"}, :method => :post %>
</div>
<!--70%-30%-->
<div class="select-layout <%= 'selected' if @dashboard.layout=="70-30" -%>" style="text-align:center;width: 20%;">
- <%= link_to image_tag('layout7030.png'), {:action => 'set_layout', :id => @dashboard.id, :resource => @resource.id, :layout => "70-30"}, :method => :post %>
+ <%= link_to image_tag('layout7030.png'), {:action => 'set_layout', :did => @dashboard.id, :id => @resource.id, :layout => "70-30"}, :method => :post %>
</div>
<!--33%-33%-33%-->
<div class="select-layout <%= 'selected' if @dashboard.layout=="33-33-33" -%>" style="text-align:center;width: 19%;">
- <%= link_to image_tag('layout333333.png'), {:action => 'set_layout', :id => @dashboard.id, :resource => @resource.id, :layout => "33-33-33"}, :method => :post %>
+ <%= link_to image_tag('layout333333.png'), {:action => 'set_layout', :did => @dashboard.id, :id => @resource.id, :layout => "33-33-33"}, :method => :post %>
</div>
<div style="clear:both;"></div>
</div>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb
index aff8b9578a0..489fef62fde 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb
@@ -21,7 +21,7 @@
@actives.each_with_index do |active,index| %>
<tr id="dashboard-<%= u active.name -%>" class="<%= cycle('even','odd', :name => 'dashboards') -%>">
<td>
- <%= link_to active.name, {:controller => :dashboard, :action => :index, :id => active.dashboard_id, :resource => params[:resource]} -%>
+ <%= link_to active.name, {:controller => :dashboard, :action => :index, :did => active.dashboard_id, :id => params[:resource]} -%>
<% if active.dashboard.description.present? %>
<p class="small"><%= h active.dashboard.description -%></p>
<% end %>
@@ -43,7 +43,7 @@
</td>
<td>
<% if active.owner?(current_user) %>
- <%= link_to 'Configure widgets', {:controller => :dashboard, :action => 'configure', :id => active.dashboard_id, :resource => params[:resource]}, :id => "configure-#{u active.name}" %>
+ <%= link_to 'Configure widgets', {:controller => :dashboard, :action => 'configure', :did => active.dashboard_id, :id => params[:resource]}, :id => "configure-#{u active.name}" %>
|
<%= link_to_remote "Edit", :update => "admin_form", :url => { :action => "edit", :id => active.dashboard_id, :resource => params[:resource] }, :id => "edit-#{u active.name}", :method => :get %>
|
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb
index cedafc0abcb..aeefa08a45f 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb
@@ -35,7 +35,7 @@
<% elsif (selected_section==Navigation::SECTION_RESOURCE) %>
<% ActiveDashboard.user_dashboards(current_user).each do |active_dashboard| %>
- <li class="<%= 'selected' if @dashboard && controller.controller_path=='dashboard' && active_dashboard.dashboard_id==@dashboard.id -%>"><a href="<%= ApplicationController.root_context -%>/dashboard/index/<%= active_dashboard.dashboard_id -%>?resource=<%= @project.id -%>"><%= active_dashboard.dashboard.name -%></a></li>
+ <li class="<%= 'selected' if @dashboard && controller.controller_path=='dashboard' && active_dashboard.dashboard_id==@dashboard.id -%>"><a href="<%= ApplicationController.root_context -%>/dashboard/index/<%= @project.id -%>?did=<%= active_dashboard.dashboard_id -%>"><%= active_dashboard.dashboard.name -%></a></li>
<% end %>
<li class="<%= 'selected' if request.request_uri.include?('/components/index') -%>"><a href="<%= ApplicationController.root_context -%>/components/index/<%= @project.id -%>">Components</a></li>
<li class="<%= 'selected' if request.request_uri.include?('/drilldown/violations') -%>"><a href="<%= ApplicationController.root_context -%>/drilldown/violations/<%= @project.id -%>">Violations drilldown</a></li>