dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #30127
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15292: synchronized TEI search and registration UI
------------------------------------------------------------
revno: 15292
committer: Abyot Asalefew Gizaw abyota@xxxxxxxxx
branch nick: dhis2
timestamp: Fri 2014-05-16 15:58:07 +0200
message:
synchronized TEI search and registration UI
modified:
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/registration.html
dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/trackedEntityList.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-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json 2014-05-16 11:32:21 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json 2014-05-16 13:58:07 +0000
@@ -73,10 +73,13 @@
"move_to_selected": "Move to selected",
"move_all_to_selected": "Move all to selected",
"add_new": "Add New",
+ "register_new": "Register new",
+ "registration": "Registration",
"save_and_add_new": "Save and add new",
"save_and_go_back": "Save and go back",
"save_and_continue": "Save and continue",
"go_back": "Go back",
+ "cancel": "Cancel",
"more": "More",
"advanced_search": "Advanced search",
"profile": "Profile",
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js 2014-05-16 11:32:21 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js 2014-05-16 13:58:07 +0000
@@ -121,34 +121,10 @@
if($scope.selectedProgram){
programUrl = 'program=' + $scope.selectedProgram.id;
- }
+ }
- $scope.gridColumns = $scope.attributes;
- //also add extra columns - orgunit for example
- $scope.gridColumns.push({id: 'orgUnitName', name: 'Organisation unit', type: 'string'});
-
- //generate grid column for the selected program/attributes
- angular.forEach($scope.gridColumns, function(gridColumn){
-
- if(gridColumn.id === 'orgUnitName' && $scope.ouMode === 'SELECTED'){
- gridColumn.show = false;
- }
- else{
- gridColumn.show = true;
- }
-
- gridColumn.showFilter = false;
-
- if(gridColumn.type === 'date'){
- $scope.filterText[gridColumn.id]= {start: '', end: ''};
- }
- });
-
-
-
-
- console.log('the columns are: ', $scope.gridColumns);
-
+ $scope.gridColumns = $scope.generateGridColumns($scope.attributes);
+
if( mode === $scope.searchMode.freeText ){
if(!$scope.searchText){
$scope.emptySearchText = true;
@@ -179,11 +155,34 @@
programUrl,
attributeUrl.url).then(function(data){
$scope.trackedEntityList = data;
-
- console.log('the list is: ', $scope.trackedEntityList);
});
};
+ $scope.generateGridColumns = function(attributes){
+ var columns = attributes;
+
+ //also add extra columns - orgunit for example
+ columns.push({id: 'orgUnitName', name: 'Organisation unit', type: 'string'});
+
+ //generate grid column for the selected program/attributes
+ angular.forEach(columns, function(column){
+
+ if(column.id === 'orgUnitName' && $scope.ouMode === 'SELECTED'){
+ column.show = false;
+ }
+ else{
+ column.show = true;
+ }
+
+ column.showFilter = false;
+
+ if(column.type === 'date'){
+ $scope.filterText[column.id]= {start: '', end: ''};
+ }
+ });
+ return columns;
+ };
+
$scope.clearEntities = function(){
$scope.trackedEntityList = null;
};
@@ -312,17 +311,13 @@
$scope.attributes = AttributesFactory.getWithoutProgram();
- $scope.selectedProgram = null;
-
- $scope.getProgramAttributes = function(program){
- if(program){
- $scope.selectedProgram = program;
- $scope.attributes = AttributesFactory.getByProgram(program);
- }
- else{
- $scope.attributes = AttributesFactory.getWithoutProgram();
- }
- };
+ //watch for selection of org unit from tree
+ $scope.$watch('selectedProgram', function() {
+ if( angular.isObject($scope.selectedProgram)){
+ $scope.trackedEntityList = [];
+ $scope.attributes = AttributesFactory.getByProgram($scope.selectedProgram);
+ }
+ });
$scope.showDashboard = function(){
$scope.registerEntity();
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css 2014-05-16 11:32:21 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css 2014-05-16 13:58:07 +0000
@@ -821,4 +821,8 @@
box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s
+}
+
+.underline{
+ text-decoration: underline;
}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html 2014-05-16 11:32:21 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html 2014-05-16 13:58:07 +0000
@@ -10,15 +10,15 @@
</div>
<div class="page" id="mainPage" ng-show="selectedOrgUnit">
<h1>
- <span ng-show="!selectedProgram">
- {{'search'| translate}} {{selectedProgram.trackedEntity.name}}
+ <span ng-if='!showRegistrationDiv'>
+ {{selectedProgram.trackedEntity.name}} {{'search'| translate}}
</span>
- <span ng-show="selectedProgram">
- {{'search_for'| translate}} {{selectedProgram.trackedEntity.name}}
- </span>
+ <span ng-if='showRegistrationDiv'>
+ {{selectedProgram.trackedEntity.name}} {{'registration'| translate}}
+ </span>
<a href ng-click="getHelpContent()" title="{{'help'| translate}}"><i class="fa fa-question-circle"></i></a>
</h1>
-
+
<div class="row">
<input type="text" selected-org-unit ng-model="selectedOrgUnit.name" ng-hide=true>
<div class="input-group col-md-6">
@@ -37,7 +37,7 @@
</button>
<button type="button"
class="btn btn-default"
- ng-disabled="showSearchDiv"
+ ng-disabled="showRegistrationDiv || showSearchDiv"
ng-click="search(searchMode.listAll)">
{{'list_all'| translate}}
</button>
@@ -45,8 +45,8 @@
<span class="horizonal-spacing">
<button type="button"
class="btn btn-default"
- ng-click="showRegistration()">
- {{'add_new'| translate}}
+ ng-click="showRegistration()">
+ {{selectedProgram.trackedEntity.name }} {{'registration'| translate}}
</button>
</span>
</div>
@@ -76,7 +76,7 @@
<!--registration begins -->
<div class="row" ng-if="showRegistrationDiv">
<div class="col-md-6">
- <div ng-include="'views/registration.html'"></div>
+ <div ng-include="'views/registration.html'" ng-controller="RegistrationController"></div>
</div>
</div>
<!-- registration ends -->
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/registration.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/registration.html 2014-05-16 11:32:21 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/registration.html 2014-05-16 13:58:07 +0000
@@ -1,36 +1,9 @@
-<div class="bordered-div col-md-12">
- <h2>
- <span ng-show="!selectedProgram">
- {{'add_new'| translate}} {{selectedProgram.trackedEntity.name}}
- </span>
- <span ng-show="selectedProgram">
- {{'add_new'| translate}} {{selectedProgram.trackedEntity.name}}
- </span>
- </h2>
+<div class="bordered-div col-md-12">
<div class="registration-container">
<form name="outerForm" novalidate>
-
+
+ <h3>{{'profile' | translate}}</h3>
<table class="dhis2-list-table-striped dhis2-table-hover">
- <tr>
- <td>
- {{'program'| translate}}
- </td>
- <td>
- <select class="form-control" ng-model="pr" ng-change="getProgramAttributes(pr)" ng-options="program as program.name for program in programs | orderBy: 'name'">
- <option value="">{{'please_select'| translate}}</option>
- </select>
- </td>
- </tr>
- <tr>
- <td>
- {{'program'| translate}}
- </td>
- <td>
- <select class="form-control" ng-model="pr" ng-change="getProgramAttributes(pr)" ng-options="program as program.name for program in programs | orderBy: 'name'">
- <option value="">{{'please_select'| translate}}</option>
- </select>
- </td>
- </tr>
<tr ng-repeat="attribute in attributes">
<td>
@@ -69,11 +42,39 @@
</td>
</tr>
</table>
-
+
+ <div ng-if='selectedProgram'>
+ <hr>
+ <h3>{{'enrollment' | translate}}</h3>
+ <table class="dhis2-list-table-striped dhis2-table-hover">
+ <tr ng-if="selectedProgram">
+ <td>
+ {{'program'| translate}}
+ </td>
+ <td>
+ <select class="form-control" ng-model="pr" ng-change="getProgramAttributes(pr)" ng-options="program as program.name for program in programs | orderBy: 'name'">
+ <option value="">{{'please_select'| translate}}</option>
+ </select>
+ </td>
+ </tr>
+ <tr ng-if="selectedProgram">
+ <td>
+ {{'program'| translate}}
+ </td>
+ <td>
+ <select class="form-control" ng-model="pr" ng-change="getProgramAttributes(pr)" ng-options="program as program.name for program in programs | orderBy: 'name'">
+ <option value="">{{'please_select'| translate}}</option>
+ </select>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
<div class="btn-group vertical-spacing">
<button type="button" class="btn btn-default" ng-click="showDashboard()">{{'save_and_continue'| translate}}</button>
<button type="button" class="btn btn-default" ng-click="registerEntity()">{{'save_and_add_new'| translate}}</button>
- <button type="button" class="btn btn-default" ng-click="showRegistration()">{{'go_back'| translate}}</button>
+ <button type="button" class="btn btn-default" ng-click="showRegistration()">{{'cancel'| translate}}</button>
</div>
</form>
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/trackedEntityList.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/trackedEntityList.html 2014-05-16 11:32:21 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/trackedEntityList.html 2014-05-16 13:58:07 +0000
@@ -1,8 +1,8 @@
<div id="listDiv" ng-switch="trackedEntityList">
<div ng-switch-when=""></div>
<div ng-switch-default>
- <h2>
- {{selectedProgram.trackedEntity.name|| 'entity' | translate}} {{'list'| translate}}
+ <h2 ng-if="trackedEntityList.rows.length > 0">
+ {{selectedProgram.trackedEntity.name || 'entity' | translate}} {{'list'| translate}}
<span class="pull-right">
<button class="btn btn-default" ng-click="showHideColumns()">
{{'show_hide_columns'| translate}}