← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 22078: tracker-capture: event boxed in data entry widget now use popover to display event details

 

------------------------------------------------------------
revno: 22078
committer: Abyot Asalefew Gizaw <abyot@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2016-02-29 15:26:12 +0100
message:
  tracker-capture: event boxed in data entry widget now use popover to display event details
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/event-layout.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes-controller.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.directives.js


--
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/dataentry/event-layout.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/event-layout.html	2016-02-17 13:08:44 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/event-layout.html	2016-02-29 14:26:12 +0000
@@ -4,8 +4,31 @@
             <div class="event-container" ng-click="getEventPage('BACKWARD')" ng-if="$index === 0 && eventPagingStart > 0">
                 {{'previous'| translate}}
             </div>
-
-            <div class="event-container" title="[{{'org_unit' | translate}}: {{dhis2Event.orgUnitName}}, {{'program_stage' | translate}}: {{dhis2Event.name}}]" ng-class="getEventStyle(dhis2Event)" ng-click="showDataEntry(dhis2Event, false)">                
+            
+            <script type="text/ng-template" id="event-details.html">                
+                <table class="table table-striped table-bordered">
+                    <tr>
+                        <td>{{'org_unit' | translate}}</td>
+                        <td>{{content.orgUnitName}}</td>
+                    </tr>
+                    <tr>
+                        <td>{{'program_stage' | translate}}</td>
+                        <td>{{content.name}}</td>
+                    </tr>
+                    <tr>
+                        <td>{{'date' | translate}}</td>
+                        <td>{{content.eventDate ? content.eventDate : content.dueDate}}</td>
+                    </tr>
+                </table>
+            </script>
+            <div class="event-container" 
+                 d2-pop-over 
+                 details="{{'details'| translate}}"
+                 content="dhis2Event"
+                 template="event-details.html"  
+                 placement="right" 
+                 ng-class="getEventStyle(dhis2Event)" 
+                 ng-click="showDataEntry(dhis2Event, false)">                
                 <div class="event-container-item">
                     {{dhis2Event.sortingDate}}
                 </div>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes-controller.js	2016-02-04 10:43:43 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes-controller.js	2016-02-29 14:26:12 +0000
@@ -61,7 +61,6 @@
             DialogService.showDialog({}, dialogOptions);
             return;
         }
-        
 
         var newNote = {value: $scope.note.value};
 
@@ -74,7 +73,10 @@
         }
 
         var e = angular.copy($scope.selectedEnrollment);
-
+        e.enrollmentDate = DateUtils.formatFromUserToApi(e.enrollmentDate);
+        if(e.incidentDate){
+            e.incidentDate = DateUtils.formatFromUserToApi(e.incidentDate);
+        }
         e.notes = [newNote];
         EnrollmentService.updateForNote(e).then(function(){
             $scope.note = {};

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.directives.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.directives.js	2016-02-24 13:51:13 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.directives.js	2016-02-29 14:26:12 +0000
@@ -117,15 +117,17 @@
         scope: {
             content: '=',
             title: '@details',
-            template: "@template"
+            template: "@template",
+            placement: "@placement"
         },
         link: function (scope, element, attrs) {
-            var content = $templateCache.get("popover.html");
+            console.log('the template:  ', scope.template);
+            var content = $templateCache.get(scope.template);
             content = $compile(content)(scope);
             scope.content.heading = scope.content.value && scope.content.value.length > 20 ? scope.content.value.substring(0,20).concat('...') : scope.content.value;
             var options = {
                 content: content,
-                placement: 'auto',
+                placement: scope.placement ? scope.placement : 'auto',
                 trigger: 'hover',
                 html: true,
                 title: scope.title