[Rt-commit] rt branch, 4.6/fix-dashboard-layout, updated. rt-4.4.4-518-g563f095671

? sunnavy sunnavy at bestpractical.com
Wed Nov 13 13:52:06 EST 2019


The branch, 4.6/fix-dashboard-layout has been updated
       via  563f095671663842fa20e858ee7130fcab8f9c9d (commit)
      from  a402d8327e3cd3de00bd15f28f8e9eb62d019cf1 (commit)

Summary of changes:
 share/html/Dashboards/Render.html | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

- Log -----------------------------------------------------------------
commit 563f095671663842fa20e858ee7130fcab8f9c9d
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Nov 14 02:30:54 2019 +0800

    Make dashboard single col layout if no sidebar content

diff --git a/share/html/Dashboards/Render.html b/share/html/Dashboards/Render.html
index 5ea001a7b1..c68bb66ce8 100644
--- a/share/html/Dashboards/Render.html
+++ b/share/html/Dashboards/Render.html
@@ -72,13 +72,17 @@
 
 % $m->callback(CallbackName => 'BeforePanes', Dashboard => $Dashboard, show_cb => $show_cb);
 
-  <div class="col-md-8">
-% $show_cb->('body');
+% my $body = $show_cb->('body');
+% my $sidebar = $show_cb->('sidebar');
+  <div class="col-md-<% $sidebar =~ /\S/ ? 8 : 12 %>">
+    <% $body |n %>
   </div>
 
-    <div class="col-md-4">
-% $show_cb->('sidebar');
-    </div>
+% if ( $sidebar =~ /\S/ ) {
+  <div class="col-md-4">
+    <% $sidebar |n %>
+  </div>
+% }
 
 % $m->callback(CallbackName => 'AfterPanes', Dashboard => $Dashboard, show_cb => $show_cb);
 
@@ -146,7 +150,7 @@ my $title = loc '[_1] Dashboard', $Dashboard->Name;
 
 my $show_cb = sub {
     my $pane = shift;
-    $m->comp('Elements/ShowPortlet/dashboard',
+    return $m->scomp('Elements/ShowPortlet/dashboard',
         Portlet    => $Dashboard,
         Rows       => $rows,
         Preview    => $Preview,

-----------------------------------------------------------------------


More information about the rt-commit mailing list