Fixes display of author avatar and league links
Ensures author avatar is only displayed if it exists. Uses dynamic league IDs from the `spielbetrieb` page in the navbar, which allows changing the league links in the backend.
This commit is contained in:
@@ -45,7 +45,7 @@ Tags: Vereinsmeisterschaft, Spielbericht
|
|||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
Author: - user://myU6sssZ
|
Author: - user://KOY9VcGi
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,9 @@
|
|||||||
<?php if ($user = $post->author()->toUser()): ?>
|
<?php if ($user = $post->author()->toUser()): ?>
|
||||||
<div class="mt-6 flex border-t border-gray-900/5 pt-6">
|
<div class="mt-6 flex border-t border-gray-900/5 pt-6">
|
||||||
<div class="relative flex items-center gap-x-4">
|
<div class="relative flex items-center gap-x-4">
|
||||||
|
<?php if ($user->avatar()): ?>
|
||||||
<img src="<?= $user->avatar()->url() ?>" alt="" class="size-10 rounded-full bg-gray-50" />
|
<img src="<?= $user->avatar()->url() ?>" alt="" class="size-10 rounded-full bg-gray-50" />
|
||||||
|
<?php endif; ?>
|
||||||
<div class="text-sm/6">
|
<div class="text-sm/6">
|
||||||
<p>
|
<p>
|
||||||
<span class="absolute inset-0"></span>
|
<span class="absolute inset-0"></span>
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
$aklasse = page('spielbetrieb')->aklasse();
|
||||||
|
$bklasse = page('spielbetrieb')->bklasse();
|
||||||
|
?>
|
||||||
|
|
||||||
<nav class="bg-sf_grau-50 shadow-lg sticky top-0 z-50">
|
<nav class="bg-sf_grau-50 shadow-lg sticky top-0 z-50">
|
||||||
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
|
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
|
||||||
<div class="flex h-24 items-center justify-between">
|
<div class="flex h-24 items-center justify-between">
|
||||||
@@ -93,10 +98,10 @@
|
|||||||
</button>
|
</button>
|
||||||
<div class="invisible absolute left-0 z-10 mt-2 w-48 rounded-md bg-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100">
|
<div class="invisible absolute left-0 z-10 mt-2 w-48 rounded-md bg-white opacity-0 shadow-lg transition-all duration-200 group-hover:visible group-hover:opacity-100">
|
||||||
<div class="py-1">
|
<div class="py-1">
|
||||||
<a href="https://www.ligamanager.schachbund-bayern.de/hof/ergebnisse/spielplan.htm?ligaId=2391"
|
<a href="https://www.ligamanager.schachbund-bayern.de/hof/ergebnisse/spielplan.htm?ligaId=<?= $aklasse ?>"
|
||||||
class="block px-4 py-2 text-m text-gray-700 hover:bg-gray-100"
|
class="block px-4 py-2 text-m text-gray-700 hover:bg-gray-100"
|
||||||
target="_blank">A-Klasse</a>
|
target="_blank">A-Klasse</a>
|
||||||
<a href="https://www.ligamanager.schachbund-bayern.de/hof/ergebnisse/spielplan.htm?ligaId=2392"
|
<a href="https://www.ligamanager.schachbund-bayern.de/hof/ergebnisse/spielplan.htm?ligaId=<?= $bklasse ?>"
|
||||||
class="block px-4 py-2 text-m text-gray-700 hover:bg-gray-100"
|
class="block px-4 py-2 text-m text-gray-700 hover:bg-gray-100"
|
||||||
target="_blank">B-Klasse</a>
|
target="_blank">B-Klasse</a>
|
||||||
<a href="/spielbetrieb/analyse"
|
<a href="/spielbetrieb/analyse"
|
||||||
@@ -203,9 +208,9 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
<div class="mobile-dropdown-content hidden space-y-1 pl-6">
|
<div class="mobile-dropdown-content hidden space-y-1 pl-6">
|
||||||
<a href="https://www.ligamanager.schachbund-bayern.de/hof/ergebnisse/spielplan.htm?ligaId=2391"
|
<a href="https://www.ligamanager.schachbund-bayern.de/hof/ergebnisse/spielplan.htm?ligaId=<?= $aklasse ?>"
|
||||||
class="block px-3 py-2 text-sm text-gray-600 hover:text-blue-600">A-Klasse</a>
|
class="block px-3 py-2 text-sm text-gray-600 hover:text-blue-600">A-Klasse</a>
|
||||||
<a href="https://www.ligamanager.schachbund-bayern.de/hof/ergebnisse/spielplan.htm?ligaId=2392"
|
<a href="https://www.ligamanager.schachbund-bayern.de/hof/ergebnisse/spielplan.htm?ligaId=<?= $bklasse ?>"
|
||||||
class="block px-3 py-2 text-sm text-gray-600 hover:text-blue-600">B-Klasse</a>
|
class="block px-3 py-2 text-sm text-gray-600 hover:text-blue-600">B-Klasse</a>
|
||||||
<a href="/spielbetrieb/analyse"
|
<a href="/spielbetrieb/analyse"
|
||||||
class="block px-3 py-2 text-sm text-gray-600 hover:text-blue-600">Analyse</a>
|
class="block px-3 py-2 text-sm text-gray-600 hover:text-blue-600">Analyse</a>
|
||||||
|
|||||||
@@ -39,7 +39,9 @@
|
|||||||
<?php if ($user = $post->author()->toUser()): ?>
|
<?php if ($user = $post->author()->toUser()): ?>
|
||||||
<div class="mt-6 flex border-t border-gray-900/5 pt-6">
|
<div class="mt-6 flex border-t border-gray-900/5 pt-6">
|
||||||
<div class="relative flex items-center gap-x-4">
|
<div class="relative flex items-center gap-x-4">
|
||||||
|
<?php if ($user->avatar()): ?>
|
||||||
<img src="<?= $user->avatar()->url() ?>" alt="" class="size-10 rounded-full bg-gray-50" />
|
<img src="<?= $user->avatar()->url() ?>" alt="" class="size-10 rounded-full bg-gray-50" />
|
||||||
|
<?php endif; ?>
|
||||||
<div class="text-sm/6">
|
<div class="text-sm/6">
|
||||||
<p>
|
<p>
|
||||||
<span class="absolute inset-0"></span>
|
<span class="absolute inset-0"></span>
|
||||||
|
|||||||
@@ -49,7 +49,9 @@
|
|||||||
<?php if ($user = $page->author()->toUser()): ?>
|
<?php if ($user = $page->author()->toUser()): ?>
|
||||||
<div class="mt-6 flex border-t border-b-sf_grau-300 pt-6">
|
<div class="mt-6 flex border-t border-b-sf_grau-300 pt-6">
|
||||||
<div class="relative flex items-center gap-x-4">
|
<div class="relative flex items-center gap-x-4">
|
||||||
|
<?php if ($user->avatar()): ?>
|
||||||
<img src="<?= $user->avatar()->url() ?>" alt="" class="size-10 rounded-full" />
|
<img src="<?= $user->avatar()->url() ?>" alt="" class="size-10 rounded-full" />
|
||||||
|
<?php endif ?>
|
||||||
<div class="text-sm/6">
|
<div class="text-sm/6">
|
||||||
<p>
|
<p>
|
||||||
<a href="#">
|
<a href="#">
|
||||||
|
|||||||
Reference in New Issue
Block a user