← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15266: tracked entity list refactored

 

------------------------------------------------------------
revno: 15266
committer: Abyot Asalefew Gizaw abyota@xxxxxxxxx
branch nick: dhis2
timestamp: Wed 2014-05-14 15:09:15 +0200
message:
  tracked entity list refactored
added:
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/trackedEntityList.html
modified:
  dhis-2/dhis-web/dhis-web-tracker-capture/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
=== 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-14 13:04:39 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html	2014-05-14 13:09:15 +0000
@@ -65,88 +65,7 @@
     
     <!-- entity grid begins -->
     <div ng-if="showTrackedEntityDiv">
-        <div id="listDiv" ng-switch="trackedEntityList">                    
-            <div ng-switch-when=""></div>
-            <div ng-switch-default>
-                <h2>
-                    {{selectedProgram.trackedEntity.name|| 'entity' | translate}} {{'list'| translate}}
-                </h2>
-                <div ng-switch="trackedEntityList.rows.length">
-                    <div ng-switch-when="undefined">
-                        <p>
-                            {{'empty'| translate}} {{selectedProgram.trackedEntity.name|| 'entity' | translate}} {{'list'| translate}}                        
-                        </p>
-                    </div>
-                    <div ng-switch-when="0">
-                        <p>
-                            {{'empty'| translate}} {{selectedProgram.trackedEntity.name|| 'entity' | translate}} {{'list'| translate}}
-                        </p>
-                    </div>
-                    <div ng-switch-default>
-
-                        <!-- entity begins -->
-                        <table class="listTable dhis2-table-striped-border dhis2-table-hover">                    
-                            <thead>                        
-                                <tr>
-                                    <th ng-show="!gridColumn.hide" 
-                                        class="max-column-width"                                                
-                                        ng-repeat="gridColumn in gridColumns">
-
-                                        <!-- sort icon begins -->
-                                        <span ng-hide="gridColumn.showFilter" class="bold" ng-click="sortGrid(gridColumn)">
-                                            <i ng-show="sortHeader == gridColumn.id && !reverse" class="fa fa-sort-desc"></i>
-                                            <i ng-show="sortHeader == gridColumn.id && reverse" class="fa fa-sort-asc"></i>
-                                            {{gridColumn.name}}
-                                        </span>
-                                        <!-- sort icon ends -->
-
-                                        <!-- filter icon begins -->
-                                        <span class='pull-right'>
-                                            <span ng-show="gridColumn.type !== 'date'">
-                                                <a href ng-click="filterInGrid(gridColumn)" title="{{'filter'| translate}}"><span ng-class="{true: 'filter - without - content', false: 'filter - with - content'} [filterText[gridColumn.id] == undefined || filterText[gridColumn.id] == '']"><i class="fa fa-filter"></i></span></a>
-                                            </span>
-                                            <span ng-show="gridColumn.type === 'date'">
-                                                <a href ng-click="filterInGrid(gridColumn)" title="{{'filter'| translate}}"><span ng-class="{true: 'filter - without - content', false: 'filter - with - content'} [(filterText[gridColumn.id].start == 'undefined' || filterText[gridColumn.id].start == '') && (filterText[gridColumn.id].end == 'undefined' || filterText[gridColumn.id].end == '')]"><i class="fa fa-filter"></i></span></a>
-                                            </span>                                                    
-                                        </span>
-                                        <!-- filter icon ends -->
-
-                                        <!-- filter input field begins -->
-                                        <div ng-show="gridColumn.showFilter">
-                                            <span ng-show="gridColumn.type !== 'date'">
-                                                <input type="text" ng-model="filterText[gridColumn.id]" ng-blur="filterInGrid(gridColumn)">
-                                            </span>                                                    
-                                            <span ng-show="gridColumn.type === 'date'">
-                                                <input placeholder="{{'start_date'| translate}}" type="text" ng-model="filterText[gridColumn.id].start" data-ng-date readonly="readonly">
-                                                <span ng-hide="filterText[gridColumn.id].start == 'undefined' || filterText[gridColumn.id].start == ''">
-                                                    <a href ng-click='removeStartFilterText(gridColumn.id)'><span class='black'><i class="fa fa-trash-o"></i></span></a>                                                        
-                                                </span>
-                                                <input placeholder="{{'end_date'| translate}}" type="text" ng-model="filterText[gridColumn.id].end" data-ng-date readonly="readonly">
-                                                <span ng-hide="filterText[gridColumn.id].end == 'undefined' || filterText[gridColumn.id].end == ''">
-                                                    <a href ng-click='removeEndFilterText(gridColumn.id)'><span class='black'><i class="fa fa-trash-o"></i></span></a>                                                        
-                                                </span>
-                                            </span>
-                                        </div>
-                                        <!-- filter input field ends -->
-                                    </th>                                    
-                                </tr>                        
-                            </thead>
-                            <tbody id="list">
-                                <tr ng-repeat="trackedEntity in trackedEntityList.rows| paginate:rowsPerPage | orderBy:sortHeader:reverse | gridFilter:filterText:currentFilter" 
-                                    ng-click="showDashboard(trackedEntity)">
-                                    <td class="max-column-width"                                              
-                                        ng-repeat="gridColumn in gridColumns">                                                
-                                        {{trackedEntity[gridColumn.id]}}                                                
-                                    </td>
-                                </tr>
-                            </tbody>        
-                        </table>
-                        <paginator></paginator>
-                        <!-- entity ends -->                            
-                    </div>
-                </div>                        
-            </div>
-        </div> 
+        <div ng-include="'views/trackedEntityList.html'"></div>  
     </div>
     <!-- entity grid ends -->
 </div>           

=== added 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	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/trackedEntityList.html	2014-05-14 13:09:15 +0000
@@ -0,0 +1,82 @@
+<div id="listDiv" ng-switch="trackedEntityList">                    
+    <div ng-switch-when=""></div>
+    <div ng-switch-default>
+        <h2>
+            {{selectedProgram.trackedEntity.name|| 'entity' | translate}} {{'list'| translate}}
+        </h2>
+        <div ng-switch="trackedEntityList.rows.length">
+            <div ng-switch-when="undefined">
+                <p>
+                    {{'empty'| translate}} {{selectedProgram.trackedEntity.name|| 'entity' | translate}} {{'list'| translate}}                        
+                </p>
+            </div>
+            <div ng-switch-when="0">
+                <p>
+                    {{'empty'| translate}} {{selectedProgram.trackedEntity.name|| 'entity' | translate}} {{'list'| translate}}
+                </p>
+            </div>
+            <div ng-switch-default>
+
+                <!-- entity begins -->
+                <table class="listTable dhis2-table-striped-border dhis2-table-hover">                    
+                    <thead>                        
+                        <tr>
+                            <th ng-show="!gridColumn.hide" 
+                                class="max-column-width"                                                
+                                ng-repeat="gridColumn in gridColumns">
+
+                                <!-- sort icon begins -->
+                                <span ng-hide="gridColumn.showFilter" class="bold" ng-click="sortGrid(gridColumn)">
+                                    <i ng-show="sortHeader == gridColumn.id && !reverse" class="fa fa-sort-desc"></i>
+                                    <i ng-show="sortHeader == gridColumn.id && reverse" class="fa fa-sort-asc"></i>
+                                    {{gridColumn.name}}
+                                </span>
+                                <!-- sort icon ends -->
+
+                                <!-- filter icon begins -->
+                                <span class='pull-right'>
+                                    <span ng-show="gridColumn.type !== 'date'">
+                                        <a href ng-click="filterInGrid(gridColumn)" title="{{'filter'| translate}}"><span ng-class="{true: 'filter - without - content', false: 'filter - with - content'} [filterText[gridColumn.id] == undefined || filterText[gridColumn.id] == '']"><i class="fa fa-filter"></i></span></a>
+                                    </span>
+                                    <span ng-show="gridColumn.type === 'date'">
+                                        <a href ng-click="filterInGrid(gridColumn)" title="{{'filter'| translate}}"><span ng-class="{true: 'filter - without - content', false: 'filter - with - content'} [(filterText[gridColumn.id].start == 'undefined' || filterText[gridColumn.id].start == '') && (filterText[gridColumn.id].end == 'undefined' || filterText[gridColumn.id].end == '')]"><i class="fa fa-filter"></i></span></a>
+                                    </span>                                                    
+                                </span>
+                                <!-- filter icon ends -->
+
+                                <!-- filter input field begins -->
+                    <div ng-show="gridColumn.showFilter">
+                        <span ng-show="gridColumn.type !== 'date'">
+                            <input type="text" ng-model="filterText[gridColumn.id]" ng-blur="filterInGrid(gridColumn)">
+                        </span>                                                    
+                        <span ng-show="gridColumn.type === 'date'">
+                            <input placeholder="{{'start_date'| translate}}" type="text" ng-model="filterText[gridColumn.id].start" data-ng-date readonly="readonly">
+                            <span ng-hide="filterText[gridColumn.id].start == 'undefined' || filterText[gridColumn.id].start == ''">
+                                <a href ng-click='removeStartFilterText(gridColumn.id)'><span class='black'><i class="fa fa-trash-o"></i></span></a>                                                        
+                            </span>
+                            <input placeholder="{{'end_date'| translate}}" type="text" ng-model="filterText[gridColumn.id].end" data-ng-date readonly="readonly">
+                            <span ng-hide="filterText[gridColumn.id].end == 'undefined' || filterText[gridColumn.id].end == ''">
+                                <a href ng-click='removeEndFilterText(gridColumn.id)'><span class='black'><i class="fa fa-trash-o"></i></span></a>                                                        
+                            </span>
+                        </span>
+                    </div>
+                    <!-- filter input field ends -->
+                    </th>                                    
+                    </tr>                        
+                    </thead>
+                    <tbody id="list">
+                        <tr ng-repeat="trackedEntity in trackedEntityList.rows| paginate:rowsPerPage | orderBy:sortHeader:reverse | gridFilter:filterText:currentFilter" 
+                            ng-click="showDashboard(trackedEntity)">
+                            <td class="max-column-width"                                              
+                                ng-repeat="gridColumn in gridColumns">                                                
+                                {{trackedEntity[gridColumn.id]}}                                                
+                            </td>
+                        </tr>
+                    </tbody>        
+                </table>
+                <paginator></paginator>
+                <!-- entity ends -->                            
+            </div>
+        </div>                        
+    </div>
+</div> 
\ No newline at end of file