Style team pages
This commit is contained in:
parent
08848863ca
commit
6ca0958909
|
@ -103,7 +103,9 @@ class Message(models.Model):
|
||||||
|
|
||||||
|
|
||||||
def gen_token():
|
def gen_token():
|
||||||
return secrets.token_urlsafe(15) # returns 15 bytes Base64-encoded (times 1.333...) = 20 characters
|
return secrets.token_urlsafe(
|
||||||
|
15
|
||||||
|
) # returns 15 bytes Base64-encoded (times 1.333...) = 20 characters
|
||||||
|
|
||||||
|
|
||||||
class LoginToken(models.Model):
|
class LoginToken(models.Model):
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
<div class="column is-one-quarter">
|
<div class="column is-one-quarter">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
{% if shift.deleted %}
|
||||||
|
<em>gelöscht</em><br>
|
||||||
|
{% endif %}
|
||||||
<strong>Ort:</strong> {{ shift.room.name }}<br>
|
<strong>Ort:</strong> {{ shift.room.name }}<br>
|
||||||
<strong>Beginn:</strong> {{ shift.start_at }}<br>
|
<strong>Beginn:</strong> {{ shift.start_at }}<br>
|
||||||
<strong>Dauer:</strong> {{ shift.duration }}
|
<strong>Dauer:</strong> {{ shift.duration }}
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
<div class="box">
|
<div class="box">
|
||||||
{% if is_registered %}
|
{% if is_registered %}
|
||||||
<div class="notification is-info">Du bist zu dieser Schicht angemeldet</div>
|
<div class="notification is-info">Du bist zu dieser Schicht angemeldet</div>
|
||||||
|
{% endif %}
|
||||||
|
{% if shift.deleted %}
|
||||||
|
<div class="notification">Diese Schicht wurde gelöscht.</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<strong>Ort:</strong> {{ shift.room.name }}<br>
|
<strong>Ort:</strong> {{ shift.room.name }}<br>
|
||||||
|
|
|
@ -7,4 +7,6 @@ class EmptyForm(forms.Form):
|
||||||
|
|
||||||
|
|
||||||
class HelperShift(forms.Form):
|
class HelperShift(forms.Form):
|
||||||
helper = forms.ModelChoiceField(queryset=Helper.objects.order_by("name"))
|
helper = forms.ModelChoiceField(
|
||||||
|
label="Helfer*in", queryset=Helper.objects.order_by("name")
|
||||||
|
)
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
{% extends "team_base.html" %}
|
{% extends "team_base.html" %}
|
||||||
|
|
||||||
{% block title %}Schichtdetails{% endblock %}
|
{% block title %}Helferdetails{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>{{ helper.name }}</h2>
|
<h3 class="title">{{ helper.name }}</h3>
|
||||||
Telefon: <a href="tel:{{ helper.phone }}">{{ helper.phone }}</a>
|
<div class="content">
|
||||||
<h2>Schichten:</h2>
|
Telefon: <a href="tel:{{ helper.phone }}">{{ helper.phone }}</a>
|
||||||
<ul>
|
</div>
|
||||||
{% for reg in helper.shiftregistration_set.all %}
|
<h5 class="subtitle">Schichten</h5>
|
||||||
<li>{{ reg.shift.room.name }} {{ reg.shift.start_at }}({{ reg.shift.shiftregistration_set.count }}/{{ reg.shift.room.required_helpers }})<a href="{% url 'team:shift' reg.shift.id %}">Details</a></li>
|
<div class="columns is-multiline">
|
||||||
{% endfor %}
|
{% for reg in helper.shiftregistration_set.all %}
|
||||||
</ul>
|
{% include 'partials/shift_list_item.html' with shift=reg.shift %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<div class="box">
|
||||||
|
<div class="content">
|
||||||
|
{% if shift.deleted %}
|
||||||
|
<em>gelöscht</em><br>
|
||||||
|
{% endif %}
|
||||||
|
<strong>Ort:</strong> {{ shift.room.name }}<br>
|
||||||
|
<strong>Beginn:</strong> {{ shift.start_at }}<br>
|
||||||
|
<strong>Dauer:</strong> {{ shift.duration }}<br>
|
||||||
|
<strong>Belegung:</strong> {{ shift.shiftregistration_set.count }}/{{ shift.room.required_helpers }}
|
||||||
|
</div>
|
||||||
|
<div class="is-flex is-justify-content-end">
|
||||||
|
<a class="button is-info is-small" href="{% url 'team:shift' shift.id %}">Details</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -1,3 +1,3 @@
|
||||||
<li class="box"><b>{{ shift.room.name }}</b> {{ shift.start_at }} ({{ shift.shiftregistration_set.count }}/{{ shift.room.required_helpers }})
|
<div class="column is-one-quarter">
|
||||||
<a class="button is-info is-small" href="{% url 'team:shift' shift.id %}">Details</a>
|
{% include 'partials/shift_box.html' %}
|
||||||
</li>
|
</div>
|
||||||
|
|
|
@ -2,13 +2,21 @@
|
||||||
|
|
||||||
{% block title %}Schichtdetails{% endblock %}
|
{% block title %}Schichtdetails{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{{ shift.room.name }} {{ shift.start_at }}({{ shift.shiftregistration_set.count }}/{{ shift.room.required_helpers }})
|
<h3 class="title is-spaced">{% if shift.deleted %}(gelöscht) {% endif %}{{ shift.room.name }} {{ shift.start_at }} ({{ shift.shiftregistration_set.count }}/{{ shift.room.required_helpers }})</h3>
|
||||||
<h2>Helfer</h2>
|
{% if shift.shiftregistration_set.all %}
|
||||||
<ul>
|
<h5 class="subtitle">Helfer*innen</h5>
|
||||||
{% for reg in shift.shiftregistration_set.all %}
|
<div class="columns is-multiline">
|
||||||
<li><a href="{% url 'team:helper' reg.helper.pk %}">{{ reg.helper.name }}</a> <a href="tel:{{ reg.helper.phone }}">📞</a></li>
|
{% for reg in shift.shiftregistration_set.all %}
|
||||||
{% endfor %}
|
<div class="column is-one-quarter">
|
||||||
</ul>
|
<div class="box is-flex is-align-items-center is-justify-content-space-between">
|
||||||
|
<a class="is-block is-size-4" href="{% url 'team:helper' reg.helper.pk %}">{{ reg.helper.name }}</a>
|
||||||
|
<a class="button is-link is-small" href="tel:{{ reg.helper.phone }}">📞</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<h5 class="subtitle">Helfer*in eintragen</h5>
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{% for field in add_helper_form %}
|
{% for field in add_helper_form %}
|
||||||
|
@ -20,14 +28,20 @@
|
||||||
{% else %}
|
{% else %}
|
||||||
<label class="label" for="{{ field.id_for_label }}">{{ field.label }}</label>
|
<label class="label" for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
|
{% if field.widget_type == 'select' %}
|
||||||
|
<div class="select">
|
||||||
{{ field }}
|
{{ field }}
|
||||||
</div>
|
</div>
|
||||||
|
{% else %}
|
||||||
|
{{ field }}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if field.help_text %}
|
{% if field.help_text %}
|
||||||
<p class="is-size-7 mt-1">{{ field.help_text }}</p>
|
<p class="is-size-7 mt-1">{{ field.help_text }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<button class="button is-link" type="submit">Hinzufuegen</button>
|
<button class="button is-link" type="submit">Hinzufügen</button>
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
{% extends "team_base.html" %}
|
{% extends "team_base.html" %}
|
||||||
|
|
||||||
{% block title %}{{title}}{% endblock %}
|
{% block title %}{{ title }}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h3 class="title is-3">{{title}}</h3>
|
<h3 class="title">{{ title }}</h3>
|
||||||
<ul>
|
<div class="columns is-multiline">
|
||||||
{% for shift in object_list %}
|
{% for shift in object_list %}
|
||||||
{% include "partials/shift_list_item.html" %}
|
{% include "partials/shift_list_item.html" %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,20 +1,24 @@
|
||||||
{% extends "team_base.html" %}
|
{% extends "team_base.html" %}
|
||||||
|
|
||||||
{% block title %}Schichtübersicht{% endblock %}
|
{% block title %}Schichtübersicht{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if running_shifts %}
|
{% if running_shifts %}
|
||||||
<h3 class="title is-3">Laufende Schichten</h3>
|
<h3 class="title">Laufende Schichten</h3>
|
||||||
<ul>
|
<div class="columns is-multiline">
|
||||||
{% for shift in running_shifts %}
|
{% for shift in running_shifts %}
|
||||||
{% include "partials/shift_list_item.html" %}
|
{% include "partials/shift_list_item.html" %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<hr/>
|
<hr>
|
||||||
<h3 class="title is-3">Nächste Schichten pro Raum</h3>
|
<h3 class="title is-spaced">Nächste Schichten pro Raum</h3>
|
||||||
<ul>
|
<div class="columns">
|
||||||
{% for shift in next_shifts %}
|
{% for shift in next_shifts %}
|
||||||
{% include "partials/shift_list_item.html" %}
|
<div class="column is-one-quarter">
|
||||||
{% endfor %}
|
<h5 class="subtitle">{{ shift.room.name }}</h5>
|
||||||
</ul>
|
{% include "partials/shift_box.html" %}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in New Issue