← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21465: tracker-capture: dashboard widgets now show progress indicator till data is ready

 

------------------------------------------------------------
revno: 21465
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-12-16 10:43:38 +0100
message:
  tracker-capture: dashboard widgets now show progress indicator till data is ready
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/dataentry/dataentry-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.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-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/rulebound/rulebound-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/rulebound/rulebound.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/selected/selected-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html


--
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-15 10:54:23 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js	2015-12-16 09:43:38 +0000
@@ -347,7 +347,7 @@
         CurrentSelection.set({tei: $scope.selectedTei, te: $scope.trackedEntity, prs: $scope.programs, pr: $scope.selectedProgram, prNames: $scope.programNames, prStNames: $scope.programStageNames, enrollments: selections.enrollments, selectedEnrollment: null, optionSets: $scope.optionSets});        
         $timeout(function() { 
             $rootScope.$broadcast('selectedItems', {programExists: $scope.programs.length > 0});            
-        }, 200);
+        }, 500);
     };     
     
     $scope.activiateTEI = function(){

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2015-12-14 15:33:15 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2015-12-16 09:43:38 +0000
@@ -26,6 +26,7 @@
                 TrackerRulesFactory) {
 
     $scope.maxOptionSize = 30;
+    $scope.dashboardReady = false;
     
     //Data entry form
     $scope.outerForm = {};
@@ -247,6 +248,7 @@
 
     //listen for the selected items
     $scope.$on('dashboardWidgets', function () {
+        $scope.dashboardReady = true;
         $scope.showDataEntryDiv = false;
         $scope.showEventCreationDiv = false;
         $scope.currentEvent = null;
@@ -302,7 +304,7 @@
                 }
                 
                 TrackerRulesFactory.getRules($scope.selectedProgram.id).then(function(rules){                    
-                    $scope.allProgramRules = rules;
+                    $scope.allProgramRules = rules;                    
                     $scope.getEvents();
                 });           
             });

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2015-12-14 15:33:15 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2015-12-16 09:43:38 +0000
@@ -16,213 +16,223 @@
     </div>
 
     <div ng-show="dataentryWidget.expand" class="panel-body dashboard-widget-container">
-        <div ng-if="showEventColors">
-            <span class='bold'>{{'legend'| translate}}</span>
-            <table class="table table-bordered" style="width: 100%;">               
-                <tr>
-                    <td ng-class="eventColor.color" ng-repeat="eventColor in eventColors">
-                        <span class="bold">{{eventColor.description| translate}}</span>
-                    </td>
-                </tr>
-            </table>
+        
+        <div ng-if="!dashboardReady">
+            <img id="ouwt_loader" src="../images/ajax-loader-bar.gif" alt="{{'loading'| translate}}"/>
         </div>
-
-        <div class="table-responsive hideInPrint" ng-if="selectedEnrollment && selectedEnrollment.enrollment">
-            <table class="table table-bordered">
-                <thead>
-                    <tr>
-                        <th class="active" style="vertical-align:middle" ng-repeat="stage in programStages">                            
-                            {{stage.name}}
-
-                            <!-- event add/filter icon begins -->
-                            <span class='pull-right'>
-                                
-                                <span ng-if="stageNeedsEvent(stage) && selectedEnrollment.status === 'ACTIVE'">
-                                    <a href title="{{'create_new_event'| translate}}" ng-click="showCreateEvent(stage)" style="vertical-align:middle"><i class="fa fa-plus"></i></a>
-                                </span>
-                            </span>
-                            <!-- event add/filter icon ends -->
-
-                        </th>
-                    </tr>
-                </thead>
-                <tbody>
-                    <tr>
-                        <td ng-repeat="stage in programStages">
-                            <div class="inline-block" ng-repeat="dhis2Event in eventsByStage[stage.id]">
-                                <div class="event-container" 
-                                     ng-class="getEventStyle(dhis2Event)" 
-                                     ng-show="!currentPeriod[stage.id] || !filterEvents || currentPeriod[stage.id] && currentPeriod[stage.id].event === dhis2Event.event"
-                                     ng-click="showDataEntry(dhis2Event, false)">
-                                    {{dhis2Event.orgUnitName}}<br/>
-                                    {{dhis2Event.sortingDate}}<br>
-                                    <span ng-if="eventsByStage[stage.id].length > 1 && !filterEvents">[{{eventsByStage[stage.id].length - $index}}]</span>
-                                </div>
-                            </div>
-                            <span ng-if="eventsByStage[stage.id].length > 1 && filterEvents">
-                                <span ng-if="currentEvent.programStage !== stage.id">
-                                    <div class="event-paging">
-                                        <a href class="event-paging" ng-click="showDataEntryForEvent(eventsByStage[stage.id][0])">{{'show_more'| translate}}</a>
-                                    </div>                                    
-                                </span>
-                                <event-paginator ng-if="stage.id === currentEvent.programStage"></event-paginator>                             
-                            </span>
-                            <div ng-if="!eventsByStage[stage.id] || eventsByStage[stage.id].length < 1">
-                                <div class="alert alert-warning">{{'no_events_exist'| translate}}</div> 
-                            </div>
+        <div ng-if="dashboardReady">            
+        
+            <div ng-if="showEventColors">
+                <span class='bold'>{{'legend'| translate}}</span>
+                <table class="table table-bordered" style="width: 100%;">               
+                    <tr>
+                        <td ng-class="eventColor.color" ng-repeat="eventColor in eventColors">
+                            <span class="bold">{{eventColor.description| translate}}</span>
                         </td>
                     </tr>
-                </tbody>
-            </table>
-        </div>
-
-        <div ng-if="!selectedEnrollment || !selectedEnrollment.enrollment" class="alert alert-danger">{{notEnrolledLabel}}</div>
-
-        <form name="outerForm" novalidate>
-            <div ng-if="currentEvent">
-
-                <!-- event dates/scheduling begin -->
-                <div class="row" ng-if="(displayCustomForm !== 'TABLE') && !currentStage.periodType">
-
-                    <div ng-class="{true: 'col-md-12', false: 'col-md-6'} [currentStage.hideDueDate]">
-                        {{currentEvent.excecutionDateLabel}}
-                        <input type="text"
-                               placeholder="{{dhis2CalendarFormat.keyDateFormat}}"
-                               class="form-control" 
-                               ng-class="{'input-success': eventDateSaved}"
-                               d2-date 
-                               max-date="0"
-                               min-date=""
-                               ng-model="currentEvent.eventDate"
-                               ng-disabled="currentEvent.status === 'SKIPPED' || selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed"    
-                               ng-required="true"
-                               blur-or-change="saveEventDate()"/>
-                        <span ng-if="invalidDate" class="error">{{'date_required'| translate}}</span>
-                    </div>
-                    <div class="col-md-6" ng-if="!currentStage.hideDueDate">
-                        <span ng-if="currentEvent.eventDate || currentEvent.status === 'SKIPPED' || currentEvent.dueDate">
-                            {{'due_date'| translate}}
-                        </span>
-                        <span ng-if="!currentEvent.eventDate && currentEvent.status !== 'SKIPPED' && !selectedEntity.inactive">
-                            <a href ng-click="enableRescheduling()" title="{{ schedulingEnabled ? 'disable_rescheduling' : 'enable_rescheduling' | translate}}"><span class="text-primary bold">{{'reschedule_duedate'| translate}}</span></a>                        
-                        </span>                    
-                        <input type="text" 
-                               placeholder="{{dhis2CalendarFormat.keyDateFormat}}"
-                               class="form-control"
-                               ng-class="{'input-success': dueDateSaved}"
-                               d2-date                                
-                               ng-model="currentEvent.dueDate"
-                               blur-or-change="saveDueDate()" 
-                               ng-disabled="currentEvent.eventDate || !schedulingEnabled || selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed"/>
-                        <span ng-if="invalidDate" class="error">{{'date_required'| translate}}</span>
-                    </div>                        
-                </div>
-                <!-- event dates/scheduling end -->
-
-                <!-- coordinates begin -->
-                <div class="row" ng-if="currentStage.captureCoordinates && currentEvent.eventDate">
-                    <div class="col-md-6">
-                        {{'latitude'| translate}}<span><a href ng-click="showMap(currentEvent)" title="{{'get_from_map'| translate}}"><i class="fa fa-map-marker fa-2x"></i></a></span>
-                        <input type="number"
-                               ng-model="currentEvent.coordinate.latitude"     
-                               class="form-control" 
-                               ng-class="{'input-success': latitudeSaved}" 
-                               name="latitude"
-                               d2-coordinate-validator
-                               ng-blur="saveCoordinate('LAT')"
-                               ng-disabled="currentEvent.enrollmentStatus !== 'ACTIVE' || currentEvent.editingNotAllowed"    
-                               ng-required="false"/>
-                        <div ng-messages="outerForm.latitude.$error" ng-if="interacted(outerForm.latitude)" class="required" ng-messages-include="../dhis-web-commons/angular-forms/error-messages.html">                        
-                        </div>
-                    </div>
-                    <div class="col-md-6">
-                        {{'longitude'| translate}}<span><a href ng-click="showMap(currentEvent)" title="{{'get_from_map'| translate}}"><i class="fa fa-map-marker fa-2x"></i></a></span>                    
-                        <input type="number"  
-                               ng-model="currentEvent.coordinate.longitude"     
-                               class="form-control" 
-                               ng-class="{'input-success': longitudeSaved}"
-                               name="longitude" 
-                               d2-coordinate-validator
-                               ng-blur="saveCoordinate('LNG')"
-                               ng-disabled="currentEvent.enrollmentStatus !== 'ACTIVE' || currentEvent.editingNotAllowed" 
-                               ng-required="false"/>
-                        <div ng-messages="outerForm.longitude.$error" ng-if="interacted(outerForm.longitude)" class="required" ng-messages-include="../dhis-web-commons/angular-forms/error-messages.html">
-                        </div>
-                    </div>
-                </div>
-                <!-- coordinates begin -->
-
-                <!-- data entry form begins -->
-                <div ng-if="currentEvent.eventDate">                            
-                    <div class="clear vertical-spacing" ng-if="displayCustomForm === 'CUSTOM'" ng-include="'../dhis-web-commons/angular-forms/custom-form.html'"></div>
-                    <div class="clear vertical-spacing" ng-if="displayCustomForm === 'DEFAULT'" ng-include="'components/dataentry/default-form.html'"></div>
-                </div>    
-                <!-- the table form is insensitive to the event date being present. In this situation the eventdate is set inside the table form -->
-                <div class="clear vertical-spacing" ng-if="displayCustomForm === 'TABLE'" ng-include="'components/dataentry/table-entry-form.html'"></div>
-
-                <!-- data entry form ends -->
-
-                <!-- data entry/event buttons begins -->                
-                
-                <div class="form-group hideInPrint" ng-if="displayCustomForm !== 'TABLE'">
+                </table>
+            </div>
+
+            <div class="table-responsive hideInPrint" ng-if="selectedEnrollment && selectedEnrollment.enrollment">
+                <table class="table table-bordered">
+                    <thead>
+                        <tr>
+                            <th class="active" style="vertical-align:middle" ng-repeat="stage in programStages">                            
+                                {{stage.name}}
+
+                                <!-- event add/filter icon begins -->
+                                <span class='pull-right'>
+
+                                    <span ng-if="stageNeedsEvent(stage) && selectedEnrollment.status === 'ACTIVE'">
+                                        <a href title="{{'create_new_event'| translate}}" ng-click="showCreateEvent(stage)" style="vertical-align:middle"><i class="fa fa-plus"></i></a>
+                                    </span>
+                                </span>
+                                <!-- event add/filter icon ends -->
+
+                            </th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        <tr>
+                            <td ng-repeat="stage in programStages">
+                                <div class="inline-block" ng-repeat="dhis2Event in eventsByStage[stage.id]">
+                                    <div class="event-container" 
+                                         ng-class="getEventStyle(dhis2Event)" 
+                                         ng-show="!currentPeriod[stage.id] || !filterEvents || currentPeriod[stage.id] && currentPeriod[stage.id].event === dhis2Event.event"
+                                         ng-click="showDataEntry(dhis2Event, false)">
+                                        {{dhis2Event.orgUnitName}}<br/>
+                                        {{dhis2Event.sortingDate}}<br>
+                                        <span ng-if="eventsByStage[stage.id].length > 1 && !filterEvents">[{{eventsByStage[stage.id].length - $index}}]</span>
+                                    </div>
+                                </div>
+                                <span ng-if="eventsByStage[stage.id].length > 1 && filterEvents">
+                                    <span ng-if="currentEvent.programStage !== stage.id">
+                                        <div class="event-paging">
+                                            <a href class="event-paging" ng-click="showDataEntryForEvent(eventsByStage[stage.id][0])">{{'show_more'| translate}}</a>
+                                        </div>                                    
+                                    </span>
+                                    <event-paginator ng-if="stage.id === currentEvent.programStage"></event-paginator>                             
+                                </span>
+                                <div ng-if="!eventsByStage[stage.id] || eventsByStage[stage.id].length < 1">
+                                    <div class="alert alert-warning">{{'no_events_exist'| translate}}</div> 
+                                </div>
+                            </td>
+                        </tr>
+                    </tbody>
+                </table>
+            </div>
+
+            <div ng-if="!selectedEnrollment || !selectedEnrollment.enrollment" class="alert alert-danger">{{notEnrolledLabel}}</div>
+
+            <form name="outerForm" novalidate>
+                <div ng-if="currentEvent">
+
+                    <!-- event dates/scheduling begin -->
+                    <div class="row" ng-if="(displayCustomForm !== 'TABLE') && !currentStage.periodType">
+
+                        <div ng-class="{true: 'col-md-12', false: 'col-md-6'} [currentStage.hideDueDate]">
+                            {{currentEvent.excecutionDateLabel}}
+                            <input type="text"
+                                   placeholder="{{dhis2CalendarFormat.keyDateFormat}}"
+                                   class="form-control" 
+                                   ng-class="{'input-success': eventDateSaved}"
+                                   d2-date 
+                                   max-date="0"
+                                   min-date=""
+                                   ng-model="currentEvent.eventDate"
+                                   ng-disabled="currentEvent.status === 'SKIPPED' || selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed"    
+                                   ng-required="true"
+                                   blur-or-change="saveEventDate()"/>
+                            <span ng-if="invalidDate" class="error">{{'date_required'| translate}}</span>
+                        </div>
+                        <div class="col-md-6" ng-if="!currentStage.hideDueDate">
+                            <span ng-if="currentEvent.eventDate || currentEvent.status === 'SKIPPED' || currentEvent.dueDate">
+                                {{'due_date'| translate}}
+                            </span>
+                            <span ng-if="!currentEvent.eventDate && currentEvent.status !== 'SKIPPED' && !selectedEntity.inactive">
+                                <a href ng-click="enableRescheduling()" title="{{ schedulingEnabled ? 'disable_rescheduling' : 'enable_rescheduling' | translate}}"><span class="text-primary bold">{{'reschedule_duedate'| translate}}</span></a>                        
+                            </span>                    
+                            <input type="text" 
+                                   placeholder="{{dhis2CalendarFormat.keyDateFormat}}"
+                                   class="form-control"
+                                   ng-class="{'input-success': dueDateSaved}"
+                                   d2-date                                
+                                   ng-model="currentEvent.dueDate"
+                                   blur-or-change="saveDueDate()" 
+                                   ng-disabled="currentEvent.eventDate || !schedulingEnabled || selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed"/>
+                            <span ng-if="invalidDate" class="error">{{'date_required'| translate}}</span>
+                        </div>                        
+                    </div>
+                    <!-- event dates/scheduling end -->
+
+                    <!-- coordinates begin -->
+                    <div class="row" ng-if="currentStage.captureCoordinates && currentEvent.eventDate">
+                        <div class="col-md-6">
+                            {{'latitude'| translate}}<span><a href ng-click="showMap(currentEvent)" title="{{'get_from_map'| translate}}"><i class="fa fa-map-marker fa-2x"></i></a></span>
+                            <input type="number"
+                                   ng-model="currentEvent.coordinate.latitude"     
+                                   class="form-control" 
+                                   ng-class="{'input-success': latitudeSaved}" 
+                                   name="latitude"
+                                   d2-coordinate-validator
+                                   ng-blur="saveCoordinate('LAT')"
+                                   ng-disabled="currentEvent.enrollmentStatus !== 'ACTIVE' || currentEvent.editingNotAllowed"    
+                                   ng-required="false"/>
+                            <div ng-messages="outerForm.latitude.$error" ng-if="interacted(outerForm.latitude)" class="required" ng-messages-include="../dhis-web-commons/angular-forms/error-messages.html">                        
+                            </div>
+                        </div>
+                        <div class="col-md-6">
+                            {{'longitude'| translate}}<span><a href ng-click="showMap(currentEvent)" title="{{'get_from_map'| translate}}"><i class="fa fa-map-marker fa-2x"></i></a></span>                    
+                            <input type="number"  
+                                   ng-model="currentEvent.coordinate.longitude"     
+                                   class="form-control" 
+                                   ng-class="{'input-success': longitudeSaved}"
+                                   name="longitude" 
+                                   d2-coordinate-validator
+                                   ng-blur="saveCoordinate('LNG')"
+                                   ng-disabled="currentEvent.enrollmentStatus !== 'ACTIVE' || currentEvent.editingNotAllowed" 
+                                   ng-required="false"/>
+                            <div ng-messages="outerForm.longitude.$error" ng-if="interacted(outerForm.longitude)" class="required" ng-messages-include="../dhis-web-commons/angular-forms/error-messages.html">
+                            </div>
+                        </div>
+                    </div>
+                    <!-- coordinates begin -->
+
+                    <!-- data entry form begins -->
+                    <div ng-if="currentEvent.eventDate">                            
+                        <div class="clear vertical-spacing" ng-if="displayCustomForm === 'CUSTOM'" ng-include="'../dhis-web-commons/angular-forms/custom-form.html'"></div>
+                        <div class="clear vertical-spacing" ng-if="displayCustomForm === 'DEFAULT'" ng-include="'components/dataentry/default-form.html'"></div>
+                    </div>    
+                    <!-- the table form is insensitive to the event date being present. In this situation the eventdate is set inside the table form -->
+                    <div class="clear vertical-spacing" ng-if="displayCustomForm === 'TABLE'" ng-include="'components/dataentry/table-entry-form.html'"></div>
+
+                    <!-- data entry form ends -->
+
+                    <!-- data entry/event buttons begins -->                
+
+                    <div class="form-group hideInPrint" ng-if="displayCustomForm !== 'TABLE'">
+                        <div class='row'><hr></div>
+                        <a href ng-click="completeIncompleteEvent()" 
+                           class="btn btn-warning" 
+                           ng-disabled="selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed || currentEvent.orgUnit !== selectedOrgUnit.id"
+                           ng-if="currentEvent.eventDate && (currentEvent.status === 'SCHEDULE' || currentEvent.status === 'ACTIVE' || currentEvent.status === 'VISITED')">{{'complete'| translate}}</a>
+                        <a href ng-click="completeIncompleteEvent()" 
+                           class="btn btn-warning"
+                           ng-disabled="selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed && currentEvent.status !== 'COMPLETED' || currentEvent.orgUnit !== selectedOrgUnit.id"
+                           ng-if="currentEvent.eventDate && currentEvent.status === 'COMPLETED'">{{'incomplete'| translate}}</a>
+                        <a href ng-click="skipUnskipEvent()" 
+                           class="btn btn-warning" 
+                           ng-disabled="selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed || currentEvent.orgUnit !== selectedOrgUnit.id"
+                           ng-if="!currentEvent.eventDate">{{currentEvent.status === 'SKIPPED' ? 'unskip' : 'skip'| translate}}</a>
+                        <a href ng-click="deleteEvent()" 
+                           ng-disabled="selectedEnrollment.status === 'COMPLETED' || currentEvent.editingNotAllowed || currentEvent.orgUnit !== selectedOrgUnit.id"
+                           class="btn btn-danger">{{'delete'| translate}}</a>
+                        <a href class="btn btn-info" ng-click="print('print-div');">{{'print_form'| translate}}</a>
+                    </div>
+                    <!-- data entry/event buttons ends -->
+
+                </div>
+            </form>
+
+            <div ng-if="displayCustomForm !== 'TABLE'">
+                <div ng-show="currentEvent" class='remove-default-padding overflow-ellipsis'>
                     <div class='row'><hr></div>
-                    <a href ng-click="completeIncompleteEvent()" 
-                       class="btn btn-warning" 
-                       ng-disabled="selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed || currentEvent.orgUnit !== selectedOrgUnit.id"
-                       ng-if="currentEvent.eventDate && (currentEvent.status === 'SCHEDULE' || currentEvent.status === 'ACTIVE' || currentEvent.status === 'VISITED')">{{'complete'| translate}}</a>
-                    <a href ng-click="completeIncompleteEvent()" 
-                       class="btn btn-warning"
-                       ng-disabled="selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed && currentEvent.status !== 'COMPLETED' || currentEvent.orgUnit !== selectedOrgUnit.id"
-                       ng-if="currentEvent.eventDate && currentEvent.status === 'COMPLETED'">{{'incomplete'| translate}}</a>
-                    <a href ng-click="skipUnskipEvent()" 
-                       class="btn btn-warning" 
-                       ng-disabled="selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed || currentEvent.orgUnit !== selectedOrgUnit.id"
-                       ng-if="!currentEvent.eventDate">{{currentEvent.status === 'SKIPPED' ? 'unskip' : 'skip'| translate}}</a>
-                    <a href ng-click="deleteEvent()" 
-                       ng-disabled="selectedEnrollment.status === 'COMPLETED' || currentEvent.editingNotAllowed || currentEvent.orgUnit !== selectedOrgUnit.id"
-                       class="btn btn-danger">{{'delete'| translate}}</a>
-                    <a href class="btn btn-info" ng-click="print('print-div');">{{'print_form'| translate}}</a>
-                </div>
-                <!-- data entry/event buttons ends -->
-
-            </div>
-        </form>
-
-        <div ng-if="displayCustomForm !== 'TABLE'">
-            <div ng-show="currentEvent" class='remove-default-padding overflow-ellipsis'>
-                <div class='row'><hr></div>
-                <div class="add-default-padding">
-                    <textarea class="form-control" rows="3" ng-model="note.value" placeholder="{{'add_new_note_here'| translate}}"></textarea> 
-                    <div class="vertical-spacing hideInPrint">
-                        <button type="button" 
-                                class="btn btn-primary"
-                                ng-click="addNote()">
-                            {{'add'| translate}}
-                        </button>        
-                        <button type="button" 
-                                class="btn btn-default small-horizonal-spacing hideInPrint"
-                                ng-click="clearNote()">
-                            {{'clear'| translate}}
-                        </button>
+                    <div class="add-default-padding">
+                        <textarea class="form-control" rows="3" ng-model="note.value" placeholder="{{'add_new_note_here'| translate}}"></textarea> 
+                        <div class="vertical-spacing hideInPrint">
+                            <button type="button" 
+                                    class="btn btn-primary"
+                                    ng-click="addNote()">
+                                {{'add'| translate}}
+                            </button>        
+                            <button type="button" 
+                                    class="btn btn-default small-horizonal-spacing hideInPrint"
+                                    ng-click="clearNote()">
+                                {{'clear'| translate}}
+                            </button>
+                        </div>
                     </div>
+                    <table class="table table-striped dhis2-table-hover">
+                        <tr ng-repeat="note in currentEvent.notes">
+                            <td class="add-default-left-padding">
+                                <d2-pop-over content="note" template="popover.html" details="{{'details'| translate}}">
+                                    <div>{{note.heading}}</div>
+                                </d2-pop-over>
+                                <script type="text/ng-template" id="popover.html">
+                                    <div class="wrap-text">{{content.value}}</div>
+                                    <hr>
+                                    <p><strong>{{'created_by' | translate}}: </strong>{{content.storedBy}}</p>
+                                    <p><strong>{{'date' | translate}}: </strong>{{content.storedDate}}</p>                           
+                                </script>
+                            </td> 
+                        </tr>
+                    </table>
                 </div>
-                <table class="table table-striped dhis2-table-hover">
-                    <tr ng-repeat="note in currentEvent.notes">
-                        <td class="add-default-left-padding">
-                            <d2-pop-over content="note" template="popover.html" details="{{'details'| translate}}">
-                                <div>{{note.heading}}</div>
-                            </d2-pop-over>
-                            <script type="text/ng-template" id="popover.html">
-                                <div class="wrap-text">{{content.value}}</div>
-                                <hr>
-                                <p><strong>{{'created_by' | translate}}: </strong>{{content.storedBy}}</p>
-                                <p><strong>{{'date' | translate}}: </strong>{{content.storedDate}}</p>                           
-                            </script>
-                        </td> 
-                    </tr>
-                </table>
+                <div ng-show="currentEvent && !currentEvent.notes" class="alert alert-warning">{{'no_notes_exist'| translate}}</div> 
             </div>
-            <div ng-show="currentEvent && !currentEvent.notes" class="alert alert-warning">{{'no_notes_exist'| translate}}</div> 
+            
         </div>
+        
+        
     </div>        
 </div>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js	2015-12-14 15:05:21 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js	2015-12-16 09:43:38 +0000
@@ -15,7 +15,8 @@
                 ModalService) {
     
     $scope.today = DateUtils.getToday();
-    $scope.selectedOrgUnit = SessionStorageService.get('SELECTED_OU');    
+    $scope.selectedOrgUnit = SessionStorageService.get('SELECTED_OU'); 
+    $scope.dashboardReady = false;
     
     //listen for the selected items
     var selections = {};
@@ -144,6 +145,7 @@
     $scope.broadCastSelections = function(listeners){
         var selections = CurrentSelection.get();
         var tei = selections.tei;
+        $scope.dashboardReady = true;
         
         CurrentSelection.set({tei: tei, te: $scope.selectedEntity, prs: $scope.programs, pr: $scope.selectedProgram, prNames: $scope.programNames, prStNames: $scope.programStageNames, enrollments: $scope.enrollments, selectedEnrollment: $scope.selectedEnrollment, optionSets: $scope.optionSets});
         $timeout(function() { 

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html	2015-12-14 15:05:21 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html	2015-12-16 09:43:38 +0000
@@ -13,138 +13,145 @@
     </div>
     <div ng-show="enrollmentWidget.expand" class="panel-body dashboard-widget-container">
         
-        <!-- operations on selected enrollment begins -->
-        <div class="row equal-height-columns">
-            <div class="col-sm-6">                
-                <div class="title small-vertical-spacing">
-                    {{'for_selected_program'| translate}}
-                    
-                    <span class="nav-pills" ng-show="selectedProgram && currentEnrollment && currentEnrollment !== selectedEnrollment">
-                        | <a href ng-click="loadEnrollmentDetails(currentEnrollment)" title="{{'current'| translate}}"><span ng-class="{true: 'widget-link-active', false: 'widget-link'} [showEnrollmentDiv]">{{'current'| translate}}</span></a>
-                    </span>
-                    <span class="nav-pills" ng-show="selectedProgram && !currentEnrollment && !selectedTei.inactive">
-                            | <a href ng-click="showNewEnrollment()" title="{{'new'| translate}}"><span ng-class="{true: 'widget-link-active', false: 'widget-link'} [showEnrollmentDiv]">{{'new'| translate}}</span></a>
-                    </span>
-                    <span class="nav-pills" ng-show="hasEnrollmentHistory">
-                        | <a href ng-click="showEnrollmentHistory()" title="{{'history'| translate}}"><span ng-class="{true: 'widget-link-active', false: 'widget - link'} [showEnrollmentHistoryDiv]">{{'history'| translate}}</span></a>
-                    </span>
-                </div>
-                <div ng-if="selectedEnrollment.enrollment">                    
-                    <table class="dhis2-list-table-striped dhis2-table-hover">
-                        <tr>
-                            <td>
-                                {{'enrolling_orgunit' | translate}}
-                            </td>
-                            <td>
-                                <input type="text" class="form-control" value={{selectedEnrollment.orgUnitName}} ng-disabled="true"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td>
-                                {{selectedProgram.enrollmentDateLabel}}
-                            </td>
-                            <td>
-                                <input type="text" placeholder="{{dhis2CalendarFormat.keyDateFormat}}" class="form-control" d2-date ng-model="selectedEnrollment.enrollmentDate" ng-disabled="true"/>
-                            </td>
-                        </tr>
-                        <tr ng-if="selectedProgram.displayIncidentDate">                    
-                            <td>
-                                {{selectedProgram.incidentDateLabel}}
-                            </td>
-                            <td>
-                                <input type="text" placeholder="{{dhis2CalendarFormat.keyDateFormat}}" class="form-control" d2-date ng-model="selectedEnrollment.incidentDate" ng-disabled="true"/>
-                            </td>
-                        </tr>                
-                    </table>
-                    
-                    <div class="vertical-spacing">
-                        <button type="button" 
-                                class="btn btn-primary"
-                                ng-disabled="!canUseEnrollment()"
-                                ng-click="completeEnrollment()">
-                            {{selectedEnrollment.status === 'ACTIVE' ? 'complete' : 'incomplete' | translate}}
-                        </button>
-                        <button type="button" 
-                                class="btn btn-warning"
-                                ng-disabled="selectedEnrollment.status !== 'ACTIVE' || selectedTei.inactive"
-                                ng-click="cancelEnrollment()">
-                            {{'cancel'| translate}}
-                        </button>
-                        <button type="button"
-                                title="{{selectedEnrollment.followup ? 'unmark_for_followup' : 'mark_for_followup' | translate}}"
-                                ng-class="{true: 'btn btn-danger', false: 'btn btn-default'} [selectedEnrollment.followup]"
-                                ng-disabled="selectedEnrollment.status !== 'ACTIVE' || selectedTei.inactive"
-                                ng-click="markForFollowup()">
-                            <i class="fa fa-exclamation-triangle"></i>
-                        </button>
-                    </div>
-                </div>
-                
-                <!-- various alerts begin -->
-                <div ng-if="selectedProgram && !selectedEnrollment && !showEnrollmentDiv && !hasEnrollmentHistory">
-                    <div class="alert alert-warning">{{'not_yet_enrolled_enrollment'| translate}}</div>
-                </div>
-                <div ng-if="selectedProgram && !selectedEnrollment && !showEnrollmentDiv && !showEnrollmentHistoryDiv && hasEnrollmentHistory">
-                    <div class="alert alert-warning">{{'no_active_enrollment_exists'| translate}}</div>
-                </div>
-                <div ng-if="!selectedProgram && programExists">
-                    <div class="alert alert-danger">{{'please_select_a_program_for_enrollment'| translate}}</div> 
-                </div>
-                <div ng-if="!programExists">
-                    <div class="alert alert-danger">{{'no_program_exists_enrollment'| translate}}</div> 
-                </div>
-                <!-- various alerts end -->
-                
-                <!-- operations on historical enrollment begins -->
-                <div ng-if="showEnrollmentHistoryDiv && !selectedEnrollment">
-                    <table class="table table-striped dhis2-table-hover table-bordered">
-                        <tr>
-                            <th>
-                                {{selectedProgram.enrollmentDateLabel}}
-                            </th>
-                            <th ng-if="selectedProgram.displayIncidentDate">
-                                {{selectedProgram.incidentDateLabel}}
-                            </th>
-                            <th>
-                                {{'enrolling_orgunit' | translate}}
-                            </th>
-                        </tr>
-                        <tr ng-click="loadEnrollmentDetails(en)" ng-repeat="en in historicalEnrollments" title="{{'details'| translate}}">
-                            <td>
-                                {{en.enrollmentDate}}
-                            </td>
-                            <td ng-if="selectedProgram.displayIncidentDate">
-                                {{en.incidentDate}}
-                            </td>
-                            <td>
-                                {{en.orgUnitName}}
-                            </td>
-                        </tr>
-                    </table>
-                </div>
-                <!-- operations on historical enrollment ends -->
-            </div>
-            <div class="col-sm-6 border-left" ng-if="!showEnrollmentDiv">
-                <div class="title small-vertical-spacing">{{'for_other_programs'| translate}}</div>                
-                <div ng-if="activeEnrollments.length > 0">
-                    <table class="table table-striped dhis2-table-hover table-bordered">
-                        <tr ng-repeat="activeEnrollment in activeEnrollments">
-                            <td ng-if="selectedProgram && selectedProgram.id !== activeEnrollment.program || !selectedProgram" title="{{'set_as_current'| translate}}" ng-click="changeProgram(activeEnrollment.program)">
-                                {{programNames[activeEnrollment.program].name}}
-                            </td>
-                        </tr>
-                    </table> 
-                </div>
-                <div ng-if="activeEnrollments.length === 0">
-                    <div class="alert alert-info">{{'no_active_enrollments_exist'| translate}}</div>
-                </div>                
-            </div>
-        </div>        
-        <!-- operations on selected enrollment ends -->
-
-        <!-- new enrollment registration form begins -->
-        <div ng-if="showEnrollmentDiv" ng-include="'components/registration/registration.html'"></div>
-        <!-- new enrollment registration form ends -->
+        <div ng-if="!dashboardReady">
+            <img id="ouwt_loader" src="../images/ajax-loader-bar.gif" alt="{{'loading'| translate}}"/>
+        </div>
+        
+        <div ng-if="dashboardReady">
+            
+            <!-- operations on selected enrollment begins -->
+            <div class="row equal-height-columns">
+                <div class="col-sm-6">                
+                    <div class="title small-vertical-spacing">
+                        {{'for_selected_program'| translate}}
+
+                        <span class="nav-pills" ng-show="selectedProgram && currentEnrollment && currentEnrollment !== selectedEnrollment">
+                            | <a href ng-click="loadEnrollmentDetails(currentEnrollment)" title="{{'current'| translate}}"><span ng-class="{true: 'widget-link-active', false: 'widget-link'} [showEnrollmentDiv]">{{'current'| translate}}</span></a>
+                        </span>
+                        <span class="nav-pills" ng-show="selectedProgram && !currentEnrollment && !selectedTei.inactive">
+                                | <a href ng-click="showNewEnrollment()" title="{{'new'| translate}}"><span ng-class="{true: 'widget-link-active', false: 'widget-link'} [showEnrollmentDiv]">{{'new'| translate}}</span></a>
+                        </span>
+                        <span class="nav-pills" ng-show="hasEnrollmentHistory">
+                            | <a href ng-click="showEnrollmentHistory()" title="{{'history'| translate}}"><span ng-class="{true: 'widget-link-active', false: 'widget - link'} [showEnrollmentHistoryDiv]">{{'history'| translate}}</span></a>
+                        </span>
+                    </div>
+                    <div ng-if="selectedEnrollment.enrollment">                    
+                        <table class="dhis2-list-table-striped dhis2-table-hover">
+                            <tr>
+                                <td>
+                                    {{'enrolling_orgunit' | translate}}
+                                </td>
+                                <td>
+                                    <input type="text" class="form-control" value={{selectedEnrollment.orgUnitName}} ng-disabled="true"/>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td>
+                                    {{selectedProgram.enrollmentDateLabel}}
+                                </td>
+                                <td>
+                                    <input type="text" placeholder="{{dhis2CalendarFormat.keyDateFormat}}" class="form-control" d2-date ng-model="selectedEnrollment.enrollmentDate" ng-disabled="true"/>
+                                </td>
+                            </tr>
+                            <tr ng-if="selectedProgram.displayIncidentDate">                    
+                                <td>
+                                    {{selectedProgram.incidentDateLabel}}
+                                </td>
+                                <td>
+                                    <input type="text" placeholder="{{dhis2CalendarFormat.keyDateFormat}}" class="form-control" d2-date ng-model="selectedEnrollment.incidentDate" ng-disabled="true"/>
+                                </td>
+                            </tr>                
+                        </table>
+
+                        <div class="vertical-spacing">
+                            <button type="button" 
+                                    class="btn btn-primary"
+                                    ng-disabled="!canUseEnrollment()"
+                                    ng-click="completeEnrollment()">
+                                {{selectedEnrollment.status === 'ACTIVE' ? 'complete' : 'incomplete' | translate}}
+                            </button>
+                            <button type="button" 
+                                    class="btn btn-warning"
+                                    ng-disabled="selectedEnrollment.status !== 'ACTIVE' || selectedTei.inactive"
+                                    ng-click="cancelEnrollment()">
+                                {{'cancel'| translate}}
+                            </button>
+                            <button type="button"
+                                    title="{{selectedEnrollment.followup ? 'unmark_for_followup' : 'mark_for_followup' | translate}}"
+                                    ng-class="{true: 'btn btn-danger', false: 'btn btn-default'} [selectedEnrollment.followup]"
+                                    ng-disabled="selectedEnrollment.status !== 'ACTIVE' || selectedTei.inactive"
+                                    ng-click="markForFollowup()">
+                                <i class="fa fa-exclamation-triangle"></i>
+                            </button>
+                        </div>
+                    </div>
+
+                    <!-- various alerts begin -->
+                    <div ng-if="selectedProgram && !selectedEnrollment && !showEnrollmentDiv && !hasEnrollmentHistory">
+                        <div class="alert alert-warning">{{'not_yet_enrolled_enrollment'| translate}}</div>
+                    </div>
+                    <div ng-if="selectedProgram && !selectedEnrollment && !showEnrollmentDiv && !showEnrollmentHistoryDiv && hasEnrollmentHistory">
+                        <div class="alert alert-warning">{{'no_active_enrollment_exists'| translate}}</div>
+                    </div>
+                    <div ng-if="!selectedProgram && programExists">
+                        <div class="alert alert-danger">{{'please_select_a_program_for_enrollment'| translate}}</div> 
+                    </div>
+                    <div ng-if="!programExists">
+                        <div class="alert alert-danger">{{'no_program_exists_enrollment'| translate}}</div> 
+                    </div>
+                    <!-- various alerts end -->
+
+                    <!-- operations on historical enrollment begins -->
+                    <div ng-if="showEnrollmentHistoryDiv && !selectedEnrollment">
+                        <table class="table table-striped dhis2-table-hover table-bordered">
+                            <tr>
+                                <th>
+                                    {{selectedProgram.enrollmentDateLabel}}
+                                </th>
+                                <th ng-if="selectedProgram.displayIncidentDate">
+                                    {{selectedProgram.incidentDateLabel}}
+                                </th>
+                                <th>
+                                    {{'enrolling_orgunit' | translate}}
+                                </th>
+                            </tr>
+                            <tr ng-click="loadEnrollmentDetails(en)" ng-repeat="en in historicalEnrollments" title="{{'details'| translate}}">
+                                <td>
+                                    {{en.enrollmentDate}}
+                                </td>
+                                <td ng-if="selectedProgram.displayIncidentDate">
+                                    {{en.incidentDate}}
+                                </td>
+                                <td>
+                                    {{en.orgUnitName}}
+                                </td>
+                            </tr>
+                        </table>
+                    </div>
+                    <!-- operations on historical enrollment ends -->
+                </div>
+                <div class="col-sm-6 border-left" ng-if="!showEnrollmentDiv">
+                    <div class="title small-vertical-spacing">{{'for_other_programs'| translate}}</div>                
+                    <div ng-if="activeEnrollments.length > 0">
+                        <table class="table table-striped dhis2-table-hover table-bordered">
+                            <tr ng-repeat="activeEnrollment in activeEnrollments">
+                                <td ng-if="selectedProgram && selectedProgram.id !== activeEnrollment.program || !selectedProgram" title="{{'set_as_current'| translate}}" ng-click="changeProgram(activeEnrollment.program)">
+                                    {{programNames[activeEnrollment.program].name}}
+                                </td>
+                            </tr>
+                        </table> 
+                    </div>
+                    <div ng-if="activeEnrollments.length === 0">
+                        <div class="alert alert-info">{{'no_active_enrollments_exist'| translate}}</div>
+                    </div>                
+                </div>
+            </div>        
+            <!-- operations on selected enrollment ends -->
+
+            <!-- new enrollment registration form begins -->
+            <div ng-if="showEnrollmentDiv" ng-include="'components/registration/registration.html'"></div>
+            <!-- new enrollment registration form ends -->
+        </div>
         
     </div>
 </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	2015-11-27 09:35:48 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes-controller.js	2015-12-16 09:43:38 +0000
@@ -7,7 +7,7 @@
                 CurrentSelection,
                 SessionStorageService,
                 orderByFilter) {
-    
+    $scope.dashboardReady = false;
     var userProfile = SessionStorageService.get('USER_PROFILE');
     var storedBy = userProfile && userProfile.username ? userProfile.username : '';
 
@@ -21,7 +21,7 @@
         $scope.selectedEnrollment = null;
         var selections = CurrentSelection.get();
         $scope.selectedTei = selections.tei;
-        
+        $scope.dashboardReady = true;
         var selections = CurrentSelection.get();
         if(selections.selectedEnrollment && selections.selectedEnrollment.enrollment){
             EnrollmentService.get(selections.selectedEnrollment.enrollment).then(function(data){    

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html	2015-11-27 09:35:48 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html	2015-12-16 09:43:38 +0000
@@ -19,44 +19,51 @@
         </span>        
     </div>
     <div ng-show="notesWidget.expand" class="panel-body dashboard-widget-container">
-        <div ng-show="showNotesDiv">
-            <div ng-show="!selectedEnrollment" class="alert alert-danger">{{'not_yet_enrolled_note'| translate}}</div>
-            <div ng-show='selectedEnrollment' class='remove-default-padding overflow-ellipsis'>                
-                <div class="add-default-padding">
-                    <textarea class="form-control" rows="3" ng-model="note.value" placeholder="{{'add_new_note_here'| translate}}"></textarea> 
-                    <div class="vertical-spacing">
-                        <button type="button" 
-                                class="btn btn-primary"
-                                ng-click="addNote()">
-                            {{'add'| translate}}
-                        </button>        
-                        <button type="button" 
-                                class="btn btn-default small-horizonal-spacing" 
-                                ng-click="clearNote()">
-                            {{'clear'| translate}}
-                        </button>
+        
+        <div ng-if="!dashboardReady">
+            <img id="ouwt_loader" src="../images/ajax-loader-bar.gif" alt="{{'loading'| translate}}"/>
+        </div>
+        
+        <div ng-if="dashboardReady">
+            <div ng-show="showNotesDiv">
+                <div ng-show="!selectedEnrollment" class="alert alert-danger">{{'not_yet_enrolled_note'| translate}}</div>
+                <div ng-show='selectedEnrollment' class='remove-default-padding overflow-ellipsis'>                
+                    <div class="add-default-padding">
+                        <textarea class="form-control" rows="3" ng-model="note.value" placeholder="{{'add_new_note_here'| translate}}"></textarea> 
+                        <div class="vertical-spacing">
+                            <button type="button" 
+                                    class="btn btn-primary"
+                                    ng-click="addNote()">
+                                {{'add'| translate}}
+                            </button>        
+                            <button type="button" 
+                                    class="btn btn-default small-horizonal-spacing" 
+                                    ng-click="clearNote()">
+                                {{'clear'| translate}}
+                            </button>
+                        </div>
                     </div>
+                    <table class="table table-striped dhis2-table-hover">
+                        <tr ng-repeat="note in selectedEnrollment.notes| filter:noteSearchText">
+                            <td class="add-default-left-padding">
+                                <d2-pop-over content="note" template="popover.html" details="{{'details'| translate}}">
+                                    <div>{{note.heading}}</div>
+                                </d2-pop-over>
+                                <script type="text/ng-template" id="popover.html">
+                                    <div class="wrap-text">{{content.value}}</div>
+                                    <hr>
+                                    <p><strong>{{'created_by' | translate}}: </strong>{{content.storedBy}}</p>
+                                    <p><strong>{{'date' | translate}}: </strong>{{content.storedDate}}</p>                           
+                                </script>
+                            </td> 
+                        </tr>
+                    </table>
                 </div>
-                <table class="table table-striped dhis2-table-hover">
-                    <tr ng-repeat="note in selectedEnrollment.notes| filter:noteSearchText">
-                        <td class="add-default-left-padding">
-                            <d2-pop-over content="note" template="popover.html" details="{{'details'| translate}}">
-                                <div>{{note.heading}}</div>
-                            </d2-pop-over>
-                            <script type="text/ng-template" id="popover.html">
-                                <div class="wrap-text">{{content.value}}</div>
-                                <hr>
-                                <p><strong>{{'created_by' | translate}}: </strong>{{content.storedBy}}</p>
-                                <p><strong>{{'date' | translate}}: </strong>{{content.storedDate}}</p>                           
-                            </script>
-                        </td> 
-                    </tr>
-                </table>
-            </div>
-            <div ng-show="selectedEnrollment && !selectedEnrollment.notes" class="alert alert-warning">{{'no_notes_exist'| translate}}</div> 
-        </div>
-        <div ng-show="showMessagingDiv">
-            <div class="alert alert-warning">{{'under_construction'| translate}}</div> 
-        </div>
+                <div ng-show="selectedEnrollment && !selectedEnrollment.notes" class="alert alert-warning">{{'no_notes_exist'| translate}}</div> 
+            </div>
+            <div ng-show="showMessagingDiv">
+                <div class="alert alert-warning">{{'under_construction'| translate}}</div> 
+            </div>
+        </div>        
     </div>
 </div>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js	2015-12-03 22:41:49 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js	2015-12-16 09:43:38 +0000
@@ -5,7 +5,7 @@
                 $scope,
                 $timeout,
                 CurrentSelection) {    
-    
+    $scope.dashboardReady = false;
     $scope.editingDisabled = true;
     $scope.enrollmentEditing = false;
     $scope.widget = 'PROFILE';
@@ -27,6 +27,7 @@
     });
     
     var listenToBroadCast = function(){
+        $scope.dashboardReady = true;
         $scope.editingDisabled = true;
         selections = CurrentSelection.get();
         $scope.selectedTei = angular.copy(selections.tei);

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html	2015-12-10 10:59:55 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html	2015-12-16 09:43:38 +0000
@@ -14,10 +14,18 @@
         </span>        
     </div>
     <div ng-show="profileWidget.expand" class="panel-body dashboard-widget-container">
-        <form name="outerForm" novalidate>
-            <div ng-if="!enrollmentEditing">                
-                <div ng-include="'components/registration/registration.html'"></div>
-            </div>
-        </form>
+        
+        <div ng-if="!dashboardReady">
+            <img id="ouwt_loader" src="../images/ajax-loader-bar.gif" alt="{{'loading'| translate}}"/>
+        </div>
+        
+        <div ng-if="dashboardReady">
+            <form name="outerForm" novalidate>
+                <div ng-if="!enrollmentEditing">                
+                    <div ng-include="'components/registration/registration.html'"></div>
+                </div>
+            </form>
+        </div>
+        
     </div>
 </div>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship-controller.js	2015-10-16 13:54:46 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship-controller.js	2015-12-16 09:43:38 +0000
@@ -11,6 +11,7 @@
                 RelationshipFactory,
                 ModalService,
                 DialogService) {
+    $scope.dashboardReady = false;
     $rootScope.showAddRelationshipDiv = false;    
     $scope.relatedProgramRelationship = false;
     
@@ -42,6 +43,7 @@
                 $scope.relationships[rel.id] = rel;
             });
             
+            $scope.dashboardReady = true;
             setRelationships();            
         });
     });

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html	2015-09-15 16:03:55 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html	2015-12-16 09:43:38 +0000
@@ -18,30 +18,38 @@
         </span>        
     </div>
     <div ng-show="relationshipsWidget.expand" class="panel-body dashboard-widget-container">
-        <div ng-show="selectedTei && !selectedTei.relationships || selectedTei.relationships.length < 1" class="alert alert-warning">{{noRelationshipLabel}}</div> 
-        <div ng-show="!selectedTei" class="alert alert-danger">{{'relationship_not_possible'| translate}}</div> 
-        
-        <div ng-if="relatedTeis.length > 0">            
-            <table class="table table-striped dhis2-table-hover table-bordered">
-                <tr>
-                    <th>
-                        {{'relationship' | translate}}
-                    </th>
-                    <th ng-repeat="att in attributes" ng-if="att.displayInListNoProgram">
-                        {{att.name}}
-                    </th>
-                    <th></th>
-                </tr>
-                <tr ng-repeat="rel in relatedTeis">
-                    <td title="{{'go_to_dashboard'| translate}}" ng-click="showDashboard(rel.trackedEntityInstance, rel.relId)">{{rel.relName}}</td> 
-                    <td title="{{'go_to_dashboard'| translate}}" ng-click="showDashboard(rel.trackedEntityInstance, rel.relId)" ng-repeat="att in attributes" ng-if="att.displayInListNoProgram">
-                        {{rel.attributes[att.id]}}
-                    </td>
-                    <td ng-click="removeRelationship(rel)" title="{{'delete_relationship'| translate}}" ng-if="!selectedTei.inactive">
-                        <i class="fa fa-trash-o red"></i>
-                    </td>
-                </tr>
-            </table>           
-        </div>
+        
+        <div ng-if="!dashboardReady">
+            <img id="ouwt_loader" src="../images/ajax-loader-bar.gif" alt="{{'loading'| translate}}"/>
+        </div>
+        
+        <div ng-if="dashboardReady">
+            <div ng-show="selectedTei && !selectedTei.relationships || selectedTei.relationships.length < 1" class="alert alert-warning">{{noRelationshipLabel}}</div> 
+            <div ng-show="!selectedTei" class="alert alert-danger">{{'relationship_not_possible'| translate}}</div> 
+
+            <div ng-if="relatedTeis.length > 0">            
+                <table class="table table-striped dhis2-table-hover table-bordered">
+                    <tr>
+                        <th>
+                            {{'relationship' | translate}}
+                        </th>
+                        <th ng-repeat="att in attributes" ng-if="att.displayInListNoProgram">
+                            {{att.name}}
+                        </th>
+                        <th></th>
+                    </tr>
+                    <tr ng-repeat="rel in relatedTeis">
+                        <td title="{{'go_to_dashboard'| translate}}" ng-click="showDashboard(rel.trackedEntityInstance, rel.relId)">{{rel.relName}}</td> 
+                        <td title="{{'go_to_dashboard'| translate}}" ng-click="showDashboard(rel.trackedEntityInstance, rel.relId)" ng-repeat="att in attributes" ng-if="att.displayInListNoProgram">
+                            {{rel.attributes[att.id]}}
+                        </td>
+                        <td ng-click="removeRelationship(rel)" title="{{'delete_relationship'| translate}}" ng-if="!selectedTei.inactive">
+                            <i class="fa fa-trash-o red"></i>
+                        </td>
+                    </tr>
+                </table>           
+            </div>
+        </div>
+        
     </div>
 </div>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report-controller.js	2015-09-11 15:16:03 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report-controller.js	2015-12-16 09:43:38 +0000
@@ -13,6 +13,7 @@
                 EnrollmentService) {  
     $scope.showProgramReportDetailsDiv = false;
     $scope.enrollmentsByProgram = [];
+    $scope.dashboardReady = false;
 
     $scope.$on('dashboardWidgets', function(event, args) {
         $scope.showProgramReportDetailsDiv = false;
@@ -25,6 +26,7 @@
         $scope.programs = selections.prs;
         $scope.programNames = selections.prNames;  
         $scope.programStageNames = selections.prStNames;
+        $scope.dashboardReady = true;
     
         angular.forEach(selections.enrollments, function(en){            
             $scope.enrollmentsByProgram[en.program] = en;

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report.html	2015-09-15 16:03:55 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report.html	2015-12-16 09:43:38 +0000
@@ -9,19 +9,27 @@
             <a class="small-horizonal-spacing" href ng-click="removeWidget(reportWidget)" title="{{removeLabel}}"><i class="fa fa-times-circle"></i></a>            
         </span>        
     </div>
-    <div ng-show="reportWidget.expand" class="panel-body dashboard-widget-container">        
-        <div ng-if="!dataExists" class="alert alert-warning">{{noDataReportLabel}}</div>
-        <div ng-if="dataExists" class="remove-default-padding hideInPrint">
-            <table class="table table-striped dhis2-table-hover">
-                <tr ng-click="showProgramReportDetails(pr)" ng-repeat="pr in programs" ng-if="report[pr.id].enrollments" title="{{'details'| translate}}">                   
-                    <td>
-                        {{pr.name}}                        
-                    </td>
-                </tr>
-            </table>
-        </div>
-        <div ng-if="showProgramReportDetailsDiv">     
-            <div ng-class="printable" ng-include="'components/report/program-details.html'"></div>             
-        </div>
+    <div ng-show="reportWidget.expand" class="panel-body dashboard-widget-container">
+        
+        <div ng-if="!dashboardReady">
+            <img id="ouwt_loader" src="../images/ajax-loader-bar.gif" alt="{{'loading'| translate}}"/>
+        </div>
+        
+        <div ng-if="dashboardReady">
+            <div ng-if="!dataExists" class="alert alert-warning">{{noDataReportLabel}}</div>
+            <div ng-if="dataExists" class="remove-default-padding hideInPrint">
+                <table class="table table-striped dhis2-table-hover">
+                    <tr ng-click="showProgramReportDetails(pr)" ng-repeat="pr in programs" ng-if="report[pr.id].enrollments" title="{{'details'| translate}}">                   
+                        <td>
+                            {{pr.name}}                        
+                        </td>
+                    </tr>
+                </table>
+            </div>
+            <div ng-if="showProgramReportDetailsDiv">     
+                <div ng-class="printable" ng-include="'components/report/program-details.html'"></div>             
+            </div>
+        </div>
+        
     </div>
 </div>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/rulebound/rulebound-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/rulebound/rulebound-controller.js	2015-11-12 19:53:13 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/rulebound/rulebound-controller.js	2015-12-16 09:43:38 +0000
@@ -1,10 +1,12 @@
+/* global angular, trackerCapture */
+
 trackerCapture.controller('RuleBoundController',
         function(
                 $rootScope,
                 $scope,
                 $translate,
                 $log) {
-    
+    $scope.dashboardReady = true;
     $scope.widget = $scope.$parent.$parent.biggerWidget ? $scope.$parent.$parent.biggerWidget
     : $scope.$parent.$parent.smallerWidget ? $scope.$parent.$parent.smallerWidget : null;
     $scope.widgetTitle = $scope.widget.title;    

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/rulebound/rulebound.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/rulebound/rulebound.html	2015-10-05 08:58:13 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/rulebound/rulebound.html	2015-12-16 09:43:38 +0000
@@ -10,21 +10,28 @@
         </span>        
     </div>        
     <div ng-show="this.widget.expand" class="panel-body dashboard-widget-container">        
-        <div class="panel-body" ng-if="showKeyDataSection">
-            <div ng-repeat="(key,item) in displayKeyDataEffects" ng-show="item.ineffect"  class="info-container">
-                <div class="info-container-heading">{{item.content | trimquotes }}</div>
-                <div class="info-container-text">{{item.data | trimquotes}}</div>          
-            </div>
-        </div>   
-        <table class="table table-striped dashboard-element-container" ng-if="showTextSection">
-            <tr ng-repeat="(key,item) in displayTextEffects" ng-if="item.ineffect">
-                <td>
-                    <div>
-                        {{item.content | trimquotes}}{{item.data | trimquotes}}
-                    </div>
-                </td>
-            </tr>
-        </table>
-        <div ng-show="!showKeyDataSection && !showTextSection" class="alert alert-warning">{{widgetTitleLabel === "Indicators" ? emptyIndicatorListLabel : emptyFeedbackListLabel}}</div> 
+        <div ng-if="!dashboardReady">
+            <img id="ouwt_loader" src="../images/ajax-loader-bar.gif" alt="{{'loading'| translate}}"/>
+        </div>
+        
+        <div ng-if="dashboardReady">
+            <div class="panel-body" ng-if="showKeyDataSection">
+                <div ng-repeat="(key,item) in displayKeyDataEffects" ng-show="item.ineffect"  class="info-container">
+                    <div class="info-container-heading">{{item.content | trimquotes }}</div>
+                    <div class="info-container-text">{{item.data | trimquotes}}</div>          
+                </div>
+            </div>   
+            <table class="table table-striped dashboard-element-container" ng-if="showTextSection">
+                <tr ng-repeat="(key,item) in displayTextEffects" ng-if="item.ineffect">
+                    <td>
+                        <div>
+                            {{item.content | trimquotes}}{{item.data | trimquotes}}
+                        </div>
+                    </td>
+                </tr>
+            </table>
+            <div ng-show="!showKeyDataSection && !showTextSection" class="alert alert-warning">{{widgetTitleLabel === "Indicators" ? emptyIndicatorListLabel : emptyFeedbackListLabel}}</div> 
+        </div>        
+        
     </div>
 </div>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/selected/selected-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/selected/selected-controller.js	2015-03-27 14:31:13 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/selected/selected-controller.js	2015-12-16 09:43:38 +0000
@@ -1,10 +1,13 @@
+/* global trackerCapture */
+
 trackerCapture.controller('SelectedInfoController',
         function($scope,                
                 SessionStorageService,
                 CurrentSelection) {
+    $scope.dashboardReady = false;                
     //listen for the selected items
     $scope.$on('selectedItems', function(event, args) {
-        
+        $scope.dashboardReady = true;
         var selections = CurrentSelection.get();
         $scope.selectedEntity = selections.tei; 
         $scope.selectedProgram = selections.pr; 

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html	2015-09-15 16:03:55 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html	2015-12-16 09:43:38 +0000
@@ -10,13 +10,21 @@
         </span>        
     </div>    
     <div ng-show="current_selectionsWidget.expand" class="panel-body dashboard-element-container">
-        <div class="row" ng-repeat="selection in selections">
-            <div class="col-sm-6">
-                {{selection.title| translate}}
-            </div>
-            <div class="col-sm-6">
-                <input type="text" class="form-control" value="{{selection.value| translate}}" ng-disabled="true"/>                
-            </div>
-        </div>        
+        
+        <div ng-if="!dashboardReady">
+            <img id="ouwt_loader" src="../images/ajax-loader-bar.gif" alt="{{'loading'| translate}}"/>
+        </div>
+        
+        <div ng-if="dashboardReady">
+            <div class="row" ng-repeat="selection in selections">
+                <div class="col-sm-6">
+                    {{selection.title| translate}}
+                </div>
+                <div class="col-sm-6">
+                    <input type="text" class="form-control" value="{{selection.value| translate}}" ng-disabled="true"/>                
+                </div>
+            </div>
+        </div>
+                
     </div>
 </div>