← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21457: tracker-capture: better handling of right/columns (un)sticky

 

------------------------------------------------------------
revno: 21457
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-12-15 11:54:23 +0100
message:
  tracker-capture: better handling of right/columns (un)sticky
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js	2015-12-11 15:18:54 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js	2015-12-15 10:54:23 +0000
@@ -413,11 +413,7 @@
             return;
         });
     };
-    
-    $scope.stickUnstick = function(){        
-        $scope.stickyDisabled = !$scope.stickyDisabled;
-    };
-    
+        
     $scope.showHideWidgets = function(){
         var modalInstance = $modal.open({
             templateUrl: "components/dashboard/dashboard-widgets.html",

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html	2015-12-11 08:53:57 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html	2015-12-15 10:54:23 +0000
@@ -1,58 +1,28 @@
 <div class="container-1-1">
-    <!-- dashboard top menu begins-->
-    <div class="col-sm-12 small-vertical-spacing  hideInPrint">
-        
-        <!-- dashboard buttons begin -->
-        <button type="button" class="btn btn-default" ng-click="back()">{{'back'| translate}}</button>
-        
-        <button ng-disabled="!previousTeiExists" type="button" class="btn btn-default small-horizonal-spacing" ng-click="fetchTei('PREV')" title="{{'previous'| translate}}"><i class="fa fa-caret-left"></i></button>
-        
-        <button ng-disabled="!nextTeiExists" type="button" class="btn btn-default small-horizonal-spacing" ng-click="fetchTei('NEXT')" title="{{'next'| translate}}"><i class="fa fa-caret-right"></i></button>
-        
-        <select ng-model="selectedProgram"
-                class="form-control-program"
-                ng-options="program as program.name for program in programs | orderBy: 'name'" 
-                ng-disabled="programs.length < 1"
-                ng-change="applySelectedProgram()">
-            <option value="">{{programs.length > 0 ? 'please_select_a_program' : 'no_program_exists' | translate}}</option>
-        </select>
-        <!-- dashboard buttons end -->
-        
-        <!-- dashboard setting begins -->
-        <div class="pull-right">
-            <button type="button" 
-                    title="{{stickyDisabled ? stickLabel : unstickLabel}}" 
-                    class="btn btn-default" 
-                    ng-class="{true: 'stick', false: 'unstick'} [!stickyDisabled]" 
-                    ng-click="stickUnstick()">                    
-                <i class="fa fa-thumb-tack"></i>
-            </button>
-            <div class="btn-group trim" dropdown is-open="status.isopen">
-                <button type="button" title="{{settingsLabel}}" class="btn btn-default dropdown-toggle" dropdown-toggle>                    
-                    <i class="fa fa-cog"></i>
-                </button>
-                <ul class="dropdown-menu pull-right" role="menu">
-                    <li><a href ng-click="showHideWidgets()">{{showHideWidgetsLabel}}</a></li>
-                    <li ng-if="userAuthority.canAdministerDashboard"><a href ng-click="saveDashboarLayoutAsDefault()">{{'save_layout_as_default'| translate}}</a></li>
-                    <li><a href ng-click="activiateTEI()">{{selectedTei.inactive ? 'activate_tei' : 'deactivate_tei' | translate}} {{trackedEntity.name}}</a></li>
-                </ul>
-            </div>
-        </div>
-        <!-- dashboard setting ends -->
-        
-    </div>
-    <!-- dashboard top menu ends-->
     
     <!-- dashboard widgets begin -->
     <div class="col-sm-12">
-        <div class="row">
+        <div class="row">            
             <!-- dashboard bigger widgets begin -->
             <div ng-class="widgetSize.bigger">
-                <div id="biggerWidget"
-                    d2-sortable  
-                    bigger-widgets={{ dashboardWidgets  | filter: {parent: 'biggerWidget'} }} 
-                    smaller-widgets={{ dashboardWidgets  | filter: {parent: 'smallerWidget'} }} 
-                    class="row connectedSortable empty-dashboard-container">
+                
+                <!-- dashboard buttons begin -->
+                <button type="button" class="btn btn-default" ng-click="back()">{{'back'| translate}}</button>
+
+                <button ng-disabled="!previousTeiExists" type="button" class="btn btn-default small-horizonal-spacing" ng-click="fetchTei('PREV')" title="{{'previous'| translate}}"><i class="fa fa-caret-left"></i></button>
+
+                <button ng-disabled="!nextTeiExists" type="button" class="btn btn-default small-horizonal-spacing" ng-click="fetchTei('NEXT')" title="{{'next'| translate}}"><i class="fa fa-caret-right"></i></button>
+
+                <select ng-model="selectedProgram"
+                        class="form-control-program"
+                        ng-options="program as program.name for program in programs | orderBy: 'name'" 
+                        ng-disabled="programs.length < 1"
+                        ng-change="applySelectedProgram()">
+                    <option value="">{{programs.length > 0 ? 'please_select_a_program' : 'no_program_exists' | translate}}</option>
+                </select>
+                <!-- dashboard buttons end -->
+        
+                <div id="biggerWidget" class="row connectedSortable empty-dashboard-container" d2-sortable bigger-widgets={{dashboardWidgets | filter: {parent: 'biggerWidget'}}} smaller-widgets={{ dashboardWidgets | filter: {parent: 'smallerWidget'}}}>
                     <div class="col-sm-12" id={{biggerWidget.title}} ng-repeat="biggerWidget in dashboardWidgets | orderBy:'order' | filter: {parent: 'biggerWidget'}"">
                         <div ng-show="biggerWidget.show" ng-include="biggerWidget.view" ng-class="{true: 'hideInPrint'} [biggerWidget.title != 'report']"></div>
                     </div>                                       
@@ -61,18 +31,42 @@
             <!-- dashboard bigger widgets end -->
 
             <!-- dashboard smaller widgets begin -->
-            <div ng-class="widgetSize.smaller" sticky offset="100" disabled-sticky="stickyDisabled">
-                <div id="smallerWidget" 
-                    d2-sortable 
-                    bigger-widgets={{ dashboardWidgets  | filter: {parent: 'biggerWidget'} }} 
-                    smaller-widgets={{ dashboardWidgets  | filter: {parent: 'smallerWidget'} }} 
-                    class="row connectedSortable empty-dashboard-container">                   
+            <div ng-class="widgetSize.smaller" sticky offset="50" disabled-sticky="stickyDisabled">
+                
+                <!-- dashboard setting begins -->
+                <div class="row add-default-right-padding">
+                    <div class="pull-right">
+                        <button type="button" 
+                                title="{{stickyDisabled ? stickLabel : unstickLabel}}" 
+                                ng-show="(dashboardWidgets | filter: {parent: 'smallerWidget', show: true}).length > 0"
+                                class="btn btn-default" 
+                                ng-class="{true: 'stick', false: 'unstick'} [!stickyDisabled]" 
+                                ng-click="stickyDisabled = !stickyDisabled">                    
+                            <i class="fa fa-thumb-tack"></i>
+                        </button>
+                        <div class="btn-group trim" dropdown is-open="status.isopen">
+                            <button type="button" title="{{settingsLabel}}" class="btn btn-default dropdown-toggle" dropdown-toggle>                    
+                                <i class="fa fa-cog"></i>
+                            </button>
+                            <ul class="dropdown-menu pull-right" role="menu">
+                                <li><a href ng-click="showHideWidgets()">{{showHideWidgetsLabel}}</a></li>
+                                <li ng-if="userAuthority.canAdministerDashboard"><a href ng-click="saveDashboarLayoutAsDefault()">{{'save_layout_as_default'| translate}}</a></li>
+                                <li><a href ng-click="activiateTEI()">{{selectedTei.inactive ? 'activate_tei' : 'deactivate_tei' | translate}} {{trackedEntity.name}}</a></li>
+                            </ul>
+                        </div>
+                    </div>    
+                </div>                
+                <!-- dashboard setting ends -->
+                
+                <div id="smallerWidget" class="row connectedSortable empty-dashboard-container" d2-sortable bigger-widgets={{dashboardWidgets | filter: {parent: 'biggerWidget'}}} smaller-widgets={{dashboardWidgets | filter: {parent: 'smallerWidget'}}}>
                     <div class="col-sm-12" id={{smallerWidget.title}} ng-repeat="smallerWidget in dashboardWidgets  | orderBy:'order' | filter: {parent: 'smallerWidget'}">                        
                         <div ng-show="smallerWidget.show" ng-include="smallerWidget.view" ng-class="{true: 'hideInPrint'} [smallerWidget.title != 'report']"></div>
                     </div>                   
                 </div>
+                
             </div>
-            <!-- dashboard smaller widgets end -->   
+            <!-- dashboard smaller widgets end -->
+            
         </div>        
     </div>
     <!-- dashboard widgets end -->

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2015-12-14 15:08:54 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2015-12-15 10:54:23 +0000
@@ -581,7 +581,11 @@
 }
 
 .add-default-left-padding {
-	padding-left: 15px !important;
+    padding-left: 15px !important;
+}
+
+.add-default-right-padding {
+    padding-right: 15px !important;
 }
 
 .visit-details {