Frontend: Aus main übernommen assets/ und includes/frontend-* synchronisiert in develop (CSS/Ergebnis/Formular).
All checks were successful
Deploy Workshop-Wahlen (DEV / PROD) / deploy (push) Successful in 13s

This commit is contained in:
ProgrammGamer
2026-01-30 21:27:15 +01:00
parent 9911947c3a
commit 64546f3b62
4 changed files with 360 additions and 9 deletions

View File

@@ -106,7 +106,28 @@ add_shortcode('konficastle_workshop_ergebnis', function($atts) {
ob_start();
// Inline styles, angepasst an konfi-castle.com Look (dezent, grün/türkis Akzent)
echo '<style>
.kc-result{font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:#222;}
.kc-result h3{margin-top:0;text-align:center;color:#154a3b;}
.kc-phase{margin:18px 0;padding:12px;border-radius:12px;background:#fbfffe;border:1px solid #e6f3ee;}
/* Responsive Kachel-Layout: auto-fit with minmax so cards wrap based on viewport */
.kc-result .kc-inner { max-width:1100px; margin:0 auto; padding:0 14px; box-sizing:border-box; }
.kc-workshops-grid{display:grid;grid-template-columns:repeat(auto-fit, minmax(260px, 1fr));gap:14px;margin-top:12px;align-items:start;}
.kc-workshop-card{background:#ffffff;border-radius:12px;overflow:hidden;border:1px solid #e9f4f0;box-shadow:0 2px 6px rgba(8,38,28,0.04);width:100%;}
/* Zentrierter, prominenter Titelbereich in der Mitte oben der Kachel */
.kc-workshop-card .title{background:linear-gradient(90deg, rgba(45,166,106,0.04), rgba(13,89,71,0.02));display:flex;flex-wrap:wrap;align-items:center;justify-content:center;padding:18px 12px;font-weight:800;color:#0d5947;font-size:1.06rem;letter-spacing:0.2px;border-bottom:1px solid rgba(229,244,240,0.8);gap:12px;}
.kc-workshop-card .title .count{color:#6b6b6b;font-weight:600;font-size:0.9rem;margin-left:6px;}
.kc-workshop-card .title .teamers{font-weight:600;color:#145a47;font-size:0.9rem;opacity:0.92;}
.kc-workshop-card .title .teamers small{font-weight:500;color:#4c7a6a;opacity:0.9;font-size:0.85rem;margin-left:6px;}
/* Content-Bereich unter dem Titel mit etwas mehr Luft */
.kc-workshop-card .content{padding:12px 18px 18px 18px;}
.kc-participants{display:grid;grid-template-columns:1fr 1fr;gap:6px 12px;font-size:0.95rem;color:#2b2b2b;}
.kc-participant{padding:6px 8px;border-radius:6px;background:transparent;}
.kc-participant.me{background:#fffbe6;border:1px solid #ffeab2;}
.kc-notassigned{background:#fff6f6;border:1px solid #ffd2d2;padding:12px;border-radius:10px;margin-top:12px;}
/* Auf sehr kleinen Bildschirmen die Teilnehmer ebenfalls einspaltig */
@media(max-width:700px){ .kc-participants{grid-template-columns:1fr;} }
</style>';
echo '<div class="kc-result">';
echo '<h3>Ergebnis für diese Wahl</h3>';
@@ -176,19 +197,23 @@ add_shortcode('konficastle_workshop_ergebnis', function($atts) {
}
echo '<div class="kc-workshop-card">';
// Teamernamen (falls vorhanden) anzeigen - mit Phase-Key
$teamer_html = '';
$teamer_key = intval($d['id']) . '_' . intval($phase);
if (!empty($ws_teamers[$teamer_key])) {
$teamer_html = '<span class="teamers">'.esc_html(implode(', ', $ws_teamers[$teamer_key])).'</span>';
}
echo '<div class="title">'.esc_html($ws_name).($teamer_html ? ' '.$teamer_html : '').'<span class="count">('.$count.' TN)</span></div>';
echo '<div class="title">'.esc_html($ws_name).' '. $teamer_html .'<span class="count">('.$count.' TN)</span></div>';
echo '<div class="content">';
echo '<div class="kc-participants">';
foreach($teilnehmer as $t) {
$is_me = in_array(intval($t->id), $my_ids);
$name = esc_html($t->vorname.' '.$t->nachname);
echo '<span class="kc-participant'.($is_me ? ' me' : '').'">'. $name .'</span>';
$label = $name . ' <span style="color:#6b6b6b;font-size:85%;">('.intval($t->phase).')</span>';
echo '<div class="kc-participant'.($is_me ? ' me' : '').'">'. $label .'</div>';
}
echo '</div>';
echo '</div>'; // kc-participants
echo '</div>'; // content
echo '</div>';
}
@@ -200,11 +225,11 @@ add_shortcode('konficastle_workshop_ergebnis', function($atts) {
if (!empty($nicht_zugeteilt)) {
echo '<div class="kc-notassigned">';
echo '<b>Nicht zugeteilt:</b><br>';
echo '<div style="margin:6px 0 0 18px;">';
echo '<ul style="margin:6px 0 0 18px;">';
foreach($nicht_zugeteilt as $t) {
echo '<span style="display:inline-block;white-space:nowrap;margin-right:12px;">'.esc_html($t->vorname.' '.$t->nachname).'</span>';
echo '<li>'.esc_html($t->vorname.' '.$t->nachname).' (Phase '.intval($t->phase).')</li>';
}
echo '</div></div>';
echo '</ul></div>';
}
echo '</div>'; // kc-result

View File

@@ -16,7 +16,7 @@ add_shortcode('konficastle_workshopwahl', function($atts) {
$wahl = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->prefix}kc_wahlen WHERE id=%d", $wahl_id));
if(!$wahl || !$wahl->freigegeben) {
return $debug_output . '<div"></div>';
return $debug_output . '<div class="kc-error-msg">Die Workshopwahl ist aktuell nicht freigeschaltet.</div>';
}
// Ermittle erlaubte Workshops pro Phase für diese Wahl.
@@ -152,7 +152,26 @@ add_shortcode('konficastle_workshopwahl', function($atts) {
ob_start();
?>
<style>
.kc-form-container {background:#f8fbe7; border-left:8px solid #b6d333; max-width:600px; margin:40px auto; padding:32px 28px; border-radius:14px; box-shadow:0 2px 8px #b6d33322;}
.kc-form-container h2 {margin-top:0; font-size:2em; font-weight:700;}
.kc-form-container label {font-weight:600;}
.kc-form-row {margin-bottom:20px;}
.kc-form-row input[type="text"], .kc-form-row select {
width:100%; padding:10px 12px; border-radius:7px; border:1.2px solid #aac484; background:#fafcf6; font-size:1.09em;
transition:border 0.17s;
}
.kc-form-row input[type="text"]:focus, .kc-form-row select:focus {border:1.8px solid #b6d333;}
.kc-form-row input[type="submit"] {
background:#326dd2; color:#fff; font-weight:600; font-size:1.15em;
padding:11px 30px; border:0; border-radius:8px; cursor:pointer; margin-top:5px; box-shadow:0 2px 6px #aac48422;
}
.kc-form-row input[type="submit"]:hover {background:#2559a2;}
.kc-required {color:#d82626; font-weight:bold;}
.kc-success-msg {color:#21952c; background:#e3f7e4; padding:16px 20px; border-radius:8px; font-weight:600; margin-bottom:15px; text-align:center;}
.kc-error-msg {color:#a80000; background:#ffeaea; padding:16px 20px; border-radius:8px; font-weight:600; margin-bottom:15px; text-align:center;}
@media (max-width: 700px) {.kc-form-container {padding:17px 7px;}}
</style>
<?php echo $debug_output; ?>