dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19393
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8436: Validation in data entry, using icons to emphasize the outcome
------------------------------------------------------------
revno: 8436
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-10-08 20:25:56 +0200
message:
Validation in data entry, using icons to emphasize the outcome
added:
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/success_small.png
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/warning_small.png
modified:
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/warning.png
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/validationResult.vm
--
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-commons-resources/src/main/webapp/images/success_small.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/success_small.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/success_small.png 2012-10-08 18:25:56 +0000 differ
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/warning.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/warning.png 2012-03-03 14:58:08 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/warning.png 2012-10-08 18:25:56 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/warning_small.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/warning_small.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/warning_small.png 2012-10-08 18:25:56 +0000 differ
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2012-09-27 03:57:57 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2012-10-08 18:25:56 +0000
@@ -1223,15 +1223,17 @@
// Validation
// -----------------------------------------------------------------------------
-function displayValidationDialog( data )
+function displayValidationDialog( data, height )
{
+ height = isDefined( height ) ? height : 500;
+
$( '#validationDiv' ).html( data );
$( '#validationDiv' ).dialog( {
- modal : true,
- title : 'Validation',
- width : 800,
- height : 400
+ modal: true,
+ title: 'Validation',
+ width: 870,
+ height: height
} );
}
@@ -1243,17 +1245,17 @@
if ( !compulsoryCombinationsValid )
{
- var html = '<h3>' + i18n_validation_result + '</h3>' +
+ var html = '<h3>' + i18n_validation_result + ' <img src="../images/warning_small.png"></h3>' +
'<p class="bold">' + i18n_all_values_for_data_element_must_be_filled + '</p>';
- displayValidationDialog( html );
+ displayValidationDialog( html, 300 );
return false;
}
// Check for validation rules and whether complete is only allowed if valid
- var successHtml = '<h3>' + i18n_validation_result + '</h3>' +
+ var successHtml = '<h3>' + i18n_validation_result + ' <img src="../images/success_small.png"></h3>' +
'<p class="bold">' + i18n_successful_validation + '</p>';
var validCompleteOnly = dataSets[currentDataSetId].validCompleteOnly;
@@ -1277,11 +1279,11 @@
if ( hasViolations )
{
- displayValidationDialog( response );
+ displayValidationDialog( response, 500 );
}
else if ( !ignoreSuccessfulValidation )
{
- displayValidationDialog( successHtml );
+ displayValidationDialog( successHtml, 200 );
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/validationResult.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/validationResult.vm 2012-09-19 16:14:28 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/validationResult.vm 2012-10-08 18:25:56 +0000
@@ -1,10 +1,6 @@
-<h3>$i18n.getString( "validation_result" )</h3>
+<h3>$i18n.getString( "validation_result" ) <img src="../images/warning_small.png"></h3>
-#if( $results.size() == 0 && $dataValues.size() == 0 )
- <p class="bold">$i18n.getString( "successful_validation" )</p>
-#else
- <p class="bold">$i18n.getString( "unsuccessful_validation" )</p>
-#end
+<p class="bold">$i18n.getString( "unsuccessful_validation" )</p>
#if( $results.size() > 0)
<p class="bold">$i18n.getString( "the_following_values_violate_rules" )</p>