summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/Func.pm10
-rw-r--r--lib/VNDB/Handler/Misc.pm3
-rw-r--r--lib/VNDB/Handler/Producers.pm2
-rw-r--r--lib/VNDB/Handler/Releases.pm8
-rw-r--r--lib/VNDB/Handler/ULists.pm4
-rw-r--r--lib/VNDB/Handler/VNBrowse.pm8
-rw-r--r--lib/VNDB/Handler/VNPage.pm14
7 files changed, 29 insertions, 20 deletions
diff --git a/lib/VNDB/Func.pm b/lib/VNDB/Func.pm
index 0fb0e6a1..37bec8be 100644
--- a/lib/VNDB/Func.pm
+++ b/lib/VNDB/Func.pm
@@ -6,7 +6,7 @@ use warnings;
use YAWF ':html';
use Exporter 'import';
use POSIX 'strftime';
-our @EXPORT = qw| shorten date datestr monthstr userstr bb2html gtintype liststat clearfloat |;
+our @EXPORT = qw| shorten date datestr monthstr userstr bb2html gtintype liststat clearfloat cssicon |;
# I would've done this as a #define if this was C...
@@ -193,5 +193,13 @@ sub clearfloat {
}
+# Draws a CSS icon, arguments: class, title
+sub cssicon {
+ acronym class => "icons $_[0]", title => $_[1];
+ lit ' ';
+ end;
+}
+
+
1;
diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm
index f2e4cdcb..29abb14b 100644
--- a/lib/VNDB/Handler/Misc.pm
+++ b/lib/VNDB/Handler/Misc.pm
@@ -51,8 +51,7 @@ sub homepage {
end;
my $scr = $self->dbScreenshotRandom;
- p class => 'center';
- br;
+ p class => 'screenshots';
for (@$scr) {
a href => "/v$_->{vid}", title => $_->{title};
img src => sprintf("%s/st/%02d/%d.jpg", $self->{url_static}, $_->{scr}%100, $_->{scr}), alt => $_->{title};
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm
index d28a4746..0efd2f47 100644
--- a/lib/VNDB/Handler/Producers.pm
+++ b/lib/VNDB/Handler/Producers.pm
@@ -192,7 +192,7 @@ sub list {
ul;
for ($perlist*$c..($perlist*($c+1))-1) {
li;
- acronym class => 'icons lang '.$list->[$_]{lang}, title => $self->{languages}{$list->[$_]{lang}}, ' ';
+ cssicon 'lang '.$list->[$_]{lang}, $self->{languages}{$list->[$_]{lang}};
a href => "/p$list->[$_]{id}", $list->[$_]{name};
end;
}
diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm
index 14749169..ff28c64b 100644
--- a/lib/VNDB/Handler/Releases.pm
+++ b/lib/VNDB/Handler/Releases.pm
@@ -102,7 +102,7 @@ sub _infotable {
td 'Type';
td;
my $type = $self->{release_types}[$r->{type}];
- acronym class => 'icons '.lc(substr $type, 0, 3), title => $type, ' ';
+ cssicon lc(substr $type, 0, 3), $type;
txt ' '.$type;
end;
end;
@@ -110,7 +110,7 @@ sub _infotable {
Tr ++$i % 2 ? (class => 'odd') : ();
td 'Language';
td;
- acronym class => "icons lang $r->{language}", title => $self->{languages}{$r->{language}}, ' ';
+ cssicon "lang $r->{language}", $self->{languages}{$r->{language}};
txt ' '.$self->{languages}{$r->{language}};
end;
end;
@@ -120,7 +120,7 @@ sub _infotable {
td 'Platform'.($#{$r->{platforms}} ? 's' : '');
td;
for(@{$r->{platforms}}) {
- acronym class => "icons $_", title => $self->{platforms}{$_}, ' ';
+ cssicon $_, $self->{platforms}{$_};
txt ' '.$self->{platforms}{$_};
br if $_ ne $r->{platforms}[$#{$r->{platforms}}];
}
@@ -352,7 +352,7 @@ sub _form {
input type => 'checkbox', name => 'platforms', value => $p, id => $p,
$frm->{platforms} && grep($_ eq $p, @{$frm->{platforms}}) ? (checked => 'checked') : ();
label for => $p;
- acronym class => "icons $p", title => $self->{platforms}{$p}, ' ';
+ cssicon $p, $self->{platforms}{$p};
txt ' '.$self->{platforms}{$p};
end;
end;
diff --git a/lib/VNDB/Handler/ULists.pm b/lib/VNDB/Handler/ULists.pm
index 6c1c338f..639532c9 100644
--- a/lib/VNDB/Handler/ULists.pm
+++ b/lib/VNDB/Handler/ULists.pm
@@ -296,8 +296,8 @@ sub _vnlist_browse {
lit datestr $_->{released};
end;
td class => 'tc2';
- acronym class => "icons lang $_->{language}", title => $self->{languages}{$_->{language}}, ' ';
- acronym class => 'icons '.substr(lc $self->{release_types}[$_->{type}], 0, 3), title => $self->{release_types}[$_->{type}].' release', ' ';
+ cssicon "lang $_->{language}", $self->{languages}{$_->{language}};
+ cssicon substr(lc $self->{release_types}[$_->{type}], 0, 3), $self->{release_types}[$_->{type}].' release';
end;
td class => 'tc3';
a href => "/r$_->{rid}", title => $_->{original}||$_->{title}, shorten $_->{title}, 50;
diff --git a/lib/VNDB/Handler/VNBrowse.pm b/lib/VNDB/Handler/VNBrowse.pm
index dd79990e..69ee30a5 100644
--- a/lib/VNDB/Handler/VNBrowse.pm
+++ b/lib/VNDB/Handler/VNBrowse.pm
@@ -93,11 +93,11 @@ sub list {
a href => '/v'.$l->{id}, title => $l->{original}||$l->{title}, shorten $l->{title}, 100;
end;
td class => 'tc2';
- $_ ne 'oth' && acronym class => "icons $_", title => $self->{platforms}{$_}, ' '
+ $_ ne 'oth' && cssicon $_, $self->{platforms}{$_}
for (sort split /\//, $l->{c_platforms});
end;
td class => 'tc3';
- acronym class => "icons lang $_", title => $self->{languages}{$_}, ' '
+ cssicon "lang $_", $self->{languages}{$_}
for (reverse sort split /\//, $l->{c_languages});
end;
td class => 'tc4';
@@ -152,7 +152,7 @@ sub _filters {
span;
input type => 'checkbox', id => "lang_$_";
label for => "lang_$_";
- acronym class => "icons lang $_", title => $self->{languages}{$_}, ' ';
+ cssicon "lang $_", $self->{languages}{$_};
txt $self->{languages}{$_};
end;
end;
@@ -166,7 +166,7 @@ sub _filters {
span;
input type => 'checkbox', id => "plat_$_";
label for => "plat_$_";
- acronym class => "icons $_", title => $self->{platforms}{$_}, ' ';
+ cssicon $_, $self->{platforms}{$_};
txt $self->{platforms}{$_};
end;
end;
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm
index 57773839..57d30be6 100644
--- a/lib/VNDB/Handler/VNPage.pm
+++ b/lib/VNDB/Handler/VNPage.pm
@@ -237,7 +237,7 @@ sub _producers {
my %p = map { $_->{id} => $_ } map @{$_->{producers}}, grep $_->{language} eq $l, @$r;
my @p = values %p;
next if !@p;
- acronym class => "icons lang $l", title => $self->{languages}{$l}, ' ';
+ cssicon "lang $l", $self->{languages}{$l};
for (@p) {
a href => "/p$_->{id}", title => $_->{original}||$_->{name}, shorten $_->{name}, 30;
txt ' & ' if $_ != $p[$#p];
@@ -378,7 +378,7 @@ sub _releases {
for my $l (@lang) {
Tr class => 'lang';
td colspan => 6;
- acronym class => 'icons lang '.$l, title => $self->{languages}{$l}, ' ';
+ cssicon "lang $l", $self->{languages}{$l};
txt $self->{languages}{$l};
end;
end;
@@ -389,9 +389,9 @@ sub _releases {
td class => 'tc3';
for (sort @{$rel->{platforms}}) {
next if $_ eq 'oth';
- acronym class => "icons $_", title => $self->{platforms}{$_}, ' ';
+ cssicon $_, $self->{platforms}{$_};
}
- acronym class => 'icons '.lc(substr($self->{release_types}[$rel->{type}],0,3)), title => $self->{release_types}[$rel->{type}], ' ';
+ cssicon lc(substr($self->{release_types}[$rel->{type}],0,3)), $self->{release_types}[$rel->{type}];
end;
td class => 'tc4';
a href => "/r$rel->{id}", title => $rel->{original}||$rel->{title}, $rel->{title};
@@ -407,7 +407,9 @@ sub _releases {
end;
td class => 'tc6';
if($rel->{website}) {
- a href => $rel->{website}, rel => 'nofollow', class => 'icons ext', title => 'WWW', ' ';
+ a href => $rel->{website}, rel => 'nofollow';
+ cssicon 'ext', 'External link';
+ end;
} else {
txt ' ';
}
@@ -441,7 +443,7 @@ sub _screenshots {
next if !@scr;
Tr class => 'rel';
td colspan => 5;
- acronym class => 'icons lang '.$rel->{language}, title => $self->{languages}{$rel->{language}}, ' ';
+ cssicon 'lang '.$rel->{language}, $self->{languages}{$rel->{language}};
txt $rel->{title};
end;
end;