=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/i18n/en.json' --- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/i18n/en.json 2014-02-17 11:45:07 +0000 +++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/i18n/en.json 2014-02-18 09:41:26 +0000 @@ -5,6 +5,8 @@ "event_capture": "Event capture", "registering_unit": "Registering unit", "registered_events": "Registered events", + "new_event_registration": "New event registration", + "update_event": "Updating event", "no_registered_event": "There are no registered events.", "help": "Help", "edit": "Edit", @@ -21,6 +23,8 @@ "hide": "Hide", "show_details": "Show details", "new_event": "New Event", + "data_element": "Data element", + "value": "Value", "register_new_event": "Register New Event", "total_number_of_pages": "No. of pages", "rows_per_page": "No. of rows per page", === modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/index.html' --- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/index.html 2014-02-17 10:22:59 +0000 +++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/index.html 2014-02-18 09:41:26 +0000 @@ -11,8 +11,8 @@ - @@ -48,7 +48,9 @@ - + @@ -75,9 +77,8 @@
-
-
- +
+

{{'event_capture'| translate}}

@@ -96,14 +97,13 @@ - +
- -
+

{{'registered_events'| translate}}

@@ -120,9 +120,18 @@
-
+
+

+ {{'new_event_registration'| translate}} +

+
+

+ {{'update_event'| translate}} +

+
+
=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/scripts/controllers.js' --- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/scripts/controllers.js 2014-02-17 11:45:07 +0000 +++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/scripts/controllers.js 2014-02-18 09:41:26 +0000 @@ -32,14 +32,20 @@ $scope.programStageDataElements = []; $scope.dhis2Events = []; $scope.eventRegistration = false; - $scope.editGridHeaders = false; - $scope.eventGridHeaders = []; + $scope.editGridColumns = false; + $scope.eventGridColumns = []; $scope.newDhis2Event = {dataValues: []}; + $scope.currentEvent = {dataValues: []}; + $scope.currentEventOrginialValue = ''; + + $scope.editingEventInFull = false; + $scope.editingEventInGrid = false; $scope.sortHeader = ''; $scope.reverse = false; $scope.gridFilter = ''; - + + //Get orgunits for the logged in user OrgUnitFactory.getMine().then(function(orgUnits) { $scope.orgUnits = orgUnits; @@ -107,18 +113,29 @@ $scope.dhis2Events = data; //process event list for easier tabular sorting - angular.forEach($scope.dhis2Events, function(dhis2Event){ - dhis2Event.dataValues = orderByFilter(dhis2Event.dataValues, '-dataElement'); - angular.forEach(dhis2Event.dataValues, function(dataValue){ - - //converting int value to integer for proper sorting. - var dataElement = $scope.programStageDataElements[dataValue.dataElement]; - if(dataElement.type == 'int'){ - dataValue.value = parseInt(dataValue.value); - } - dhis2Event[dataValue.dataElement] = dataValue.value; - }); - }); + //angular.forEach($scope.dhis2Events, function(dhis2Event){ + for(var i=0; i < $scope.dhis2Events.length; i++){ + //check if event is empty + if(!angular.isUndefined($scope.dhis2Events[i].dataValues[0].dataElement)){ + $scope.dhis2Events[i].dataValues = orderByFilter($scope.dhis2Events[i].dataValues, '-dataElement'); + angular.forEach($scope.dhis2Events[i].dataValues, function(dataValue){ + + //converting int value to integer for proper sorting. + var dataElement = $scope.programStageDataElements[dataValue.dataElement]; + if(angular.isObject(dataElement)){ + if(dataElement.type == 'int'){ + dataValue.value = parseInt(dataValue.value); + } + $scope.dhis2Events[i][dataValue.dataElement] = dataValue.value; + } + }); + } + else{//event is empty, remove from display list + var index = $scope.dhis2Events.indexOf($scope.dhis2Events[i]); + $scope.dhis2Events.splice(index,1); + i--; + } + } //generate grid headers using program stage data elements //also, create a template for new event. @@ -126,7 +143,7 @@ var dataElement = $scope.programStageDataElements[dataElement]; var name = dataElement.formName || dataElement.name; $scope.newDhis2Event.dataValues.push({dataElement: dataElement, value: '', name: name}); - $scope.eventGridHeaders.push({name: name, id: dataElement.id, filter: '', hide: false}); + $scope.eventGridColumns.push({name: name, id: dataElement.id, filter: '', hide: false}); } }); }); @@ -139,7 +156,7 @@ }; $scope.sortEventGrid = function(gridHeader){ - if ($scope.sortHeader == gridHeader.id){ + if ($scope.sortHeader === gridHeader.id){ $scope.reverse = !$scope.reverse; return; } @@ -150,55 +167,66 @@ $scope.showHideColumns = function(showAllColumns){ if(showAllColumns){ - angular.forEach($scope.eventGridHeaders, function(gridHeader){ + angular.forEach($scope.eventGridColumns, function(gridHeader){ gridHeader.hide = false; }); } else{ - $scope.editGridHeaders = !$scope.editGridHeaders; + $scope.editGridColumns = !$scope.editGridColumns; } }; - $scope.registerEvent = function(){ - $scope.eventRegistration = true; - }; - - $scope.cancelAdding = function(){ - $scope.eventRegistration = false; - } - - $scope.editEvent = function(dhis2Event){ - $scope.editingEvent = !$scope.editingEvent; - $scope.eventUnderEditing = dhis2Event; - - if(dhis2Event.dataValues.length !== $scope.selectedProgramStage.programStageDataElements.length){ + $scope.showEventList = function(){ + $scope.eventRegistration = false; + $scope.editingEventInFull = false; + $scope.editingEventInGrid = false; + + $scope.currentEvent = ''; + }; + + $scope.showEventRegistration = function(){ + $scope.eventRegistration = !$scope.eventRegistration; + $scope.currentEvent = $scope.newDhis2Event; + }; + + $scope.showEditEventInGrid = function(){ + $scope.currentEvent = ContextMenuSelectedItem.getSelectedItem(); + $scope.currentEventOrginialValue = angular.copy($scope.currentEvent); + $scope.editingEventInGrid = !$scope.editingEventInGrid; + }; + + $scope.showEditEventInFull = function(){ + $scope.currentEvent = ContextMenuSelectedItem.getSelectedItem(); + $scope.editingEventInFull = !$scope.editingEventInFull; + $scope.eventRegistration = false; + + if($scope.currentEvent.dataValues.length !== $scope.selectedProgramStage.programStageDataElements.length){ angular.forEach($scope.selectedProgramStage.programStageDataElements, function(prStDe){ - if(!$scope.eventUnderEditing.hasOwnProperty(prStDe.dataElement.id)){ - $scope.eventUnderEditing[prStDe.dataElement.id] = ''; + if(!$scope.currentEvent.hasOwnProperty(prStDe.dataElement.id)){ + $scope.currentEvent[prStDe.dataElement.id] = ''; } }); } + }; + + $scope.addEvent = function(){ + $scope.eventRegistration = false; + $scope.editingEventInFull = false; + $scope.editingEventInGrid = false; + + console.log('the event to be added is: ', $scope.currentEvent); + $scope.currentEvent = ''; + }; + + $scope.updateEvent = function(){ + $scope.eventRegistration = false; + $scope.editingEventInFull = false; + $scope.editingEventInGrid = false; + + console.log('the event to be updated is: ', $scope.currentEvent); + $scope.currentEvent = ''; }; - $scope.updateEvent = function(dhis2Event){ - $scope.editingEvent = !$scope.editingEvent; - $scope.eventUnderEditing = ''; - }; - - $scope.cancelEditing = function(dhis2Event){ - $scope.editingEvent = !$scope.editingEvent; - $scope.eventUnderEditing = ''; - }; - - $scope.editEventInGrid = function(){ - $scope.eventUnderEditing = ContextMenuSelectedItem.getSelectedItem(); - console.log('The event is: ', ContextMenuSelectedItem.getSelectedItem().event); - }; - - $scope.editEventInFull = function(){ - console.log('The event is: ', ContextMenuSelectedItem.getSelectedItem().event); - }; - $scope.removeEvent = function(){ var dhis2Event = ContextMenuSelectedItem.getSelectedItem(); === modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/styles/style.css' --- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/styles/style.css 2014-02-17 10:22:59 +0000 +++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/styles/style.css 2014-02-18 09:41:26 +0000 @@ -731,7 +731,7 @@ } .max-column-width { - max-width:200px; + max-width:200px !important; word-wrap:break-word; } @@ -770,6 +770,25 @@ background-color: #ebf0f6 } +.dhis2-list-table-striped { + width: 100%; + border: 1px solid #c2c2c2; + padding: 5px 10px; +} + +.dhis2-list-table-striped>thead>tr, +.dhis2-list-table-striped>tbody>tr, +.dhis2-list-table-striped>tfoot>tr, +.dhis2-list-table-striped>thead>tr, +.dhis2-list-table-striped>tbody>tr, +.dhis2-list-table-striped>tfoot>tr { + border: none; +} + +.dhis2-list-table-striped > tbody > tr:nth-child(odd)> td, .dhis2-table-striped > tbody > tr:nth-child(odd)> th { + background-color: #ebf0f6 +} + .dhis2-table-hover > tbody > tr:hover > td, .table-hover > tbody > tr:hover > th { background-color: #dfe9f4; } @@ -903,3 +922,142 @@ box-shadow: 0 5px 15px rgba(0,0,0,0.5) } } + +.container { + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto +} +.container:before, .container:after { + display: table; + content: " " +} +.container:after { + clear: both +} +.container:before, .container:after { + display: table; + content: " " +} +.container:after { + clear: both +} +@media (min-width: 768px) { + .container { + width: 750px + } z-index: 1051; +} +@media (min-width: 992px) { + .container { + width: 970px + } +} +@media (min-width: 1200px) { + .container { + width: 1170px + } +} +.container > .navbar-header, .container > .navbar-collapse { + margin-right: -15px; + margin-left: -15px +} +@media (min-width: 768px) { + .container > .navbar-header, .container > .navbar-collapse { + margin-right: 0; + margin-left: 0 + } +} + +@media (min-width: 768px) { + .navbar > .container .navbar-brand { + margin-left: -15px + } +} + +.container .jumbotron { + border-radius: 6px +} +@media screen and (min-width: 768px) { + .jumbotron { + padding-top: 48px; + padding-bottom: 48px + } + .container .jumbotron { + padding-right: 60px; + padding-left: 60px + } + .jumbotron h1 { + font-size: 63px + } +} + +.dropdown { + position: relative +} +.dropdown-toggle:focus { + outline: 0 +} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + font-size: 14px; + list-style: none; + background-color: #fff; + border: 1px solid #ccc; + border: 1px solid rgba(0,0,0,0.15); + border-radius: 4px; + -webkit-box-shadow: 0 6px 12px rgba(0,0,0,0.175); + box-shadow: 0 6px 12px rgba(0,0,0,0.175); + background-clip: padding-box +} +.dropdown-menu.pull-right { + right: 0; + left: auto +} +.dropdown-menu .divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5 +} +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 1.428571429; + color: #333; + white-space: nowrap +} +.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { + color: #262626; + text-decoration: none; + background-color: #f5f5f5 +} +.dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { + color: #fff; + text-decoration: none; + background-color: #428bca; + outline: 0 +} +.dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { + color: #999 +} +.dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { + text-decoration: none; + cursor: not-allowed; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false) +} +.open > .dropdown-menu { + display: block +} \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/views/eventList.html' --- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/views/eventList.html 2014-02-17 11:45:07 +0000 +++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/views/eventList.html 2014-02-18 09:41:26 +0000 @@ -1,7 +1,7 @@
@@ -12,15 +12,17 @@
-
+ + +
- + @@ -33,61 +35,66 @@
- {{eventGridHeader.name}} + {{eventGridColumn.name}} - {{'hide'| translate}} + {{'hide'| translate}}
+ - - + - - - - + + + - + +
- {{eventGridHeader.name}} - - + + {{eventGridColumn.name}} + + +
- {{dhis2Event[eventGridHeader.id]}} +
+ {{dhis2Event[eventGridColumn.id]}} -
+ + +
+
- +
-
- -
+
+
+
+ +
+
+
+ +
+
-
- +
-
- - - + + + -
=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/views/eventRegistration.html' --- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/views/eventRegistration.html 2014-02-14 10:59:22 +0000 +++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/views/eventRegistration.html 2014-02-18 09:41:26 +0000 @@ -1,46 +1,56 @@ -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
- - - - -
- +
+ + + + + + + + + + + + + +
+ {{'data_element' | translate}} + + {{'value' | translate}} +
+ {{eventDataValue.name}} + +
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+
+
+ +
+
+ +
+
+
+ + +      + +
\ No newline at end of file === added file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/views/eventUpdate.html' --- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/views/eventUpdate.html 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/views/eventUpdate.html 2014-02-18 09:41:26 +0000 @@ -0,0 +1,56 @@ +
+ + + + + + + + + + + + + +
+ {{'data_element' | translate}} + + {{'value' | translate}} +
+ {{eventGridColumn.name}} + +
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+
+
+ +
+
+ +
+
+
+ + +      + +
\ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/views/orgUnitTree.html' --- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/views/orgUnitTree.html 2014-02-14 10:59:22 +0000 +++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/app/views/orgUnitTree.html 2014-02-18 09:41:26 +0000 @@ -1,22 +1,24 @@ - - -
    -
  • -
- - + + + + +
    +
  • +
+
\ No newline at end of file +
+ +--> \ No newline at end of file