← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15851: tracker capture - expand/collapse option for tei dashboard widgets

 

------------------------------------------------------------
revno: 15851
committer: Abyot Asalefew Gizaw abyota@xxxxxxxxx
branch nick: dhis2
timestamp: Wed 2014-06-25 16:08:18 +0200
message:
  tracker capture - expand/collapse option for tei dashboard widgets
modified:
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json
  dhis-2/dhis-web/dhis-web-tracker-capture/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-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js	2014-06-20 14:23:28 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js	2014-06-25 14:08:18 +0000
@@ -16,12 +16,12 @@
     
     //dashboard items   
     $rootScope.dashboardWidgets = {bigger: [], smaller: []};       
-    $rootScope.enrollmentWidget = {title: 'enrollment', view: "components/enrollment/enrollment.html", show: true};
-    $rootScope.dataentryWidget = {title: 'dataentry', view: "components/dataentry/dataentry.html", show: true};
-    $rootScope.selectedWidget = {title: 'current_selections', view: "components/selected/selected.html", show: false};
-    $rootScope.profileWidget = {title: 'profile', view: "components/profile/profile.html", show: true};
-    $rootScope.relationshipWidget = {title: 'relationship', view: "components/relationship/relationship.html", show: true};
-    $rootScope.notesWidget = {title: 'notes', view: "components/notes/notes.html", show: true};    
+    $rootScope.enrollmentWidget = {title: 'enrollment', view: "components/enrollment/enrollment.html", show: true, expand: true, expand: true};
+    $rootScope.dataentryWidget = {title: 'dataentry', view: "components/dataentry/dataentry.html", show: true, expand: true};
+    $rootScope.selectedWidget = {title: 'current_selections', view: "components/selected/selected.html", show: false, expand: true};
+    $rootScope.profileWidget = {title: 'profile', view: "components/profile/profile.html", show: true, expand: true};
+    $rootScope.relationshipWidget = {title: 'relationship', view: "components/relationship/relationship.html", show: true, expand: true};
+    $rootScope.notesWidget = {title: 'notes', view: "components/notes/notes.html", show: true, expand: true};    
    
     $rootScope.dashboardWidgets.bigger.push($rootScope.enrollmentWidget);
     $rootScope.dashboardWidgets.bigger.push($rootScope.dataentryWidget);
@@ -87,6 +87,10 @@
         widget.show = false;
     };
     
+    $scope.expandCollapse = function(widget){
+        widget.expand = !widget.expand;
+    };
+    
     $scope.showHideWidgets = function(){
         var modalInstance = $modal.open({
             templateUrl: "views/widgets.html",

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2014-06-25 12:08:50 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2014-06-25 14:08:18 +0000
@@ -5,11 +5,15 @@
             | <span><a href ng-click="createNewEvent()" title="{{'create_new_event_repeatable'| translate}}">{{'create_new_event'| translate}}</a></span>            
         </span>
         <span class="pull-right">
-            <a href ng-click="removeWidget(dataentryWidget)" title="{{'remove'| translate}}"><span class='black'><i class="fa fa-times-circle"></i></span></a>            
+            <a class="small-horizonal-spacing" href ng-click="expandCollapse(dataentryWidget)">
+                <span ng-show="dataentryWidget.expand" class='black'><i class="fa fa-chevron-down" title="{{'collapse'| translate}}"></i></span>
+                <span ng-show="!dataentryWidget.expand" class='black'><i class="fa fa-chevron-right" title="{{'expand'| translate}}"></i></span>
+            </a>
+            <a class="small-horizonal-spacing" href ng-click="removeWidget(dataentryWidget)" title="{{'remove'| translate}}"><span class='black'><i class="fa fa-times-circle"></i></span></a>            
         </span>        
     </div>
 
-    <div class="panel-body dashboard-widget-container">
+    <div ng-show="dataentryWidget.expand" class="panel-body dashboard-widget-container">
         <div ng-show="dhis2Events">            
             <table class="table-borderless">
                 <tbody>

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html	2014-06-20 14:23:28 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html	2014-06-25 14:08:18 +0000
@@ -2,10 +2,14 @@
     <div class="panel-heading">
         {{enrollmentWidget.title| translate}}
         <span class="pull-right">
-            <a href ng-click="removeWidget(enrollmentWidget)" title="{{'remove'| translate}}"><span class='black'><i class="fa fa-times-circle"></i></span></a>            
+            <a class="small-horizonal-spacing" href ng-click="expandCollapse(enrollmentWidget)">
+                <span ng-show="enrollmentWidget.expand" class='black'><i class="fa fa-chevron-down" title="{{'collapse'| translate}}"></i></span>
+                <span ng-show="!enrollmentWidget.expand" class='black'><i class="fa fa-chevron-right" title="{{'expand'| translate}}"></i></span>
+            </a>
+            <a class="small-horizonal-spacing" href ng-click="removeWidget(enrollmentWidget)" title="{{'remove'| translate}}"><span class='black'><i class="fa fa-times-circle"></i></span></a>            
         </span>
     </div>
-    <div class="panel-body dashboard-widget-container">
+    <div ng-show="enrollmentWidget.expand" class="panel-body dashboard-widget-container">
         <div ng-if="selectedEnrollment">
             <table class="table-borderless">
                 <tr class="col-md-12">
@@ -16,7 +20,6 @@
                         <input type="text" class="form-control" ng-date ng-model="selectedEnrollment.dateOfIncident" ng-disabled="true"/>
                     </td>
                 </tr>
-
             </table>
             <hr>
             <table class="table-borderless table-striped">

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html	2014-06-19 15:27:17 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html	2014-06-25 14:08:18 +0000
@@ -2,10 +2,14 @@
     <div class="panel-heading">
         {{notesWidget.title| translate}}
         <span class="pull-right">
-            <a href ng-click="removeWidget(notesWidget)" title="{{'remove'| translate}}"><span class='black'><i class="fa fa-times-circle"></i></span></a>            
+            <a class="small-horizonal-spacing" href ng-click="expandCollapse(notesWidget)">
+                <span ng-show="notesWidget.expand" class='black'><i class="fa fa-chevron-down" title="{{'collapse'| translate}}"></i></span>
+                <span ng-show="!notesWidget.expand" class='black'><i class="fa fa-chevron-right" title="{{'expand'| translate}}"></i></span>
+            </a>
+            <a class="small-horizonal-spacing" href ng-click="removeWidget(notesWidget)" title="{{'remove'| translate}}"><span class='black'><i class="fa fa-times-circle"></i></span></a>            
         </span>        
     </div>
-    <div class="panel-body dashboard-widget-container">
+    <div ng-show="notesWidget.expand" class="panel-body dashboard-widget-container">
         This is notes.
     </div>
 </div>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js	2014-06-25 12:08:50 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js	2014-06-25 14:08:18 +0000
@@ -1,9 +1,9 @@
 trackerCapture.controller('ProfileController',
-        function($scope,                
+        function($rootScope,
+                $scope,                
                 CurrentSelection,
                 TEService,
                 TEIService,
-                DateUtils,
                 AttributesFactory,
                 TranslationService) {
 
@@ -86,6 +86,7 @@
     $scope.enableEdit = function(){
         $scope.entityAttributes = angular.copy($scope.selectedEntity.attributes);
         $scope.editProfile = !$scope.editProfile; 
+        $rootScope.profileWidget.expand = true;
     };
     
     $scope.save = function(){

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html	2014-06-19 15:27:17 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html	2014-06-25 14:08:18 +0000
@@ -1,4 +1,3 @@
-
 <div class="panel panel-default" ng-controller="ProfileController">
     <div class="panel-heading">
         {{trackedEntity.name|| 'entity' | translate}} {{profileWidget.title| translate}}
@@ -6,10 +5,14 @@
             | <span><a href ng-click="enableEdit()" title="{{'edit_profile'| translate}}">{{'edit'| translate}}</a></span>            
         </span>
         <span class="pull-right">
-            <a href ng-click="removeWidget(profileWidget)" title="{{'remove'| translate}}"><span class='black'><i class="fa fa-times-circle"></i></span></a>            
+            <a class="small-horizonal-spacing" href ng-click="expandCollapse(profileWidget)">
+                <span ng-show="profileWidget.expand" class='black'><i class="fa fa-chevron-down" title="{{'collapse'| translate}}"></i></span>
+                <span ng-show="!profileWidget.expand" class='black'><i class="fa fa-chevron-right" title="{{'expand'| translate}}"></i></span>
+            </a>
+            <a class="small-horizonal-spacing" href ng-click="removeWidget(profileWidget)" title="{{'remove'| translate}}"><span class='black'><i class="fa fa-times-circle"></i></span></a>            
         </span>        
     </div>
-    <div class="widget-content-container">
+    <div ng-show="profileWidget.expand" class="widget-content-container">
         <table class="table-borderless table-striped">
             <tr ng-repeat="attribute in selectedEntity.attributes" ng-show="attribute.show">
                 <td>

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html	2014-05-27 12:38:36 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html	2014-06-25 14:08:18 +0000
@@ -2,10 +2,14 @@
     <div class="panel-heading">
         {{relationshipWidget.title| translate}}
         <span class="pull-right">
-            <a href ng-click="removeWidget(relationshipWidget)" title="{{'remove'| translate}}"><span class='black'><i class="fa fa-times-circle"></i></span></a>            
+            <a class="small-horizonal-spacing" href ng-click="expandCollapse(relationshipWidget)">
+                <span ng-show="relationshipWidget.expand" class='black'><i class="fa fa-chevron-down" title="{{'collapse'| translate}}"></i></span>
+                <span ng-show="!relationshipWidget.expand" class='black'><i class="fa fa-chevron-right" title="{{'expand'| translate}}"></i></span>
+            </a>
+            <a class="small-horizonal-spacing" href ng-click="removeWidget(relationshipWidget)" title="{{'remove'| translate}}"><span class='black'><i class="fa fa-times-circle"></i></span></a>            
         </span>        
     </div>
-    <div class="panel-body dashboard-element-container">
+    <div ng-show="relationshipWidget.expand" class="panel-body dashboard-element-container">
         This is relationships.
     </div>
 </div>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html	2014-05-27 12:38:36 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html	2014-06-25 14:08:18 +0000
@@ -2,10 +2,14 @@
     <div class="panel-heading">
         {{selectedWidget.title| translate}}
         <span class="pull-right">
-            <a href ng-click="removeWidget(selectedWidget)" title="{{'remove'| translate}}"><span class='black'><i class="fa fa-times-circle"></i></span></a>            
+            <a class="small-horizonal-spacing" href ng-click="expandCollapse(selectedWidget)">
+                <span ng-show="selectedWidget.expand" class='black'><i class="fa fa-chevron-down" title="{{'collapse'| translate}}"></i></span>
+                <span ng-show="!selectedWidget.expand" class='black'><i class="fa fa-chevron-right" title="{{'expand'| translate}}"></i></span>
+            </a>
+            <a class="small-horizonal-spacing" href ng-click="removeWidget(selectedWidget)" title="{{'remove'| translate}}"><span class='black'><i class="fa fa-times-circle"></i></span></a>            
         </span>        
     </div>    
-    <div class="panel-body dashboard-element-container">
+    <div ng-show="selectedWidget.expand" class="panel-body dashboard-element-container">
         <div class="row" ng-repeat="selection in selections">
             <div class="col-sm-6">
                 {{selection.title| translate}}

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json	2014-06-20 14:23:28 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json	2014-06-25 14:08:18 +0000
@@ -63,6 +63,8 @@
     "data_element": "Data element",
     "value": "Value",
     "provided_elsewhere": "Provided elsewhere",
+    "expand": "Expand",
+    "collapse": "Collapse",
     "show_hide_columns": "Show/hide columns",
     "select_columns_to_show": "Select columns to show",
     "show_hide_widgets": "Show/hide widgets",

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2014-06-20 14:23:28 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2014-06-25 14:08:18 +0000
@@ -544,7 +544,7 @@
 }
 
 .dashboard-widget-container {
-    max-height: 400px !important;
+    //max-height: 400px !important;
     height: auto;
     overflow-x:auto;
     overflow-y:auto;
@@ -569,11 +569,11 @@
 }
 
 .small-horizonal-spacing{
-    margin-left: 2px;    
+    margin-left: 5px;    
 }
 
 .small-vertical-spacing{
-    margin-top: 2px;    
+    margin-top: 5px;    
 }
 
 .search-container{