add team room view with secret token
parent
7c19caab6b
commit
5a826c04a6
@ -0,0 +1,37 @@
|
||||
# Generated by Django 4.0.4 on 2023-05-18 15:15
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import shiftregister.team.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("app", "0011_room_description"),
|
||||
("team", "0003_incomingmessage_read_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="RoomViewToken",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.CharField(
|
||||
default=shiftregister.team.models.gen_token,
|
||||
editable=False,
|
||||
max_length=20,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
),
|
||||
),
|
||||
(
|
||||
"room",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, to="app.room"
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
]
|
@ -0,0 +1,25 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block everything %}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h3 class="title" style="background:var(--background);margin:0 -1rem;padding:1rem;position:sticky;top:0;">Helfer:innen für {{ room.name }}</h3>
|
||||
<table class="table">
|
||||
<thead style="background:inherit;position:sticky;top:4rem;">
|
||||
<tr>
|
||||
<th>Startzeit</th>
|
||||
<th>Helfer:innen</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for shift in room.shift_set.all|dictsort:"start_at" %}
|
||||
<tr>
|
||||
<td>{{ shift.start_at }}</td>
|
||||
<td>{% for reg in shift.shiftregistration_set.all %}{{ reg.helper.name }}{% if not forloop.last %}, {% endif %}{% endfor %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue