dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #28918
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14527: minor
------------------------------------------------------------
revno: 14527
committer: Abyot Asalefew Gizaw abyota@xxxxxxxxx
branch nick: dhis2
timestamp: Fri 2014-03-28 18:25:21 +0100
message:
minor
modified:
dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/index.html
dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/controllers.js
dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-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-event-capture/src/main/webapp/dhis-web-event-capture/index.html'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/index.html 2014-03-27 15:03:26 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/index.html 2014-03-28 17:25:21 +0000
@@ -1,6 +1,5 @@
<!DOCTYPE html>
-<!--<html manifest="event-capture.appcache" ng-app="eventCapture">-->
-<html ng-app="eventCapture">
+<html manifest="event-capture.appcache" ng-app="eventCapture">
<head>
<title>Event Capture</title>
@@ -45,7 +44,7 @@
<script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.memory.js"></script>
<script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.js"></script>
<script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.contextmenu.js"></script>
- <!--<script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.appcache.js"></script>-->
+ <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.appcache.js"></script>
<script type="text/javascript" src="../dhis-web-commons/ouwt/ouwt.js"></script>
<script type="text/javascript" src="../dhis-web-commons/javascripts/angular/plugins/angularLocalStorage.js"></script>
@@ -134,12 +133,12 @@
<!-- selection ends -->
<!-- event grid begins -->
- <div ng-show="selectedProgramStage && !eventRegistration && !editingEventInFull">
- <div ng-switch="dhis2Events.length">
+ <div ng-show="selectedProgramStage && !eventRegistration && !editingEventInFull">
+ <div ng-switch="eventLength">
<div ng-switch-when="undefined">
<h2>
{{'empty_event_list'| translate}}
- </2>
+ </h2>
</div>
<div ng-switch-when="0">
<img id="ouwt_loader" src="../images/ajax-loader-bar.gif"/>
@@ -157,7 +156,7 @@
<li><a href ng-click="removeEvent()"><i class="fa fa-trash-o"></i> {{'remove'| translate}}</a></li>
</ul>
</div>
- <!-- context menu ends -->
+ <!-- context menu ends -->
<!-- grid begins -->
<form name="outerForm" novalidate>
@@ -191,7 +190,7 @@
<!-- filter input field begins -->
<span ng-show="eventGridColumn.showFilter">
<span ng-show="eventGridColumn.type !=='date'">
- <input type="text" class="form-control" style="width: 50%;" ng-model="filterText[eventGridColumn.id]" ng-blur="searchInGrid(eventGridColumn)">
+ <input type="text" ng-model="filterText[eventGridColumn.id]" ng-blur="searchInGrid(eventGridColumn)">
</span>
<span ng-show="eventGridColumn.type ==='date'">
<input placeholder="{{'start_date' | translate}}" type="text" ng-model="filterText[eventGridColumn.id].start" data-ng-date readonly="readonly">
@@ -211,7 +210,7 @@
</tr>
</thead>
<tbody id="list">
- <tr ng-repeat="dhis2Event in dhis2Events | orderBy:sortHeader:reverse | gridFilter:filterText:programStageDataElements"
+ <tr ng-repeat="dhis2Event in dhis2Events | orderBy:sortHeader:reverse | gridFilter:filterText:programStageDataElements"
ng-click="showContextMenu(dhis2Event)">
<!-- Visible when event is not under editing -->
=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/controllers.js 2014-03-27 10:00:29 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/controllers.js 2014-03-28 17:25:21 +0000
@@ -23,7 +23,6 @@
//Paging
$scope.pager = {pageSize: 50, page: 1, toolBarDisplay: 5};
-
//Filtering
$scope.reverse = false;
$scope.filterText = {};
@@ -95,6 +94,7 @@
$scope.loadEvents = function(program, pager){
$scope.dhis2Events = [];
+ $scope.eventLength = 0;
if( program ){
@@ -103,6 +103,7 @@
$scope.programStageDataElements = [];
$scope.eventGridColumns = [];
+ $scope.filterTypes = {};
$scope.newDhis2Event = {dataValues: []};
$scope.currentEvent = {dataValues: []};
@@ -117,15 +118,20 @@
var name = dataElement.formName || dataElement.name;
$scope.newDhis2Event.dataValues.push({id: dataElement.id, value: ''});
$scope.eventGridColumns.push({name: name, id: dataElement.id, type: dataElement.type, compulsory: prStDe.compulsory, showFilter: false, show: prStDe.displayInReports});
-
+
+ $scope.filterTypes[dataElement.id] = dataElement.type;
+
if(dataElement.type === 'date'){
$scope.filterText[dataElement.id]= {start: '', end: ''};
- }
+ }
+
});
//Load events for the selected program stage and orgunit
DHIS2EventFactory.getByStage($scope.selectedOrgUnit.id, $scope.selectedProgramStage.id, pager ).then(function(data){
+ $scope.eventLength = data.events.length;
+
$scope.dhis2Events = data.events;
if( data.pager ){
@@ -214,7 +220,7 @@
if(!eventGridColumn.show){
$scope.hiddenGridColumns++;
}
- })
+ });
var modalInstance = $modal.open({
templateUrl: 'views/column-modal.html',
@@ -235,8 +241,10 @@
});
};
- $scope.searchInGrid = function(gridColumn){
+ $scope.searchInGrid = function(gridColumn){
+ $scope.currentFilter = gridColumn;
+
for(var i=0; i<$scope.eventGridColumns.length; i++){
//toggle the selected grid column's filter
@@ -247,7 +255,7 @@
$scope.eventGridColumns[i].showFilter = false;
}
}
- };
+ };
$scope.removeStartFilterText = function(gridColumnId){
$scope.filterText[gridColumnId].start = '';
@@ -346,11 +354,13 @@
if(!addingAnotherEvent){
$scope.eventRegistration = false;
$scope.editingEventInFull = false;
- $scope.editingEventInGrid = false;
+ $scope.editingEventInGrid = false;
+ $scope.outerForm.submitted = false;
}
$scope.currentEvent = {};
+ $scope.outerForm.submitted = false;
}
- });
+ });
};
$scope.updateEventDataValue = function(currentEvent, dataElement){
=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/styles/style.css 2014-03-27 15:03:26 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/styles/style.css 2014-03-28 17:25:21 +0000
@@ -23,7 +23,6 @@
{
font-size: 13px;
line-height: 18px;
- margin-bottom: 10px;
}
// --------------------------------------------------------------
@@ -290,7 +289,7 @@
}
.modal-header {
min-height: 16.428571429px;
- padding: 15px;
+ padding: 0 15px;
border-bottom: 1px solid #e5e5e5
}
.modal-header .close {
@@ -302,7 +301,6 @@
}
.modal-body {
position: relative;
- padding: 20px
}
.modal-footer {
padding: 19px 20px 20px;
@@ -482,4 +480,8 @@
}
.open > .dropdown-menu {
display: block
+}
+
+.dropdown-menu li:hover {
+ cursor: pointer;
}
\ No newline at end of file