]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3491 Show shared dashboards owner
authorDavid Gageot <david@gageot.net>
Fri, 15 Jun 2012 15:52:16 +0000 (17:52 +0200)
committerDavid Gageot <david@gageot.net>
Fri, 15 Jun 2012 15:52:16 +0000 (17:52 +0200)
plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/views/admin_dashboards/_list.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/admin_dashboards/index.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb
sonar-server/src/main/webapp/stylesheets/dashboard.css

index 4ce9fc09b35e78131ac664ce3e2d0ee52ef67757..b973de86df5230a5ad5b8a6ae6f803bc9e75d4dc 100644 (file)
@@ -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]
 
 
 #------------------------------------------------------------------------------
index 12fbe5944bc6b367f710902d882278d3f54af550..d903d2d4f1159818b22d8ab6b096cae148e00870 100644 (file)
@@ -2,15 +2,15 @@
   <thead>
   <tr>
     <th class="name"><%= message('name') -%></th>
-    <th><%= message('shared_by') -%></th>
+    <th class="shared"><%= message('shared_by') -%></th>
     <th class="order"><%= message('order') -%></th>
-    <th class="right"><%= message('operations') -%></th>
+    <th class="operations"><%= message('operations') -%></th>
   </tr>
   </thead>
   <tbody>
   <% if active_dashboards.empty? %>
     <tr class="even">
-      <td colspan="4"><%= message('dashboard.no_dashboard') -%></td>
+      <td colspan="4" class="empty"><%= message('dashboard.no_dashboard') -%></td>
     </tr>
   <% else %>
     <% active_dashboards.each_with_index do |active, index| %>
           <div><%= h(active.name(true)) -%></div>
           <div class="description"><%= active.dashboard.description -%></div>
         </td>
-        <td><%= h(active.dashboard.user.name) if active.dashboard.user %></td>
-        <td>
+        <td class="shared">
+          <% if active.dashboard.shared %>
+            <%= h(active.dashboard.user_name || message('dashboard.username.default')) -%>
+          <% end %>
+        </td>
+        <td class="order">
           <% if index > 0 %>
             <%= link_to image_tag('blue-up.png'), {:action => :up, :id => active.id}, :method => :post, :id => "up-#{u active.name}" %>
           <% else %>
           <% 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 %>
         </td>
-        <td class="thin nowrap right">
+        <td class="thin nowrap operations">
           <% 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 %>
index b59d91b8a1285397d94a98e95c443739c6397d7f..32bc6ad7aa6b0bce3fbb675aba02a15278cbae52 100644 (file)
@@ -19,9 +19,9 @@
     <thead>
     <tr>
       <th class="name"><%= message('name') -%></th>
-      <th><%= message('shared_by') -%></th>
-      <th><%= message('global') -%></th>
-      <th class="right"><%= message('operations') -%></th>
+      <th class="shared"><%= message('shared_by') -%></th>
+      <th class="global"><%= message('global') -%></th>
+      <th class="operations"><%= message('operations') -%></th>
     </tr>
     </thead>
     <tbody>
             <div><%= h(dashboard.name(true)) -%></div>
             <div class="description"><%= dashboard.description -%></div>
           </td>
-          <td><%= h(dashboard.user.name) if dashboard.user -%></td>
-          <td>
+          <td class="shared">
+            <% if dashboard.shared %>
+              <%= h(dashboard.user_name || message('dashboard.username.default')) -%>
+            <% end %>
+          </td>
+          <td class="global">
             <%= boolean_icon(dashboard.global) -%>
           </td>
-          <td class="thin nowrap right">
+          <td class="thin nowrap operations">
             <%= link_to 'Add to defaults', {:action => 'add', :id => dashboard.id}, {:method => :post, :id => "add-#{u dashboard.name}", :class => 'link-action'} %>
           </td>
         </tr>
index 6a89aacb3b04ba6f3d5a401e0efd5fa8242256ce..500e94de9d2adb2c13ce95628ea81d4f36b08839 100644 (file)
@@ -8,11 +8,9 @@
       <thead>
       <tr>
         <th class="name"><%= message('name') -%></th>
-        <% if is_admin %>
-          <th><%= message('shared') -%></th>
-        <% end %>
+        <th class="shared"><%= message('shared_by') -%></th>
         <th class="order"><%= message('order') -%></th>
-        <th class="right"><%= message('operations') -%></th>
+        <th class="operations"><%= message('operations') -%></th>
       </tr>
       </thead>
       <tbody>
               <%= active.name(true) -%>
               <div class="description"><%= h active.dashboard.description -%></div>
             </td>
-            <% if is_admin %>
-              <td>
-                <%= boolean_icon(active.dashboard.shared) -%>
-              </td>
-            <% end %>
-            <td>
+            <td class="shared">
+              <% if active.dashboard.shared %>
+                <%= h(active.dashboard.user_name || message('dashboard.username.default')) -%>
+              <% end %>
+            </td>
+            <td class="order">
               <% 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 %>
               <% 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 %>
             </td>
-            <td class="thin nowrap right">
+            <td class="thin nowrap operations">
               <% 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' %>
       <thead>
       <tr>
         <th class="name"><%= message('name') -%></th>
-        <th><%= message('shared_by') -%></th>
-        <th class="right"><%= message('operations') -%></th>
+        <th class="shared"><%= message('shared_by') -%></th>
+        <th class="order">&nbsp;</th>
+        <th class="operations"><%= message('operations') -%></th>
       </tr>
       </thead>
       <tbody>
       <% if @shared_dashboards.nil? || @shared_dashboards.empty? %>
         <tr class="even">
-          <td colspan="5"><%= message('dashboard.no_dashboard') -%></td>
+          <td colspan="5" class="empty"><%= message('dashboard.no_dashboard') -%></td>
         </tr>
       <%
          else
               <%= dashboard.name(true) -%>
               <div class="description"><%= h dashboard.description -%></div>
             </td>
-            <td>
-              <%= dashboard.user_name -%>
+            <td class="shared">
+              <% if dashboard.shared %>
+                <%= h(dashboard.user_name || message('dashboard.username.default')) -%>
+              <% end %>
             </td>
-            <td class="thin nowrap right">
+            <td class="order">&nbsp;</td>
+            <td class="thin nowrap operations">
               <% 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'} %>
index f328e612fb36add49d2488fb9c654f3abe855d83..9b34c96f0c51dc5053f1696c758c128ab90551e9 100644 (file)
   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 {