summaryrefslogtreecommitdiff
path: root/lib/VNWeb/User
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-10-08 18:16:46 +0200
committerYorhel <git@yorhel.nl>2019-10-10 16:40:30 +0200
commitb3a9130763879d60c0e413c724a759860bd396af (patch)
tree2de6f9d21d4ce9f00fc11595906570be43d8ae5c /lib/VNWeb/User
parent4c1dfc8bb62171c4c21057c47f238c8747bac3f8 (diff)
rewards: Apply supporters badge and unicode name (almost) everywhere
Only place where this isn't applied (yet?): Sorting user lists still goes by the old username and board names don't use the new unicode names. I have to say, I quite like the sql_user() and user_() pattern. It's not without problems when applied to everything, but it's good enough for several use cases.
Diffstat (limited to 'lib/VNWeb/User')
-rw-r--r--lib/VNWeb/User/Page.pm21
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/VNWeb/User/Page.pm b/lib/VNWeb/User/Page.pm
index 175ce3de..2ad6d796 100644
--- a/lib/VNWeb/User/Page.pm
+++ b/lib/VNWeb/User/Page.pm
@@ -7,13 +7,25 @@ use VNWeb::Misc::History;
sub _info_table_ {
my($u, $vis) = @_;
+ my sub sup {
+ b_ ' ⭐supporter⭐' if $u->{user_support_can} && $u->{user_support_enabled};
+ }
+
+ tr_ sub {
+ td_ class => 'key', 'Display name';
+ td_ sub {
+ txt_ $u->{user_uniname};
+ sup;
+ };
+ } if $u->{user_uniname_can} && $u->{user_uniname};
tr_ sub {
td_ class => 'key', 'Username';
td_ sub {
- txt_ ucfirst $u->{username};
+ txt_ $u->{user_name};
txt_ ' ('; a_ href => "/u$u->{id}", "u$u->{id}";
txt_ ')';
debug_ $u;
+ sup if !($u->{user_uniname_can} && $u->{user_uniname});
};
};
tr_ sub {
@@ -113,9 +125,10 @@ sub _votestats_ {
TUWF::get qr{/$RE{uid}}, sub {
my $u = tuwf->dbRowi(q{
- SELECT id, username, hide_list, c_changes, c_votes, c_tags
+ SELECT id, hide_list, c_changes, c_votes, c_tags
,}, sql_totime('registered'), q{ AS registered
- FROM users
+ ,}, sql_user(), q{
+ FROM users u
WHERE id =}, \tuwf->capture('id')
);
return tuwf->resNotFound if !$u->{id};
@@ -129,7 +142,7 @@ TUWF::get qr{/$RE{uid}}, sub {
GROUP BY (vote::numeric/10)::int
});
- my $title = "$u->{username}'s profile";
+ my $title = user_displayname($u)."'s profile";
framework_ title => $title, index => 0, type => 'u', dbobj => $u,
sub {
div_ class => 'mainbox userpage', sub {