summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-09-03 20:44:26 +0200
committerYorhel <git@yorhel.nl>2020-09-03 20:44:28 +0200
commitc2f3b3a746abdc4224b30d88c85309b8a62a3c0f (patch)
tree52a26c6455774aaf382f9ef21daf382067208203
parent33c940c922d25a6fad9c2707eda41e022fd73ad5 (diff)
User::Page: Remove review approval rating
Pointless stat, if we're hiding review votes then this should go too.
-rw-r--r--lib/VNWeb/User/Page.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/VNWeb/User/Page.pm b/lib/VNWeb/User/Page.pm
index b41be78e..f225bd76 100644
--- a/lib/VNWeb/User/Page.pm
+++ b/lib/VNWeb/User/Page.pm
@@ -66,11 +66,10 @@ sub _info_table_ {
};
};
tr_ sub {
- my $stats = tuwf->dbRowi('SELECT COUNT(*) AS cnt, SUM(c_up) AS up, SUM(c_down) AS down FROM reviews WHERE uid =', \$u->{id});
+ my $cnt = tuwf->dbVali('SELECT COUNT(*) FROM reviews WHERE uid =', \$u->{id});
td_ 'Reviews';
- td_ !$stats->{cnt} ? '-' : sub {
- txt_ sprintf '%d review%s', $stats->{cnt}, $stats->{cnt} == 1 ? '' : 's';
- txt_ !$stats->{up} && !$stats->{down} ? '. ' : sprintf ', %.0f%% approval. ', $stats->{up}/($stats->{up}+$stats->{down})*100;
+ td_ !$cnt ? '-' : sub {
+ txt_ sprintf '%d review%s. ', $cnt, $cnt == 1 ? '' : 's';
a_ href => "/w?u=$u->{id}", 'Browse reviews ยป';
};
};