summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-01-22 18:56:49 +0100
committerYorhel <git@yorhel.nl>2010-01-23 09:42:28 +0100
commit58344d48b21dde0e513e6ef351d2c1644f500056 (patch)
tree2d645305bc59dc403d29b59cec63e0250a7a068e /lib
parent958e1d263b0a7448ca97444c93655f9d5dc8159a (diff)
Handler::VNPage: Centered the thumbnails in the screenshot viewer
And greatly simplified the HTML of the screenshot viewer and fixed a HTML bug (colspan when it wasn't needed) in the process.
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/Handler/VNPage.pm42
1 files changed, 18 insertions, 24 deletions
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm
index 6c2e9b79..21655e37 100644
--- a/lib/VNDB/Handler/VNPage.pm
+++ b/lib/VNDB/Handler/VNPage.pm
@@ -455,30 +455,24 @@ sub _screenshots {
}
h1 mt '_vnpage_scr';
- table;
- for my $rel (@$r) {
- my @scr = grep $_->{rid} && $rel->{id} == $_->{rid}, @{$v->{screenshots}};
- next if !@scr;
- Tr class => 'rel';
- td colspan => 5;
- cssicon "lang $_", mt "_lang_$_" for (@{$rel->{languages}});
- txt $rel->{title};
- end;
- end;
- Tr;
- td class => 'scr';
- for (@scr) {
- div $_->{nsfw} ? (class => 'nsfw'.(!$self->authInfo->{show_nsfw} ? ' hidden' : '')) : ();
- a href => sprintf('%s/sf/%02d/%d.jpg', $self->{url_static}, $_->{id}%100, $_->{id}),
- rel => "iv:$_->{width}x$_->{height}:scr", $_->{nsfw} && !$self->authInfo->{show_nsfw} ? (class => 'hidden') : ();
- img src => sprintf('%s/st/%02d/%d.jpg', $self->{url_static}, $_->{id}%100, $_->{id}), alt => mt '_vnpage_scr_num', $_->{id};
- end;
- end;
- }
- end;
- end;
- }
- end;
+
+ for my $rel (@$r) {
+ my @scr = grep $_->{rid} && $rel->{id} == $_->{rid}, @{$v->{screenshots}};
+ next if !@scr;
+ p class => 'rel';
+ cssicon "lang $_", mt "_lang_$_" for (@{$rel->{languages}});
+ a href => "/r$rel->{id}", $rel->{title};
+ end;
+ div class => 'scr';
+ for (@scr) {
+ a href => sprintf('%s/sf/%02d/%d.jpg', $self->{url_static}, $_->{id}%100, $_->{id}),
+ class => sprintf('scrlnk%s%s', $_->{nsfw} ? ' nsfw':'', $_->{nsfw}&&!$self->authInfo->{show_nsfw}?' hidden':''),
+ rel => "iv:$_->{width}x$_->{height}:scr";
+ img src => sprintf('%s/st/%02d/%d.jpg', $self->{url_static}, $_->{id}%100, $_->{id}), alt => mt '_vnpage_scr_num', $_->{id};
+ end;
+ }
+ end;
+ }
end;
}