← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18069: directive for searching ou from tree

 

------------------------------------------------------------
revno: 18069
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-01-20 15:36:12 +0100
message:
  directive for searching ou from tree
removed:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/orgunitTreeSearch.js
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/event-capture.appcache
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/i18n/i18n_app.properties
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/index.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/home.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/home.html
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/angular/plugins/dhis2/directives.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-event-capture/event-capture.appcache'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/event-capture.appcache	2014-12-08 16:37:23 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/event-capture.appcache	2015-01-20 14:36:12 +0000
@@ -120,8 +120,7 @@
 scripts/filters.js
 scripts/directives.js
 scripts/controllers.js        
-scripts/notes-controller.js        
-scripts/orgunitTreeSearch.js
+scripts/notes-controller.js 
 
 views/column-modal.html
 views/ec-custom-form.html

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/i18n/i18n_app.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/i18n/i18n_app.properties	2015-01-15 15:29:08 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/i18n/i18n_app.properties	2015-01-20 14:36:12 +0000
@@ -35,6 +35,7 @@
 option_required=Value must be selected from drop-down
 bool_required=Value must be a boolean
 ok=Ok
+find=Find
 done=Done
 remove=Remove
 are_you_sure_to_remove=Are you sure you want to remove the selected item?

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/index.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/index.html	2015-01-13 17:31:37 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/index.html	2015-01-20 14:36:12 +0000
@@ -75,8 +75,7 @@
         <script type="text/javascript" src="scripts/directives.js"></script>
         <script type="text/javascript" src="scripts/controllers.js"></script>        
         <script type="text/javascript" src="scripts/notes-controller.js"></script>        
-        <script type="text/javascript" src="scripts/filters.js"></script>        
-        <!--<script type="text/javascript" src="scripts/orgunitTreeSearch.js"></script>-->
+        <script type="text/javascript" src="scripts/filters.js"></script>
 
         <!-- Menu scripts -->
         <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.translate.js"></script>

=== removed file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/orgunitTreeSearch.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/orgunitTreeSearch.js	2014-05-28 08:15:56 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/orgunitTreeSearch.js	1970-01-01 00:00:00 +0000
@@ -1,15 +0,0 @@
-jQuery(document).ready(function() {
-    jQuery("#searchIcon").click(function() {
-        jQuery("#searchSpan").toggle();
-        jQuery("#searchField").focus();
-    });
-
-    jQuery("#searchField").autocomplete({
-        source: "../dhis-web-commons/ouwt/getOrganisationUnitsByName.action",
-        select: function(event, ui) {
-            jQuery("#searchField").val(ui.item.value);
-            selection.findByName();
-        }
-    });
-});
-

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/home.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/home.html	2015-01-14 14:02:44 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/home.html	2015-01-20 14:36:12 +0000
@@ -1,16 +1,7 @@
 <div id="leftBar"> 
 
-    <div style="margin-top:20px">
-
-
-        <img id="searchIcon" src="../images/search.png" style="cursor: pointer" title="{{ 'locate_organisation_unit_by_name' | translate}}">
-
-        <span id="searchSpan" style="width:100%;display:none;">
-            <input type="text" id="searchField" name="key" style="width:160px" />
-            <input type="button" value="Find" onclick="selection.findByName()" />
-        </span>
-    </div>
-
+    <d2-ou-search></d2-ou-search>
+    
     <div id="orgUnitTree">
         <ul>
         </ul>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties	2015-01-20 11:51:34 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties	2015-01-20 14:36:12 +0000
@@ -52,6 +52,7 @@
 last=Last
 go_to_dashboard=Go to dashboard
 go=Go
+find=Find
 edit=Edit
 edit_profile=Edit profile
 association=Manage associations
@@ -271,4 +272,5 @@
 get_from_map=Get from map
 capture=Capture
 point_and_click_for_coordinate=Point and click for coordinate
-value_must_be_between=Value must be between
\ No newline at end of file
+value_must_be_between=Value must be between
+locate_organisation_unit_by_name=Locate organisation unit by name
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html	2014-12-15 14:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html	2015-01-20 14:36:12 +0000
@@ -74,7 +74,6 @@
         
         <script src="../dhis-web-commons/ouwt/ouwt.js"></script>
         <script src="scripts/tracker-capture.js"></script>
-        <!--<script src="scripts/idxdb.js"></script>-->
 
         <script type="text/javascript" src="../dhis-web-commons/javascripts/angular/plugins/select2.js"></script>
         <script type="text/javascript" src="../dhis-web-commons/javascripts/angular/plugins/angularjs-nvd3-directives.min.js"></script>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2015-01-20 10:07:47 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2015-01-20 14:36:12 +0000
@@ -40,10 +40,6 @@
 /* Form
 /*----------------------------------------------------------------------------*/
 
-input[type="button"], input[type="submit"] {
-    width: 130px;
-}
-
 .fixed-text-width {
     width: 260px;
 }

=== 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 11:51:34 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/home.html	2015-01-20 14:36:12 +0000
@@ -34,9 +34,11 @@
             <li><a href ng-click="showHome()">{{'registration_and_data_entry' | translate}}</a></li>
             <li><a href ng-click="showReportTypes()">{{'reports' | translate}}</a></li>
         </ul>
-    </div>        
-    
-    <div id="orgUnitTree" style="margin-top:20px">
+    </div>    
+    
+    <d2-ou-search></d2-ou-search>
+    
+    <div id="orgUnitTree">
         <ul>
         </ul>
     </div>

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/angular/plugins/dhis2/directives.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/angular/plugins/dhis2/directives.js	2015-01-16 15:40:31 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/angular/plugins/dhis2/directives.js	2015-01-20 14:36:12 +0000
@@ -4,6 +4,36 @@
 
 var d2Directives = angular.module('d2Directives', [])
 
+
+.directive('d2OuSearch', function() {
+    
+    return {
+        restrict: 'E',
+        template: '<div style="margin-top:20px">\n\
+                    <img id="searchIcon" src="../images/search.png" style="cursor: pointer" title="{{ \'locate_organisation_unit_by_name\' | translate}}">\n\
+                    <span id="searchSpan" style="width:100%;display:none;">\n\
+                        <input type="text" id="searchField" name="key"/>\n\
+                        <input type="button" value="{{\'find\' | translate}}" onclick="selection.findByName()"/>\n\
+                    </span>\n\
+                  </div>',
+        link: function (scope, element, attrs) {
+            
+            $("#searchIcon").click(function() {
+                $("#searchSpan").toggle();
+                $("#searchField").focus();
+            });
+
+            $("#searchField").autocomplete({
+                source: "../dhis-web-commons/ouwt/getOrganisationUnitsByName.action",
+                select: function(event, ui) {
+                    $("#searchField").val(ui.item.value);
+                    selection.findByName();
+                }
+            });
+        }
+    };
+})
+
 .directive('inputValidator', function() {
     
     return {