diff --git a/app/Http/Controllers/ShortLinkController.php b/app/Http/Controllers/ShortLinkController.php new file mode 100644 index 0000000..62ab9cf --- /dev/null +++ b/app/Http/Controllers/ShortLinkController.php @@ -0,0 +1,56 @@ + 'translations', + 'r' => 'romhacks', + 'h' => 'homebrew', + 'u' => 'utilities', + 'd' => 'documents', + 'l' => 'lua-scripts', + ]; + + public function legacy( int $wpId ) + { + $log = DB::table('migrations_logs') + ->where('source_system') + ->whereIn('source_table', ['wp_posts', 'wp_posts__news'] ) + ->where('source_id', $wpId) + ->first(['target_table', 'target_id']); + + abort_unless((bool)$log, 404); + + if( $log->target_table == 'entries' ){ + $entry = Entry::findOrFail($log->target_id); + return redirect()->route('entries.show', ['section' => $entry->type, 'entry' => $entry], 301 ); + } else if( $log->target_table == 'news' ){ + $news = News::findOrFail($log->target_id); + return redirect()->route('news.show', ['news' => $news], 301); + } + + abort(404); + } + + public function redirect( string $letter, int $id ) + { + if( $letter === 'n' ){ + $news = News::findOrFail($id); + return redirect()->route('news.show', ['news' => $news], 301 ); + } + + $type = self::LETTER_TO_TYPE[$letter] ?? abort(404); + $entry = Entry::where('id', $id)->where('type', $type)->firstOrFail(); + + return redirect()->route('entries.show', ['section' => $entry->type, 'entry' => $entry], 301 ); + } + +} diff --git a/config/menu.php b/config/menu.php index 2e18180..5aac230 100644 --- a/config/menu.php +++ b/config/menu.php @@ -52,7 +52,7 @@ return [ [ 'name' => 'Discord', 'icon' => 'messages-square', - 'route' => 'home' + 'custom_route' => 'https://discord.gg/5CKzeWmZZU' ], [ 'name' => 'Members', @@ -80,15 +80,21 @@ return [ 'pages' => [ 'name' => 'Pages', 'items' => [ + [ + 'name' => 'Support us', + 'icon' => 'coffee', + 'custom_route' => 'https://ko-fi.com/romhackplaza', + 'color' => 'var(--rhpz-orange)' + ], [ 'name' => 'Learn Romhacking', 'icon' => 'graduation-cap', - 'route' => 'home' + 'xf_route' => 'help/learn-romhacking' ], [ 'name' => 'About', 'icon' => 'info', - 'route' => 'home' + 'xf_route' => 'help/about' ], [ 'name' => 'Contact Us', @@ -96,9 +102,9 @@ return [ 'xf_route' => 'misc/contact' ], [ - 'name' => 'Legal pages', + 'name' => 'Help & Legal pages', 'icon' => 'scale', - 'route' => 'home' + 'xf_route' => 'help' ] ] ] diff --git a/extra.less b/extra.less index fd587f1..cfdded9 100644 --- a/extra.less +++ b/extra.less @@ -71,6 +71,9 @@ ul { /* Menu settings */ --menu-size: 260px; --menu-user-avatar-bg: #555; + + /* Gap */ + --gap: 15px; } .\$light-mode { @@ -132,6 +135,7 @@ ul { background-color: var(--bg2); border: 1px solid var(--border); display: flex; + min-width: 0; flex-direction: column; transition: transform 0.2s, border-color 0.2s; cursor: pointer; @@ -144,6 +148,7 @@ ul { .\$entry-cover-wrapper { position: relative; aspect-ratio: 4/3; + min-width: 0; background-color: var(--bg); border-bottom: 1px solid var(--border); display: flex; @@ -183,6 +188,7 @@ ul { font-size: 1.1rem; margin-bottom: 5px; line-height: 1.3; + word-wrap: break-word; } .\$entry-card-author { @@ -5277,6 +5283,14 @@ ul { display: flex; align-items: center; justify-content: center; + overflow: hidden; + + img { + width: 100%; + height: 100%; + object-fit: cover; + border-radius: 50%; + } } .\$menu-user-info { display: flex; diff --git a/resources/css/layout/menu.css b/resources/css/layout/menu.css index e7f3e47..cf88382 100644 --- a/resources/css/layout/menu.css +++ b/resources/css/layout/menu.css @@ -115,6 +115,14 @@ display: flex; align-items: center; justify-content: center; + overflow: hidden; + + img { + width: 100%; + height: 100%; + object-fit: cover; + border-radius: 50%; + } } .menu-user-info { display: flex; diff --git a/resources/views/components/review-card.blade.php b/resources/views/components/review-card.blade.php index c61723f..225feea 100644 --- a/resources/views/components/review-card.blade.php +++ b/resources/views/components/review-card.blade.php @@ -1,5 +1,7 @@