summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-10-12 21:35:49 +0200
committerYorhel <git@yorhel.nl>2019-10-12 21:35:49 +0200
commit8fdbf6bd1875d63582dca31ad9640924281253bc (patch)
treec1f2690ad31bbc76a141a7955989df3eaa0cc2ef /lib
parent8c9a5a4bdfa111b149ea58f36db7720f62a2d379 (diff)
Revert username capitalization in main menu and user page
Diffstat (limited to 'lib')
-rw-r--r--lib/VNWeb/HTML.pm7
-rw-r--r--lib/VNWeb/User/Page.pm2
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/VNWeb/HTML.pm b/lib/VNWeb/HTML.pm
index ad5a9076..f61fc16c 100644
--- a/lib/VNWeb/HTML.pm
+++ b/lib/VNWeb/HTML.pm
@@ -57,10 +57,11 @@ sub join_($&@) {
# Display a user link, the given object must have the columns as fetched using DB::sql_user().
-# Args: $object, $prefix
+# Args: $object, $prefix, $capital
sub user_ {
my $obj = shift;
my $prefix = shift||'user_';
+ my $capital = shift;
my sub f($) { $obj->{"${prefix}$_[0]"} }
return lit_ '[deleted]' if !f 'id';
@@ -68,7 +69,7 @@ sub user_ {
my $uniname = f 'uniname_can' && f 'uniname';
a_ href => '/u'.f('id'),
$fancy && $uniname ? (title => f('name'), $uniname) :
- (!$fancy && $uniname ? (title => $uniname) : (), f 'name');
+ (!$fancy && $uniname ? (title => $uniname) : (), $capital ? ucfirst f 'name' : f 'name');
txt_ '⭐' if $fancy && f 'support_can' && f 'support_enabled';
}
@@ -190,7 +191,7 @@ sub _menu_ {
div_ class => 'menubox', sub {
my $uid = sprintf '/u%d', auth->uid;
my $nc = auth && tuwf->dbVali('SELECT count(*) FROM notifications WHERE uid =', \auth->uid, 'AND read IS NULL');
- h2_ sub { user_ auth->user };
+ h2_ sub { user_ auth->user, 'user_', 1 };
div_ sub {
a_ href => "$uid/edit", 'My Profile'; br_;
a_ href => "$uid/list", 'My Visual Novel List'; br_;
diff --git a/lib/VNWeb/User/Page.pm b/lib/VNWeb/User/Page.pm
index 1eebcbb0..8e13e74b 100644
--- a/lib/VNWeb/User/Page.pm
+++ b/lib/VNWeb/User/Page.pm
@@ -21,7 +21,7 @@ sub _info_table_ {
tr_ sub {
td_ class => 'key', 'Username';
td_ sub {
- txt_ $u->{user_name};
+ txt_ ucfirst $u->{user_name};
txt_ ' ('; a_ href => "/u$u->{id}", "u$u->{id}";
txt_ ')';
debug_ $u;