feat: Visuelle Unterscheidung der Termintypen auf dem Dashboard
This commit is contained in:
parent
74ff99fe52
commit
956d7a45e9
Binary file not shown.
@ -15,7 +15,15 @@
|
|||||||
{% if events %}
|
{% if events %}
|
||||||
<div class="list-group">
|
<div class="list-group">
|
||||||
{% for event in events %}
|
{% for event in events %}
|
||||||
<div class="list-group-item list-group-item-action flex-column align-items-start">
|
<div class="list-group-item list-group-item-action flex-column align-items-start
|
||||||
|
{% if event.game %}
|
||||||
|
event-game
|
||||||
|
{% elif event.training %}
|
||||||
|
event-training
|
||||||
|
{% else %}
|
||||||
|
event-generic
|
||||||
|
{% endif %}
|
||||||
|
">
|
||||||
<div class="d-flex w-100 justify-content-between">
|
<div class="d-flex w-100 justify-content-between">
|
||||||
<h5 class="mb-1">{{ event.title }}</h5>
|
<h5 class="mb-1">{{ event.title }}</h5>
|
||||||
<small>{{ event.start_time|localize }}</small>
|
<small>{{ event.start_time|localize }}</small>
|
||||||
|
|||||||
@ -22,7 +22,7 @@ def dashboard(request):
|
|||||||
all_teams = list(set(chain(player_teams, coached_teams, assisted_teams)))
|
all_teams = list(set(chain(player_teams, coached_teams, assisted_teams)))
|
||||||
|
|
||||||
if all_teams:
|
if all_teams:
|
||||||
events = Event.objects.filter(team__in=all_teams).order_by('start_time')
|
events = Event.objects.filter(team__in=all_teams).select_related('game', 'training').order_by('start_time')
|
||||||
|
|
||||||
context = {
|
context = {
|
||||||
'events': events,
|
'events': events,
|
||||||
|
|||||||
@ -4,6 +4,17 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Baseball Organisator</title>
|
<title>Baseball Organisator</title>
|
||||||
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
|
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
|
||||||
|
<style>
|
||||||
|
.event-game {
|
||||||
|
border-left: 5px solid #dc3545; /* red */
|
||||||
|
}
|
||||||
|
.event-training {
|
||||||
|
border-left: 5px solid #0d6efd; /* blue */
|
||||||
|
}
|
||||||
|
.event-generic {
|
||||||
|
border-left: 5px solid #6c757d; /* gray */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user