Merge pull request #189 from Deutscher-Tischfussballbund/fix/183_long-discipline-names-break-layout

Long list of disciplines break tournament view
This commit is contained in:
MarvinF
2025-09-23 20:18:30 +02:00
committed by GitHub
2 changed files with 26 additions and 10 deletions
@@ -444,7 +444,14 @@ static function turniere($turniere): void
if (!empty($turnier->disziplinen)) { if (!empty($turnier->disziplinen)) {
?> ?>
<br/> <br/>
<small><?php echo $turnier->disziplinen; ?></small> <small>
<?php
$parts = preg_split('/,(?![^()]*\))/m', $turnier->disziplinen);
$parts = array_map('trim', $parts); // remove extra spaces
foreach ($parts as $discipline) {
echo $discipline . "<br>";
} ?>
</small>
<?php <?php
} }
?> ?>
@@ -374,7 +374,16 @@ class HTML_sportsmanager_admin
echo htmlentities_utf8($row->turnierbezeichnung); echo htmlentities_utf8($row->turnierbezeichnung);
if (!empty($row->disziplinen)) { if (!empty($row->disziplinen)) {
?> ?>
<br/><small><?php echo $row->disziplinen; ?></small> <br/>
<small>
<?php
$parts = preg_split('/,(?![^()]*\))/m', $row->disziplinen);
$parts = array_map('trim', $parts); // remove extra spaces
foreach ($parts as $discipline) {
echo $discipline . "<br>";
}
?>
</small>
<?php <?php
} }
?> ?>