summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Users.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2012-01-25 13:59:43 +0100
committerYorhel <git@yorhel.nl>2012-01-25 13:59:43 +0100
commit6f33c4786786978ee785bc3e5020cef5f66254ef (patch)
tree6f6de09886a4baeacbae9e5e8982e4415b881dc7 /lib/VNDB/Handler/Users.pm
parent616ddb08bf4f10560229bee326eb89ce1bef7488 (diff)
Do most of the table striping in CSS
Using CSS3 selectors. This is a more elegant approach, and since browser support for CSS3 selectors isn't as crap as it used to be I can finally make use of them.
Diffstat (limited to 'lib/VNDB/Handler/Users.pm')
-rw-r--r--lib/VNDB/Handler/Users.pm23
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/VNDB/Handler/Users.pm b/lib/VNDB/Handler/Users.pm
index cc42f4d0..f8aa0e9d 100644
--- a/lib/VNDB/Handler/Users.pm
+++ b/lib/VNDB/Handler/Users.pm
@@ -40,10 +40,9 @@ sub userpage {
div class => 'mainbox userpage';
h1 $title;
- table;
- my $i = 0;
+ table class => 'stripe';
- Tr ++$i % 2 ? (class => 'odd') : ();
+ Tr;
td class => 'key', mt '_userpage_username';
td;
txt ucfirst($u->{username}).' (';
@@ -52,12 +51,12 @@ sub userpage {
end;
end;
- Tr ++$i % 2 ? (class => 'odd') : ();
+ Tr;
td mt '_userpage_registered';
td $self->{l10n}->date($u->{registered});
end;
- Tr ++$i % 2 ? (class => 'odd') : ();
+ Tr;
td mt '_userpage_edits';
td;
if($u->{c_changes}) {
@@ -68,7 +67,7 @@ sub userpage {
end;
end;
- Tr ++$i % 2 ? (class => 'odd') : ();
+ Tr;
td mt '_userpage_votes';
td;
if($u->{hide_list}) {
@@ -86,7 +85,7 @@ sub userpage {
end;
end;
- Tr ++$i % 2 ? (class => 'odd') : ();
+ Tr;
td mt '_userpage_tags';
td;
if(!$u->{c_tags}) {
@@ -99,13 +98,13 @@ sub userpage {
end;
end;
- Tr ++$i % 2 ? (class => 'odd') : ();
+ Tr;
td mt '_userpage_list';
td $u->{hide_list} ? mt('_userpage_hidden') :
mt('_userpage_list_item', $u->{releasecount}, $u->{vncount});
end;
- Tr ++$i % 2 ? (class => 'odd') : ();
+ Tr;
td mt '_userpage_forum';
td;
lit mt '_userpage_forum_item',$u->{postcount}, $u->{threadcount};
@@ -458,7 +457,7 @@ sub posts {
],
row => sub {
my($s, $n, $l) = @_;
- Tr $n % 2 ? (class => 'odd') : ();
+ Tr;
td class => 'tc1'; a href => "/t$l->{tid}.$l->{num}", 't'.$l->{tid}; end;
td class => 'tc2'; a href => "/t$l->{tid}.$l->{num}", '.'.$l->{num}; end;
td class => 'tc3', $self->{l10n}->date($l->{date});
@@ -566,7 +565,7 @@ sub list {
],
row => sub {
my($s, $n, $l) = @_;
- Tr $n % 2 ? (class => 'odd') : ();
+ Tr;
td class => 'tc1';
a href => '/u'.$l->{id}, $l->{username};
end;
@@ -666,7 +665,7 @@ sub notifies {
],
row => sub {
my($s, $n, $l) = @_;
- Tr class => join ' ', $n%2?'odd':'', $l->{read}?'':'unread';
+ Tr class => $l->{read}?():(class => 'unread');
td class => 'tc1';
input type => 'checkbox', name => 'notifysel', value => "$l->{id}";
end;