diff options
author | Yorhel <git@yorhel.nl> | 2008-12-14 11:44:09 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2008-12-14 11:44:09 +0100 |
commit | d85da4dfaa971c5244bc26d52ca517d6190f0fdb (patch) | |
tree | 45fcba1e07ee0707e366f0cf502dcfbac84a9c4c /lib | |
parent | 930d2d4dd61bd93b47315eb8992bc745d0fa633a (diff) |
Fixed all XHTML validation bugs I could find
With two exceptions:
- Empty browse tables (/u1/list, /u3/hist, ..)
- Empty <tbody> on /v+/edit and /v/new
I'm not purist enough to work around those bugs. (well, maybe I'll fix the
empty browse table thing, as it's not really user friendly either)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VNDB/Handler/Discussions.pm | 18 | ||||
-rw-r--r-- | lib/VNDB/Handler/ULists.pm | 10 | ||||
-rw-r--r-- | lib/VNDB/Handler/VNBrowse.pm | 6 | ||||
-rw-r--r-- | lib/VNDB/Handler/VNPage.pm | 2 | ||||
-rw-r--r-- | lib/VNDB/Util/CommonHTML.pm | 18 | ||||
-rw-r--r-- | lib/VNDB/Util/FormHTML.pm | 4 |
6 files changed, 28 insertions, 30 deletions
diff --git a/lib/VNDB/Handler/Discussions.pm b/lib/VNDB/Handler/Discussions.pm index 6e5273d7..286e3ee5 100644 --- a/lib/VNDB/Handler/Discussions.pm +++ b/lib/VNDB/Handler/Discussions.pm @@ -299,15 +299,15 @@ sub tagbrowse { txt ':'; a href => "/$type$iid", $ititle; } - p class => 'center'; - if(!@$list) { - b 'No related threads found'; - br; br; - a href => "/t/$type$iid/new", 'Why not create one yourself?'; - } else { - a href => '/t/'.($iid ? $type.$iid : 'db').'/new', 'Start a new thread'; - } - end; + end; + p class => 'center'; + if(!@$list) { + b 'No related threads found'; + br; br; + a href => "/t/$type$iid/new", 'Why not create one yourself?'; + } else { + a href => '/t/'.($iid ? $type.$iid : 'db').'/new', 'Start a new thread'; + } end; end; diff --git a/lib/VNDB/Handler/ULists.pm b/lib/VNDB/Handler/ULists.pm index 0ef4c41c..5353dbc9 100644 --- a/lib/VNDB/Handler/ULists.pm +++ b/lib/VNDB/Handler/ULists.pm @@ -153,8 +153,7 @@ sub wishlist { td class => 'tc3', date $i->{added}, 'compact'; end; }, - footer => sub { - return if !$own; + $own ? (footer => sub { Tr; td colspan => 3; Select name => 'batchedit', id => 'batchedit'; @@ -167,7 +166,7 @@ sub wishlist { end; end; end; - }, + }) : (), ); end if $own; $self->htmlFooter; @@ -309,8 +308,7 @@ sub _vnlist_browse { } }, - footer => sub { - return if !$own; + $own ? (footer => sub { Tr; td class => 'tc1', colspan => 3; Select id => 'batchedit', name => 'batchedit'; @@ -328,7 +326,7 @@ sub _vnlist_browse { end; td class => 'tc2', colspan => 2, '* Obtained/finished/total'; end; - } + }) : (), ); end if $own; diff --git a/lib/VNDB/Handler/VNBrowse.pm b/lib/VNDB/Handler/VNBrowse.pm index c867b550..8af5791e 100644 --- a/lib/VNDB/Handler/VNBrowse.pm +++ b/lib/VNDB/Handler/VNBrowse.pm @@ -132,7 +132,7 @@ sub _filters { div id => 'advoptions', class => 'hidden'; h2; - lit 'Categories <p>(boolean and, selecting more gives less results. The categories are explained on <a href="/d1">this page</a>)</p>'; + lit 'Categories <b>(boolean and, selecting more gives less results. The categories are explained on <a href="/d1">this page</a>)</b>'; end; ul id => 'catselect'; for my $c (qw| e g t p h l s |) { @@ -147,7 +147,7 @@ sub _filters { end; h2; - lit 'Languages <p>(boolean or, selecting more gives more results)</p>'; + lit 'Languages <b>(boolean or, selecting more gives more results)</b>'; end; for(sort @{$self->dbLanguages}) { span; @@ -160,7 +160,7 @@ sub _filters { } h2; - lit 'Platforms <p>(boolean or, selecting more gives more results)</p>'; + lit 'Platforms <b>(boolean or, selecting more gives more results)</b>'; end; for(sort keys %{$self->{platforms}}) { next if $_ eq 'oth'; diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm index 57d30be6..ab90bc4e 100644 --- a/lib/VNDB/Handler/VNPage.pm +++ b/lib/VNDB/Handler/VNPage.pm @@ -67,7 +67,7 @@ sub page { img id => 'nsfw_hid', src => sprintf("%s/cv/%02d/%d.jpg", $self->{url_static}, $v->{image}%100, $v->{image}), alt => $v->{title}; p id => 'nsfw_show'; txt "This image has been flagged\nas Not Safe For Work.\n\n"; - a href => '#', id => 'nsfw_show', 'Show me anyway'; + a href => '#', 'Show me anyway'; txt "\n\n(This warning can be disabled in your account)"; end; } else { diff --git a/lib/VNDB/Util/CommonHTML.pm b/lib/VNDB/Util/CommonHTML.pm index 6f85f8bd..70fdfde3 100644 --- a/lib/VNDB/Util/CommonHTML.pm +++ b/lib/VNDB/Util/CommonHTML.pm @@ -179,10 +179,6 @@ sub htmlBrowse { end; end; - # rows - $opt{row}->($self, $_+1, $opt{items}[$_]) - for 0..$#{$opt{items}}; - # footer if($opt{footer}) { tfoot; @@ -190,6 +186,10 @@ sub htmlBrowse { end; } + # rows + $opt{row}->($self, $_+1, $opt{items}[$_]) + for 0..$#{$opt{items}}; + end; end; @@ -378,7 +378,7 @@ sub htmlItemMessage { p class => 'locked', 'Locked for editing' } elsif(!$self->authInfo->{id}) { p class => 'locked'; - lit 'You need to be <a href="/u/login">logged in</a> to edit this page</a>'; + lit 'You need to be <a href="/u/login">logged in</a> to edit this page'; end; } elsif(!$self->authCan('edit')) { p class => 'locked', "You're not allowed to edit this page"; @@ -401,6 +401,10 @@ sub htmlVoteStats { thead; Tr; td colspan => 2, 'Vote graph'; end; end; + tfoot; Tr; + td colspan => 2, sprintf '%d votes total, average %.2f%s', $count, $total/$count, + $type eq 'v' ? ' ('.$self->{votes}[sprintf '%.0f', $total/$count-1].')' : ''; + end; end; for (reverse 0..$#$stats) { Tr; td class => 'number', $_+1; @@ -410,10 +414,6 @@ sub htmlVoteStats { end; end; } - tfoot; Tr; - td colspan => 2, sprintf '%d votes total, average %.2f%s', $count, $total/$count, - $type eq 'v' ? ' ('.$self->{votes}[sprintf '%.0f', $total/$count-1].')' : ''; - end; end; end; my $recent = $self->dbVoteGet( diff --git a/lib/VNDB/Util/FormHTML.pm b/lib/VNDB/Util/FormHTML.pm index b6b7f57b..80b8c4f3 100644 --- a/lib/VNDB/Util/FormHTML.pm +++ b/lib/VNDB/Util/FormHTML.pm @@ -211,7 +211,7 @@ sub htmlForm { if(@subs > 2) { ul class => 'maintabs notfirst', id => 'jt_select'; for (0..$#subs/2) { - (my $short = lc $subs[$_*2]) =~ s/[^\w\d]+/_/; + (my $short = lc $subs[$_*2]) =~ s/[^\w\d]+/_/g; li class => 'left'; a href => "#$short", id => "jt_sel_$short", $subs[$_*2]; end; @@ -222,7 +222,7 @@ sub htmlForm { # form subs while(my($name, $parts) = (shift(@subs), shift(@subs))) { last if !$name || !$parts; - (my $short = lc $name) =~ s/[^\w\d]+/_/; + (my $short = lc $name) =~ s/[^\w\d]+/_/g; div class => 'mainbox', id => 'jt_box_'.$short; h1 $name; fieldset; |