← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18224: tracker-capture: minor refactoring

 

------------------------------------------------------------
revno: 18224
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-02-11 15:01:07 +0100
message:
  tracker-capture: minor refactoring
added:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/advanced-search.html
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/home.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
=== added file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/advanced-search.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/advanced-search.html	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/advanced-search.html	2015-02-11 14:01:07 +0000
@@ -0,0 +1,110 @@
+<div class="search-container-main">                                
+    <div class="search-container">    
+        <table data-stop-propagation="true" class="table-borderless table-striped">
+            <tr>
+                <td>{{'org_unit'| translate}}</td>
+                <td>                    
+                    <label><input type="radio" ng-model="selectedOuMode.name" name="selected" value="SELECTED"> {{'SELECTED'| translate}}</label><br/>
+                    <label><input type="radio" ng-model="selectedOuMode.name" name="children" value="CHILDREN"> {{'CHILDREN'| translate}}</label><br/>
+                    <label><input type="radio" ng-model="selectedOuMode.name" name="descendants" value="DESCENDANTS"> {{'DESCENDANTS'| translate}}</label><br/>
+                    <label><input type="radio" ng-model="selectedOuMode.name" name="accessible" value="ACCESSIBLE"> {{'ACCESSIBLE'| translate}}</label>
+                </td>
+            </tr>
+            <tr ng-if="selectedProgram">
+                <td>{{'enrollment_date'| translate}}</td>
+                <td>
+                    <div class="dataelement-filter">
+                        <div class="filter-operator">
+                            <select ng-model="enrollment.operator" class="form-control-select2" ng-options="operator | translate for operator in defaultOperators">
+                            </select>
+                        </div>
+                        <div class="filter-value" ng-show="enrollment.operator === defaultOperators[0]">
+                            <input type="text" placeholder="{{'exact_date'| translate}}" class="form-control-select2" d2-date max-date="0" ng-model="enrollment.programExactDate"/>
+                        </div>
+                        <div class="filter-value" ng-show="enrollment.operator === defaultOperators[1]">
+                            <div class="container-1-2">
+                                <input type="text" placeholder="{{'start_date'| translate}}" class="form-control-select2" d2-date ng-model="enrollment.programStartDate"/>
+                            </div>
+                            <div class="container-1-2">
+                                <input type="text" placeholder="{{'end_date'| translate}}" class="form-control-select2" d2-date ng-model="enrollment.programEndDate"/>                
+                            </div>
+                        </div>                    
+                    </div>                
+                </td>
+            </tr>
+            <tr ng-repeat="attribute in attributes">
+                <td>
+                    {{attribute.name}}
+                </td>
+                <td>
+                    <div ng-switch="attribute.valueType">
+                        <div ng-switch-when="number">
+                            <div class="dataelement-filter">                                                
+                                <div class="filter-operator">
+                                    <select ng-model="attribute.operator" class="form-control-select2" ng-options="operator | translate for operator in defaultOperators">
+                                    </select>
+                                </div>
+                                <div class="filter-value" ng-show="attribute.operator === defaultOperators[0]">
+                                    <input type="number" placeholder="{{'exact_value'| translate}}" class="form-control-select2" ng-model="attribute.exactValue"/>
+                                </div>
+                                <div class="filter-value" ng-show="attribute.operator === defaultOperators[1]">
+                                    <div class="container-1-2">
+                                        <input type="number" placeholder="{{'from'| translate}}" class="form-control-select2" ng-model="attribute.startValue"/>
+                                    </div>
+                                    <div class="container-1-2">
+                                        <input type="number" placeholder="{{'to'| translate}}" class="form-control-select2" ng-model="attribute.endValue"/>                
+                                    </div>
+                                </div>                            
+                            </div>                        
+                        </div>
+                        <div ng-switch-when="date">
+                            <div class="dataelement-filter">
+                                <div class="filter-operator">
+                                    <select ng-model="attribute.operator" class="form-control-select2" ng-options="operator | translate for operator in defaultOperators">
+                                    </select>
+                                </div>
+                                <div class="filter-value" ng-show="attribute.operator === defaultOperators[0]">
+                                    <input type="text" placeholder="{{'exact_date'| translate}}" class="form-control-select2" d2-date ng-model="attribute.exactValue"/>
+                                </div>
+                                <div class="filter-value" ng-show="attribute.operator === defaultOperators[1]">
+                                    <div class="container-1-2">
+                                        <input type="text" placeholder="{{'start_date'| translate}}" class="form-control-select2" d2-date ng-model="attribute.startValue"/>
+                                    </div>
+                                    <div class="container-1-2">
+                                        <input type="text" placeholder="{{'end_date'| translate}}" class="form-control-select2" d2-date ng-model="attribute.endValue"/>                
+                                    </div>
+                                </div>                            
+                            </div> 
+                        </div>                        
+                        <div ng-switch-when="optionSet">
+                            <select multiple ui-select2  ng-model="attribute.value" data-placeholder="{{'please_select'| translate}}" style="width:100%;">
+                                <option ng-repeat="option in optionSets[attribute.optionSet.id].options | filter:$viewValue | limitTo:100" value="{{option.code}}">{{option.name}}</option>
+                            </select>
+                        </div>
+                        <div ng-switch-when="bool">
+                            <select ui-select2 multiple ng-model="attribute.value" data-placeholder="{{'please_select'| translate}}" style="width:100%;">
+                                <option ng-repeat="option in boolOperators" value="{{option}}">{{option| translate}}</option>
+                            </select>
+                        </div> 
+                        <div ng-switch-default>
+                            <input type="text" class="form-control-select2" ng-model="attribute.value" /> 
+                        </div>
+                    </div>
+                </td>
+            </tr>         
+        </table>
+    </div>
+
+    <div class="horizonal-spacing">
+        <button type="button"
+                class="btn btn-primary"
+                ng-click="search(searchMode.attributeBased)">
+            {{'search'| translate}}
+        </button>
+        <button type="button" 
+                class="btn btn-success small-horizonal-spacing" 
+                ng-click="search(searchMode.listAll)">
+            {{'list_all'| translate}}
+        </button>        
+    </div>
+</div>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/home.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/home.html	2015-01-20 14:36:12 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/home.html	2015-02-11 14:01:07 +0000
@@ -124,117 +124,7 @@
                     <button class="btn btn-primary trim" type="button" title="{{'search'| translate}}" ng-disabled="showRegistrationDiv || showReportDiv" ng-click="search(searchMode.freeText)"><i class="fa fa-search"></i></button>
                     <div id="searchDropDown" class="dropdown-menu dropdown-menu-right">
                         <form name="searchForm">
-                            <div class="search-container-main">
-                                
-                                <div class="search-container">    
-                                    <table data-stop-propagation="true" class="table-borderless table-striped">
-                                        <tr>
-                                            <td>{{'org_unit'| translate}}</td>
-                                            <td>                    
-                                                <label><input type="radio" ng-model="selectedOuMode.name" name="selected" value="SELECTED"> {{'SELECTED'| translate}}</label><br/>
-                                                <label><input type="radio" ng-model="selectedOuMode.name" name="children" value="CHILDREN"> {{'CHILDREN'| translate}}</label><br/>
-                                                <label><input type="radio" ng-model="selectedOuMode.name" name="descendants" value="DESCENDANTS"> {{'DESCENDANTS'| translate}}</label><br/>
-                                                <label><input type="radio" ng-model="selectedOuMode.name" name="accessible" value="ACCESSIBLE"> {{'ACCESSIBLE'| translate}}</label>
-                                            </td>
-                                        </tr>
-                                        <tr ng-if="selectedProgram">
-                                            <td>{{'enrollment_date'| translate}}</td>
-                                            <td>
-                                                <div class="dataelement-filter">
-                                                    <div class="filter-operator">
-                                                        <select ng-model="enrollment.operator" class="form-control-select2" ng-options="operator | translate for operator in defaultOperators">
-                                                        </select>
-                                                    </div>
-                                                    <div class="filter-value" ng-show="enrollment.operator === defaultOperators[0]">
-                                                        <input type="text" placeholder="{{'exact_date'| translate}}" class="form-control-select2" d2-date max-date="0" ng-model="enrollment.programExactDate"/>
-                                                    </div>
-                                                    <div class="filter-value" ng-show="enrollment.operator === defaultOperators[1]">
-                                                        <div class="container-1-2">
-                                                            <input type="text" placeholder="{{'start_date'| translate}}" class="form-control-select2" d2-date ng-model="enrollment.programStartDate"/>
-                                                        </div>
-                                                        <div class="container-1-2">
-                                                            <input type="text" placeholder="{{'end_date'| translate}}" class="form-control-select2" d2-date ng-model="enrollment.programEndDate"/>                
-                                                        </div>
-                                                    </div>                    
-                                                </div>                
-                                            </td>
-                                        </tr>
-                                        <tr ng-repeat="attribute in attributes">
-                                            <td>
-                                                {{attribute.name}}
-                                            </td>
-                                            <td>
-                                                <div ng-switch="attribute.valueType">
-                                                    <div ng-switch-when="number">
-                                                        <div class="dataelement-filter">                                                
-                                                            <div class="filter-operator">
-                                                                <select ng-model="attribute.operator" class="form-control-select2" ng-options="operator | translate for operator in defaultOperators">
-                                                                </select>
-                                                            </div>
-                                                            <div class="filter-value" ng-show="attribute.operator === defaultOperators[0]">
-                                                                <input type="number" placeholder="{{'exact_value'| translate}}" class="form-control-select2" ng-model="attribute.exactValue"/>
-                                                            </div>
-                                                            <div class="filter-value" ng-show="attribute.operator === defaultOperators[1]">
-                                                                <div class="container-1-2">
-                                                                    <input type="number" placeholder="{{'from'| translate}}" class="form-control-select2" ng-model="attribute.startValue"/>
-                                                                </div>
-                                                                <div class="container-1-2">
-                                                                    <input type="number" placeholder="{{'to'| translate}}" class="form-control-select2" ng-model="attribute.endValue"/>                
-                                                                </div>
-                                                            </div>                            
-                                                        </div>                        
-                                                    </div>
-                                                    <div ng-switch-when="date">
-                                                        <div class="dataelement-filter">
-                                                            <div class="filter-operator">
-                                                                <select ng-model="attribute.operator" class="form-control-select2" ng-options="operator | translate for operator in defaultOperators">
-                                                                </select>
-                                                            </div>
-                                                            <div class="filter-value" ng-show="attribute.operator === defaultOperators[0]">
-                                                                <input type="text" placeholder="{{'exact_date'| translate}}" class="form-control-select2" d2-date ng-model="attribute.exactValue"/>
-                                                            </div>
-                                                            <div class="filter-value" ng-show="attribute.operator === defaultOperators[1]">
-                                                                <div class="container-1-2">
-                                                                    <input type="text" placeholder="{{'start_date'| translate}}" class="form-control-select2" d2-date ng-model="attribute.startValue"/>
-                                                                </div>
-                                                                <div class="container-1-2">
-                                                                    <input type="text" placeholder="{{'end_date'| translate}}" class="form-control-select2" d2-date ng-model="attribute.endValue"/>                
-                                                                </div>
-                                                            </div>                            
-                                                        </div> 
-                                                    </div>                        
-                                                    <div ng-switch-when="optionSet">
-                                                        <select multiple ui-select2  ng-model="attribute.value" data-placeholder="{{'please_select'| translate}}" style="width:100%;">
-                                                            <option ng-repeat="option in optionSets.optionSets[attribute.optionSet.id].options | filter:$viewValue | limitTo:100" value="{{option.code}}">{{option.name}}</option>
-                                                        </select>
-                                                    </div>
-                                                    <div ng-switch-when="bool">
-                                                        <select ui-select2 multiple ng-model="attribute.value" data-placeholder="{{'please_select'| translate}}" style="width:100%;">
-                                                            <option ng-repeat="option in boolOperators" value="{{option}}">{{option| translate}}</option>
-                                                        </select>
-                                                    </div> 
-                                                    <div ng-switch-default>
-                                                        <input type="text" class="form-control-select2" ng-model="attribute.value" /> 
-                                                    </div>
-                                                </div>
-                                            </td>
-                                        </tr>         
-                                    </table>
-                                </div>
-
-                                <div class="horizonal-spacing">
-                                    <button type="button"
-                                            class="btn btn-primary"
-                                            ng-click="search(searchMode.attributeBased)">
-                                        {{'search'| translate}}
-                                    </button>
-                                    <button type="button" 
-                                            class="btn btn-success small-horizonal-spacing" 
-                                            ng-click="search(searchMode.listAll)">
-                                        {{'list_all'| translate}}
-                                    </button>        
-                                </div>
-                            </div>
+                            <div ng-include="'views/advanced-search.html'"></div>
                         </form>
                     </div>
                 </div>