dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #41534
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21156: Note support for table data entry in TC
------------------------------------------------------------
revno: 21156
committer: Markus Bekken <markus.bekken@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2015-11-22 22:25:25 +0100
message:
Note support for table data entry in TC
added:
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/list-with-textarea-modal.html
modified:
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js 2015-11-22 20:50:10 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js 2015-11-22 21:25:25 +0000
@@ -765,9 +765,11 @@
$scope.notesModal = function(){
var bodyList = [];
- for(i = 0; i < $scope.currentEvent.notes.length; i++){
- var currentNote = $scope.currentEvent.notes[i];
- bodyList.push({value1: currentNote.storedDate, value2: currentNote.value});
+ if($scope.currentEvent.notes) {
+ for(i = 0; i < $scope.currentEvent.notes.length; i++){
+ var currentNote = $scope.currentEvent.notes[i];
+ bodyList.push({value1: currentNote.storedDate, value2: currentNote.value});
+ }
}
var dialogOptions = {
=== added file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/list-with-textarea-modal.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/list-with-textarea-modal.html 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/list-with-textarea-modal.html 2015-11-22 21:25:25 +0000
@@ -0,0 +1,29 @@
+<div class="modal-header">
+ <h3>{{modalOptions.headerText | translate}}</h3>
+</div>
+<div class="modal-body">
+ <div>{{modalOptions.bodyText | translate}}</div>
+
+ <div class="container-fluid">
+ <div class="row row-striped null-margins" ng-repeat="item in modalOptions.bodyList">
+
+ <div class="col-sm-12">{{item.value1}}</div>
+ <div class="col-sm-12">{{item.value2}}</div>
+ </div>
+ </div>
+ <br/>
+ <ng-form name="textAreaModalForm">
+ <div ng-repeat="bodyTextArea in modalOptions.bodyTextAreas">
+ <textarea class="form-control ng-pristine ng-untouched ng-valid" rows="10" name="{{bodyTextArea.model}}" ng-model="textAreaValues[bodyTextArea.model]" placeholder="{{bodyTextArea.placeholder}}" ng-required="{{bodyTextArea.required}}" ng-show="{{bodyTextArea.show}}" style="resize:vertical"></textarea>
+ <div ng-messages="textAreaModalForm[bodyTextArea.model].$error" ng-if="textAreaModalForm[bodyTextArea.model].$touched || formSubmitted">
+ <div ng-message="required" class="error">{{bodyTextArea.model}} is required</div>
+ </div>
+ </div>
+ <div style="text-align:right">
+ <button class="btn btn-default" ng-click="textAreaButtonClick()" ng-show="modalOptions.textAreaButtonShow">{{modalOptions.textAreaButtonText | translate}}</button>
+ </div>
+ </ng-form>
+</div>
+<div class="modal-footer">
+ <button class="btn btn-primary" data-ng-click="modalOptions.close()">{{modalOptions.closeButtonText | translate}}</button>
+</div>
\ No newline at end of file