Commit d3bab43675991d70fa0618e0032e3f5c1b899ed6
1 parent
4280090e
improvements to the dashboard layout.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5084 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
44 additions
and
4 deletions
dashboard.php
| @@ -65,11 +65,27 @@ class DashboardDispatcher extends KTStandardDispatcher { | @@ -65,11 +65,27 @@ class DashboardDispatcher extends KTStandardDispatcher { | ||
| 65 | $this->oPage->setBreadcrumbDetails(_("Home")); | 65 | $this->oPage->setBreadcrumbDetails(_("Home")); |
| 66 | $this->oPage->title = _("Dashboard"); | 66 | $this->oPage->title = _("Dashboard"); |
| 67 | 67 | ||
| 68 | + // simplistic improvement over the standard rendering: float half left | ||
| 69 | + // and half right. +Involves no JS -can leave lots of white-space at the bottom. | ||
| 70 | + | ||
| 71 | + $aDashletsLeft = array(); | ||
| 72 | + $aDashletsRight = array(); | ||
| 73 | + | ||
| 74 | + $i = 0; | ||
| 75 | + foreach ($aDashlets as $oDashlet) { | ||
| 76 | + if ($i == 0) { $aDashletsLeft[] = $oDashlet; } | ||
| 77 | + else {$aDashletsRight[] = $oDashlet; } | ||
| 78 | + $i += 1; | ||
| 79 | + $i %= 2; | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + | ||
| 68 | $oTemplating =& KTTemplating::getSingleton(); | 83 | $oTemplating =& KTTemplating::getSingleton(); |
| 69 | $oTemplate = $oTemplating->loadTemplate("kt3/dashboard"); | 84 | $oTemplate = $oTemplating->loadTemplate("kt3/dashboard"); |
| 70 | $aTemplateData = array( | 85 | $aTemplateData = array( |
| 71 | "context" => $this, | 86 | "context" => $this, |
| 72 | - "dashlets" => $aDashlets, | 87 | + "dashlets_left" => $aDashletsLeft, |
| 88 | + "dashlets_right" => $aDashletsRight, | ||
| 73 | ); | 89 | ); |
| 74 | return $oTemplate->render($aTemplateData); | 90 | return $oTemplate->render($aTemplateData); |
| 75 | } | 91 | } |
resources/css/kt-framing.css
| @@ -784,11 +784,26 @@ The text will be hidden for screen view. The generic fahrner-ish approach comes | @@ -784,11 +784,26 @@ The text will be hidden for screen view. The generic fahrner-ish approach comes | ||
| 784 | 784 | ||
| 785 | 785 | ||
| 786 | /* dashboard blocks. */ | 786 | /* dashboard blocks. */ |
| 787 | + | ||
| 788 | +#dashboard-container-left { | ||
| 789 | + width: 45%; | ||
| 790 | + padding-right: 2em; | ||
| 791 | + float: left; | ||
| 792 | + padding-bottom: 2em; | ||
| 793 | +} | ||
| 794 | + | ||
| 795 | +#dashboard-container-right { | ||
| 796 | + width: 45%; | ||
| 797 | + padding-right: 2em; | ||
| 798 | + float: left; | ||
| 799 | + padding-bottom: 2em; | ||
| 800 | +} | ||
| 801 | + | ||
| 787 | .dashboard_block { | 802 | .dashboard_block { |
| 788 | float: left; | 803 | float: left; |
| 789 | position: relative; | 804 | position: relative; |
| 790 | - width: 48%; | ||
| 791 | - padding-right: 1em; | 805 | + width: 100%; |
| 806 | + padding-top: 2em; | ||
| 792 | } | 807 | } |
| 793 | 808 | ||
| 794 | 809 |
templates/kt3/dashboard.smarty
| 1 | -{foreach item=oDashlet from=$dashlets} | 1 | +<div id="dashboard-container-left"> |
| 2 | +{foreach item=oDashlet from=$dashlets_left} | ||
| 2 | <div class="dashboard_block"> | 3 | <div class="dashboard_block"> |
| 3 | {$oDashlet->render()} | 4 | {$oDashlet->render()} |
| 4 | </div> | 5 | </div> |
| 5 | {/foreach} | 6 | {/foreach} |
| 7 | +</div> | ||
| 6 | 8 | ||
| 9 | +<div id="dashboard-container-right"> | ||
| 10 | +{foreach item=oDashlet from=$dashlets_right} | ||
| 11 | +<div class="dashboard_block"> | ||
| 12 | +{$oDashlet->render()} | ||
| 13 | +</div> | ||
| 14 | +{/foreach} | ||
| 15 | +</div> | ||
| 7 | 16 | ||
| 8 | 17 | ||
| 9 | 18 |