From 24f8a6a9aa59f69829e58473942f238219e22cbc Mon Sep 17 00:00:00 2001 From: Floorb <132411956+Neetpone@users.noreply.github.com> Date: Sun, 7 Jul 2024 17:28:31 -0400 Subject: [PATCH] fix: bring back the HackerHorse badge! --- public/img/badges/hackerhorse.svg | 4 ++++ public/theme/bulma/css/paste.css | 21 ++++++++++++++++++--- public/user.php | 8 ++++++-- theme/bulma/user_profile.php | 4 +++- 4 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 public/img/badges/hackerhorse.svg diff --git a/public/img/badges/hackerhorse.svg b/public/img/badges/hackerhorse.svg new file mode 100644 index 0000000..d857410 --- /dev/null +++ b/public/img/badges/hackerhorse.svg @@ -0,0 +1,4 @@ + + + + diff --git a/public/theme/bulma/css/paste.css b/public/theme/bulma/css/paste.css index bec820f..f6e53f3 100644 --- a/public/theme/bulma/css/paste.css +++ b/public/theme/bulma/css/paste.css @@ -331,6 +331,21 @@ table.hidden + .loading_container { background-position: center; } -.pp-width-auto { - width: auto; -} \ No newline at end of file +.badges { + display: flex; + align-items: center; +} + +.badges > * { + border-radius: 50%; + width: 70px; + height: 70px; +} + +.badge--bgcolor-dark { + background-color: #2e2e2eff; +} + +.badge--padded > img { + margin: 10px; +} diff --git a/public/user.php b/public/user.php index 0879710..f246e57 100644 --- a/public/user.php +++ b/public/user.php @@ -43,13 +43,17 @@ $total_pfav = array_sum( $total_yfav = $profile_info->favourites->count(); // Badges -$profile_badge = match ((int) $profile_info['badge']) { +$profile_badge = match ((int) 5) { 1 => 'Donated to PonePaste', 2 => 'You had one job', 3 => 'Won a PasteJam competition', - default => '', + 4 => '', + 5 => '', + default => '' }; + + $profile_total_pastes = $profile_info->pastes->count(); $profile_total_public = $profile_info->pastes->where('visible', 0)->count(); $profile_total_unlisted = $profile_info->pastes->where('visible', 1)->count(); diff --git a/theme/bulma/user_profile.php b/theme/bulma/user_profile.php index 83f126c..d10848a 100644 --- a/theme/bulma/user_profile.php +++ b/theme/bulma/user_profile.php @@ -75,6 +75,7 @@ if ($is_current_user && isset($_GET['tab']) && $_GET['tab'] === 'favourites') {

Badges

+
+