diff options
author | ot <ot@localhost> | 2005-07-27 09:23:51 +0000 |
---|---|---|
committer | ot <ot@localhost> | 2005-07-27 09:23:51 +0000 |
commit | 93eb37c30383828c4bfd436e2deea40f117405d4 (patch) | |
tree | a75bae5e95edb579c9024e720059746a68f0f188 | |
parent | a9fc20835e40b41a42233e9ce4ffe7574ea831dd (diff) | |
download | markup-validator-93eb37c30383828c4bfd436e2deea40f117405d4.zip markup-validator-93eb37c30383828c4bfd436e2deea40f117405d4.tar.gz markup-validator-93eb37c30383828c4bfd436e2deea40f117405d4.tar.bz2 |
Bringing back number of errors to the results (not counting warnings and other messages),
and adding info on outcome (pass/fail) at very top of results page.
See also:
http://www.w3.org/Bugs/Public/show_bug.cgi?id=1810
http://www.w3.org/Bugs/Public/show_bug.cgi?id=1816
-rw-r--r-- | htdocs/results.css | 13 | ||||
-rwxr-xr-x | httpd/cgi-bin/check | 22 | ||||
-rw-r--r-- | share/templates/en_US/table.tmpl | 15 |
3 files changed, 43 insertions, 7 deletions
diff --git a/htdocs/results.css b/htdocs/results.css index c886605..ebb5a18 100644 --- a/htdocs/results.css +++ b/htdocs/results.css @@ -1,5 +1,5 @@ /* style sheet for the validator's results page */ -/* $Id: results.css,v 1.31 2005-07-21 01:32:21 ot Exp $ */ +/* $Id: results.css,v 1.32 2005-07-27 09:23:51 ot Exp $ */ .input { color: black; @@ -251,6 +251,17 @@ h2.valid, h2.invalid, h2.tentative_valid { color: white; } +td.valid { + background-color: white; + color: #55B05A; +} + +td.invalid +{ + color: #D23D24; + background-color: white; +} + img.inline-badge { float: left; } diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index 26ed6af..d6b09df 100755 --- a/httpd/cgi-bin/check +++ b/httpd/cgi-bin/check @@ -9,7 +9,7 @@ # This source code is available under the license at: # http://www.w3.org/Consortium/Legal/copyright-software # -# $Id: check,v 1.430 2005-07-27 04:32:01 ot Exp $ +# $Id: check,v 1.431 2005-07-27 09:23:51 ot Exp $ # # Disable buffering on STDOUT! @@ -204,7 +204,7 @@ Directory not readable (permission denied): @_r # # Strings - $VERSION = q$Revision: 1.430 $; + $VERSION = q$Revision: 1.431 $; $VERSION =~ s/Revision: ([\d\.]+) /$1/; # @@ -806,7 +806,15 @@ if ($File->{Opt}->{Output} eq 'xml') { $T->param(has_errors => 1); } $T->param(valid_errors_num => $num_errors); - $T->param(file_errors => &report_errors($File)); + my ($number_of_errors, $reported_errors) = &report_errors($File); + if ($number_of_errors > 1) { + $number_of_errors = "$number_of_errors errors" + } + else { + $number_of_errors = "$number_of_errors error" + } + $T->param(file_errors => $reported_errors); + $T->param(number_of_errors => $number_of_errors); if ($File->{'Is Valid'}) { $T->param(VALID => TRUE); $T->param(valid_status => 'Valid'); @@ -1423,6 +1431,7 @@ sub parse_errors ($$) { sub report_errors ($) { my $File = shift; my $Errors = []; + my $number_of_errors = 0; # Hash to keep track of how many of each error is reported. my %Msgs; # Used to generate a UID for explanations. @@ -1472,18 +1481,19 @@ sub report_errors ($) { { $err->{class} = 'msg_err'; $err->{err_type_err} = 1; + $number_of_errors += 1; } - elsif ($err->{type} eq 'W') + elsif (($err->{type} eq 'W') or ($err->{type} eq 'X') ) { $err->{class} = 'msg_warn'; $err->{err_type_warn} = 1; } - # TODO other classes for "W", "E" etc? + # TODO other classes for "X" etc? FIXME find all types of message. push @{$Errors}, $err; } } - return $Errors; + return $number_of_errors, $Errors; } # diff --git a/share/templates/en_US/table.tmpl b/share/templates/en_US/table.tmpl index 44cf217..a47df9d 100644 --- a/share/templates/en_US/table.tmpl +++ b/share/templates/en_US/table.tmpl @@ -2,6 +2,21 @@ <form id="form" method="get" action="check"> <table class="header"> <tr> + <th>Result:</th> + <TMPL_IF NAME="VALID"> + <td colspan="2" class="valid"> + <TMPL_IF NAME="is_tentative"> + Tentatively passed validation + <TMPL_ELSE> + Passed validation + </TMPL_IF> + <TMPL_ELSE> + <td colspan="2" class="invalid"> + Failed validation, <TMPL_VAR NAME="number_of_errors" ESCAPE="HTML"> + </TMPL_IF> + </td> + </tr> + <tr> <TMPL_IF NAME="is_upload"> <th>File:</th><td colspan="2"><TMPL_VAR NAME="file_uri" ESCAPE="HTML"></td> <TMPL_ELSE> |