Implement Veranstalter and Veranstaltung management: Add VeranstalterDetailScreen, seed FakeVeranstaltungStore, and enable deletion of Veranstaltungen. Extend onboarding with device name validation. Refine UI for VeranstalterKonfigScreen, add InvalidContextNotice, and centralize navigation checks.
This commit is contained in:
+31
-17
@@ -9,6 +9,8 @@ import androidx.compose.material.icons.filled.Add
|
||||
import androidx.compose.material.icons.filled.Delete
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.mutableStateListOf
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
@@ -38,8 +40,24 @@ fun AdminUebersichtScreen(
|
||||
onVeranstaltungOeffnen: (Long) -> Unit,
|
||||
onPingService: () -> Unit = {},
|
||||
) {
|
||||
// Placeholder-Daten für die UI-Struktur
|
||||
val veranstaltungen = listOf<VeranstaltungUiModel>() // leer bis Backend angebunden
|
||||
// Placeholder-Daten für die UI-Struktur (sichtbar als Cards)
|
||||
val sample = listOf(
|
||||
VeranstaltungUiModel(
|
||||
id = 1001,
|
||||
name = "NEUMARKT/M., OÖ",
|
||||
ort = "4221 NEUMARKT/M.",
|
||||
datum = "12.–13.04.2026",
|
||||
turnierAnzahl = 2,
|
||||
nennungen = 0,
|
||||
letzteAktivitaet = "vor 1 Min",
|
||||
status = VeranstaltungStatus.VORBEREITUNG,
|
||||
turniere = listOf(
|
||||
TurnierUiModel(id = 26129, nummer = 26129, name = "CDN-C-NEU CDNP-C-NEU", bewerbAnzahl = 16),
|
||||
TurnierUiModel(id = 26128, nummer = 26128, name = "CSN-C-NEU CSNP-C-NEU", bewerbAnzahl = 18),
|
||||
)
|
||||
)
|
||||
)
|
||||
val veranstaltungen = remember { mutableStateListOf<VeranstaltungUiModel>().also { it.addAll(sample) } }
|
||||
|
||||
Column(modifier = Modifier.fillMaxSize()) {
|
||||
// KPI-Kacheln
|
||||
@@ -75,10 +93,6 @@ fun AdminUebersichtScreen(
|
||||
singleLine = true,
|
||||
)
|
||||
|
||||
OutlinedButton(onClick = onPingService) {
|
||||
Text("🔧 Ping")
|
||||
}
|
||||
|
||||
// Status-Filter Chips
|
||||
StatusFilterChip("Alle", selected = true)
|
||||
StatusFilterChip("Vorbereitung", selected = false)
|
||||
@@ -123,11 +137,11 @@ fun AdminUebersichtScreen(
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
contentPadding = PaddingValues(vertical = 8.dp),
|
||||
) {
|
||||
items(veranstaltungen) { veranstaltung ->
|
||||
items(items = veranstaltungen, key = { it.id }) { veranstaltung ->
|
||||
VeranstaltungCard(
|
||||
veranstaltung = veranstaltung,
|
||||
onOeffnen = { onVeranstaltungOeffnen(veranstaltung.id) },
|
||||
onLoeschen = { /* TODO */ },
|
||||
onLoeschen = { veranstaltungen.removeAll { it.id == veranstaltung.id } },
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -184,21 +198,21 @@ private fun KpiKachel(
|
||||
) {
|
||||
Card(
|
||||
modifier = modifier,
|
||||
border = BorderStroke(2.dp, akzentFarbe),
|
||||
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface),
|
||||
border = BorderStroke(1.dp, akzentFarbe.copy(alpha = 0.4f)),
|
||||
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.4f)),
|
||||
) {
|
||||
Column(modifier = Modifier.padding(12.dp)) {
|
||||
Text(
|
||||
text = label,
|
||||
fontSize = 10.sp,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
fontSize = 11.sp,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.9f),
|
||||
fontWeight = FontWeight.Medium,
|
||||
)
|
||||
Text(
|
||||
text = wert,
|
||||
fontSize = 28.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = akzentFarbe,
|
||||
fontSize = 24.sp,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
color = akzentFarbe.copy(alpha = 0.9f),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -274,7 +288,7 @@ private fun VeranstaltungCard(
|
||||
Text("${turnier.name} (${turnier.bewerbAnzahl} Bewerbe)", fontSize = 12.sp)
|
||||
}
|
||||
OutlinedButton(onClick = onOeffnen, modifier = Modifier.height(28.dp)) {
|
||||
Text("Öffnen", fontSize = 11.sp)
|
||||
Text("Zum Turnier", fontSize = 11.sp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -297,7 +311,7 @@ private fun VeranstaltungCard(
|
||||
colors = ButtonDefaults.buttonColors(containerColor = Color(0xFF1E3A8A)),
|
||||
modifier = Modifier.height(32.dp),
|
||||
) {
|
||||
Text("Öffnen", fontSize = 12.sp)
|
||||
Text("Zur Veranstaltung", fontSize = 12.sp)
|
||||
}
|
||||
IconButton(onClick = onLoeschen, modifier = Modifier.size(32.dp)) {
|
||||
Icon(Icons.Default.Delete, contentDescription = "Löschen", tint = Color(0xFFDC2626))
|
||||
|
||||
Reference in New Issue
Block a user