summaryrefslogtreecommitdiff
path: root/lib/VNDB
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-01-08 10:13:20 +0100
committerYorhel <git@yorhel.nl>2020-01-08 10:14:29 +0100
commit63f5fc988b86e543fa4d161d10786ce8d9ddbaeb (patch)
tree9cc41839df7529f6456b7d12e6c10dd1d335b4fe /lib/VNDB
parent788ff22a82cd16c5bc31f70a25118a99372bcb5f (diff)
Slightly less ugly tagscore display
And get rid of the spoiler warning in the tag link browser. There are lots of pages that would need it if we applied it consistently.
Diffstat (limited to 'lib/VNDB')
-rw-r--r--lib/VNDB/Func.pm30
-rw-r--r--lib/VNDB/Handler/Tags.pm2
-rw-r--r--lib/VNDB/Util/BrowseHTML.pm2
3 files changed, 3 insertions, 31 deletions
diff --git a/lib/VNDB/Func.pm b/lib/VNDB/Func.pm
index 96a17106..94d1281e 100644
--- a/lib/VNDB/Func.pm
+++ b/lib/VNDB/Func.pm
@@ -11,7 +11,7 @@ use VNDBUtil;
use VNDB::Types;
use VNDB::BBCode;
our @EXPORT = (@VNDBUtil::EXPORT, 'bb2html', 'bb2text', qw|
- clearfloat cssicon tagscore minage fil_parse fil_serialize parenttags
+ clearfloat cssicon minage fil_parse fil_serialize parenttags
childtags charspoil imgpath imgurl
fmtvote fmtmedia fmtvnlen fmtage fmtdatestr fmtdate fmtrating fmtspoil
lang_attr
@@ -41,34 +41,6 @@ sub cssicon {
}
-# Tag score in html tags, argument: score, users
-sub tagscore {
- my $s = shift;
- div class => 'taglvl', style => sprintf('width: %.0fpx', ($s-floor($s))*10), ' ' if $s < 0 && $s-floor($s) > 0;
- for(-3..3) {
- div(class => "taglvl taglvl0", sprintf '%.1f', $s), next if !$_;
- if($_ < 0) {
- if($s > 0 || floor($s) > $_) {
- div class => "taglvl taglvl$_", ' ';
- } elsif(floor($s) != $_) {
- div class => "taglvl taglvl$_ taglvlsel", ' ';
- } else {
- div class => "taglvl taglvl$_ taglvlsel", style => sprintf('width: %.0fpx', 10-($s-$_)*10), ' ';
- }
- } else {
- if($s < 0 || ceil($s) < $_) {
- div class => "taglvl taglvl$_", ' ';
- } elsif(ceil($s) != $_) {
- div class => "taglvl taglvl$_ taglvlsel", ' ';
- } else {
- div class => "taglvl taglvl$_ taglvlsel", style => sprintf('width: %.0fpx', 10-($_-$s)*10), ' ';
- }
- }
- }
- div class => 'taglvl', style => sprintf('width: %.0fpx', (ceil($s)-$s)*10), ' ' if $s > 0 && ceil($s)-$s > 0;
-}
-
-
sub minage {
my($a, $ex) = @_;
$a = $AGE_RATING{$a};
diff --git a/lib/VNDB/Handler/Tags.pm b/lib/VNDB/Handler/Tags.pm
index 9e771997..5acc948f 100644
--- a/lib/VNDB/Handler/Tags.pm
+++ b/lib/VNDB/Handler/Tags.pm
@@ -525,7 +525,7 @@ sub _tagmod_list {
}
td class => 'tc_myspoil', defined $m->{spoiler} ? $m->{spoiler} : -1;
td class => 'tc_allvote';
- tagscore $t->{rating};
+ VNWeb::Tags::Lib::tagscore_($t->{rating});
i $t->{overruled} ? (class => 'grayedout') : (), " ($t->{cnt})";
b class => 'standout', style => 'font-weight: bold', title => 'Tag overruled. All votes other than that of the moderator who overruled it will be ignored.', ' !' if $t->{overruled};
end;
diff --git a/lib/VNDB/Util/BrowseHTML.pm b/lib/VNDB/Util/BrowseHTML.pm
index 1a7e3878..29d131c5 100644
--- a/lib/VNDB/Util/BrowseHTML.pm
+++ b/lib/VNDB/Util/BrowseHTML.pm
@@ -151,7 +151,7 @@ sub htmlBrowseVN {
Tr;
if($tagscore) {
td class => 'tc_s';
- tagscore $l->{tagscore}, 0;
+ VNWeb::Tags::Lib::tagscore_($l->{tagscore});
end;
}
td class => $tagscore ? 'tc_t' : 'tc1';