← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15828: some validation on lat and long capturing, also minor style fix in custom forms

 

------------------------------------------------------------
revno: 15828
committer: Abyot Asalefew Gizaw abyota@xxxxxxxxx
branch nick: dhis2
timestamp: Tue 2014-06-24 14:23:55 +0200
message:
  some validation on lat and long capturing, also minor style fix in custom forms
modified:
  dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/services.js
  dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/styles/style.css
  dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/customForm.html
  dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/defaultForm.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-event-capture/src/main/webapp/dhis-web-event-capture/scripts/services.js'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/services.js	2014-06-22 07:04:04 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/services.js	2014-06-24 12:23:55 +0000
@@ -231,7 +231,7 @@
                             newInputField = '<input type="text" name="'+ deId +'"' + style + 'ng-model="currentEvent.' + deId + '"' +
                                             'ng-required="programStageDataElements.' + deId + '.compulsory"' +
                                             'typeahead="option for option in programStageDataElements.'+deId+'.dataElement.optionSet.options | filter:$viewValue | limitTo:20"' +
-                                            'typeahead-open-on-focus ng-required="programStageDataElements.'+deId+'.compulsory" name="foo" style="width:99%;">';
+                                            'typeahead-open-on-focus ng-required="programStageDataElements.'+deId+'.compulsory" name="foo">';
                         }
                         if(programStageDataElements[deId].dataElement.type == "bool"){
                             newInputField = '<select name="'+ deId +'"' + style + 'ng-model="currentEvent.' + deId + '"' +

=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/styles/style.css	2014-06-13 06:12:21 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/styles/style.css	2014-06-24 12:23:55 +0000
@@ -439,9 +439,9 @@
     display: none;
     float: left;
     min-width: 160px;
-    padding: 5px 0;
+    padding: 4px 1px;
     margin: 2px 0 0;
-    font-size: 14px;
+    font-size: 9pt;
     list-style: none;
     background-color: #fff;
     border: 1px solid #ccc;

=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/customForm.html'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/customForm.html	2014-06-22 07:04:04 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/customForm.html	2014-06-24 12:23:55 +0000
@@ -22,10 +22,12 @@
         <td>
             <input type="number"
                    ng-model="currentEvent.coordinate.latitude"                                                                
-                   name="latitude" 
+                   name="latitude"
+                   min="-90"
+                   max="90"
                    ng-required="false"
                    style="width:99%;"/>
-            <span ng-show="outerForm.submitted && outerForm.latitude.$invalid" class="required">{{'number_required'| translate}}</span>
+            <span ng-show="outerForm.submitted && outerForm.latitude.$invalid" class="required">{{'number_required'| translate}} [-90 ... 90]</span>
         </td>                                            
     </tr>
     <tr ng-if="selectedProgramStage.captureCoordinates">
@@ -36,9 +38,11 @@
             <input type="number"
                    ng-model="currentEvent.coordinate.longitude"                                                                
                    name="longitude" 
+                   min="-180"
+                   max="180"
                    ng-required="false"
                    style="width:99%;"/>
-            <span ng-show="outerForm.submitted && outerForm.longitude.$invalid" class="required">{{'number_required'| translate}}</span>
+            <span ng-show="outerForm.submitted && outerForm.longitude.$invalid" class="required">{{'number_required'| translate}}[-180 ... 180]</span>
         </td>                                            
     </tr>
 </table>                            

=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/defaultForm.html'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/defaultForm.html	2014-06-22 07:04:04 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/defaultForm.html	2014-06-24 12:23:55 +0000
@@ -33,10 +33,12 @@
             <td>
                 <input type="number"
                        ng-model="currentEvent.coordinate.latitude"                                                                
-                       name="latitude" 
+                       name="latitude"
+                       min="-90"
+                       max="90"
                        ng-required="false"
                        style="width:99%;"/>
-                <span ng-show="outerForm.submitted && outerForm.latitude.$invalid" class="required">{{'number_required'| translate}}</span>
+                <span ng-show="outerForm.submitted && outerForm.latitude.$invalid" class="required">{{'number_required'| translate}} [-90 ... 90]</span>
             </td>                                            
         </tr>
         <tr ng-if="selectedProgramStage.captureCoordinates">
@@ -47,9 +49,11 @@
                 <input type="number"
                        ng-model="currentEvent.coordinate.longitude"                                                                
                        name="longitude" 
+                       min="-180"
+                       max="180"
                        ng-required="false"
                        style="width:99%;"/>
-                <span ng-show="outerForm.submitted && outerForm.longitude.$invalid" class="required">{{'number_required'| translate}}</span>
+                <span ng-show="outerForm.submitted && outerForm.longitude.$invalid" class="required">{{'number_required'| translate}}[-180 ... 180]</span>
             </td>                                            
         </tr>
         <tr ng-repeat="eventGridColumn in eventGridColumns">