From: David Gageot Date: Fri, 15 Jun 2012 15:52:16 +0000 (+0200) Subject: SONAR-3491 Show shared dashboards owner X-Git-Tag: 3.2~318 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b7282a3a20a3d8783ad444832253c99f1959b787;p=sonarqube.git SONAR-3491 Show shared dashboards owner --- diff --git a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties index 4ce9fc09b35..b973de86df5 100644 --- a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties +++ b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties @@ -543,6 +543,7 @@ dashboard.error_unshare_default=This dashboard can't be unshared as long as it's dashboard.global_dashboards.description=These dashboards are displayed to anonymous users or users who have not customized their dashboards. dashboard.project_dashboards.description=These dashboards are displayed to anonymous users or users who have not customized their dashboards. dashboard.shared_dashboards.description=These dashboards can be added to default dashboards. +dashboard.username.default=[Sonar] #------------------------------------------------------------------------------ diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/admin_dashboards/_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/admin_dashboards/_list.html.erb index 12fbe5944bc..d903d2d4f11 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/admin_dashboards/_list.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/admin_dashboards/_list.html.erb @@ -2,15 +2,15 @@ <%= message('name') -%> - <%= message('shared_by') -%> + <%= message('shared_by') -%> <%= message('order') -%> - <%= message('operations') -%> + <%= message('operations') -%> <% if active_dashboards.empty? %> - <%= message('dashboard.no_dashboard') -%> + <%= message('dashboard.no_dashboard') -%> <% else %> <% active_dashboards.each_with_index do |active, index| %> @@ -19,8 +19,12 @@
<%= h(active.name(true)) -%>
<%= active.dashboard.description -%>
- <%= h(active.dashboard.user.name) if active.dashboard.user %> - + + <% if active.dashboard.shared %> + <%= h(active.dashboard.user_name || message('dashboard.username.default')) -%> + <% end %> + + <% if index > 0 %> <%= link_to image_tag('blue-up.png'), {:action => :up, :id => active.id}, :method => :post, :id => "up-#{u active.name}" %> <% else %> @@ -28,9 +32,11 @@ <% end %> <% if index < active_dashboards.size-1 %> <%= link_to image_tag('blue-down.png'), {:action => :down, :id => active.id}, :method => :post, :id => "down-#{u active.name}" %> - <% end %> + <% else %> + <%= image_tag('transparent_16.gif') %> + <% end %> - + <% if active_dashboards.size() > 1 %> <%= link_to 'Remove from defaults', {:action => :remove, :id => active.id}, {:confirm => 'Are you sure to remove it from default dashboards ?', :method => :post, :id => "remove-#{u active.name}", :class => 'link-action'} %> <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/admin_dashboards/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/admin_dashboards/index.html.erb index b59d91b8a12..32bc6ad7aa6 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/admin_dashboards/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/admin_dashboards/index.html.erb @@ -19,9 +19,9 @@ <%= message('name') -%> - <%= message('shared_by') -%> - <%= message('global') -%> - <%= message('operations') -%> + <%= message('shared_by') -%> + <%= message('global') -%> + <%= message('operations') -%> @@ -36,11 +36,15 @@
<%= h(dashboard.name(true)) -%>
<%= dashboard.description -%>
- <%= h(dashboard.user.name) if dashboard.user -%> - + + <% if dashboard.shared %> + <%= h(dashboard.user_name || message('dashboard.username.default')) -%> + <% end %> + + <%= boolean_icon(dashboard.global) -%> - + <%= link_to 'Add to defaults', {:action => 'add', :id => dashboard.id}, {:method => :post, :id => "add-#{u dashboard.name}", :class => 'link-action'} %> 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 6a89aacb3b0..500e94de9d2 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 @@ -8,11 +8,9 @@ <%= message('name') -%> - <% if is_admin %> - <%= message('shared') -%> - <% end %> + <%= message('shared_by') -%> <%= message('order') -%> - <%= message('operations') -%> + <%= message('operations') -%> @@ -27,12 +25,12 @@ <%= active.name(true) -%>
<%= h active.dashboard.description -%>
- <% if is_admin %> - - <%= boolean_icon(active.dashboard.shared) -%> - - <% end %> - + + <% if active.dashboard.shared %> + <%= h(active.dashboard.user_name || message('dashboard.username.default')) -%> + <% end %> + + <% if index > 0 %> <%= link_to image_tag('blue-up.png'), {:action => :up, :id => active.dashboard_id, :resource => params[:resource]}, :method => :post, :id => "up-#{u active.name}" %> <% else %> @@ -40,9 +38,11 @@ <% end %> <% if index < @actives.size-1 %> <%= link_to image_tag('blue-down.png'), {:action => :down, :id => active.dashboard_id, :resource => params[:resource]}, :method => :post, :id => "down-#{u active.name}" %> - <% end %> + <% else %> + <%= image_tag('transparent_16.gif') %> + <% end %> - + <% if active.editable_by?(current_user) %> <%= link_to message('dashboard.configure_widgets'), {:controller => :dashboard, :action => :configure, :did => active.dashboard_id, :id => (params[:resource] unless active.global?)}, :id => "configure-#{u active.name}", :class => 'link-action' %> @@ -76,14 +76,15 @@ <%= message('name') -%> - <%= message('shared_by') -%> - <%= message('operations') -%> + <%= message('shared_by') -%> +   + <%= message('operations') -%> <% if @shared_dashboards.nil? || @shared_dashboards.empty? %> - <%= message('dashboard.no_dashboard') -%> + <%= message('dashboard.no_dashboard') -%> <% else @@ -93,10 +94,13 @@ <%= dashboard.name(true) -%>
<%= h dashboard.description -%>
- - <%= dashboard.user_name -%> + + <% if dashboard.shared %> + <%= h(dashboard.user_name || message('dashboard.username.default')) -%> + <% end %> - +   + <% if dashboard.editable_by?(current_user) %> <%= link_to_remote message('edit'), {:update => "create_dashboard", :url => {:action => :edit, :id => dashboard.id, :resource => params[:resource]}}, {:id => "edit-#{u dashboard.name}", :method => :get, :class => 'link-action'} %> diff --git a/sonar-server/src/main/webapp/stylesheets/dashboard.css b/sonar-server/src/main/webapp/stylesheets/dashboard.css index f328e612fb3..9b34c96f0c5 100644 --- a/sonar-server/src/main/webapp/stylesheets/dashboard.css +++ b/sonar-server/src/main/webapp/stylesheets/dashboard.css @@ -132,12 +132,23 @@ margin-bottom: 50px; } -.admin_page th.name { - width: 200px; +.admin_page .empty { + font-style: italic; } -.admin_page th.order { - width: 45px; +.admin_page .operations { + width: 260px; + text-align: right; +} + +.admin_page .shared { + width: 140px; + text-align: center; +} + +.admin_page .order, .admin_page .global { + width: 60px; + text-align: center; } .admin_page .description {