Add frontend helper feedback view
parent
3d3686cec2
commit
fc22cc4491
@ -0,0 +1,28 @@
|
|||||||
|
# Generated by Django 4.0.4 on 2023-05-27 17:48
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import secrets
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
("feedback", "0001_initial"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name="ShareToken",
|
||||||
|
fields=[
|
||||||
|
(
|
||||||
|
"token",
|
||||||
|
models.CharField(
|
||||||
|
default=secrets.token_urlsafe,
|
||||||
|
max_length=43,
|
||||||
|
primary_key=True,
|
||||||
|
serialize=False,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
("name", models.CharField(max_length=200)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]
|
@ -0,0 +1,20 @@
|
|||||||
|
from django.dispatch import receiver
|
||||||
|
from django.shortcuts import reverse
|
||||||
|
from dynamic_preferences.registries import global_preferences_registry
|
||||||
|
from shiftregister.core.signals import populate_nav
|
||||||
|
|
||||||
|
global_preferences = global_preferences_registry.manager()
|
||||||
|
|
||||||
|
|
||||||
|
@receiver(populate_nav, dispatch_uid="populate_feedback_nav")
|
||||||
|
def populate_feedback_nav(sender, **kwargs):
|
||||||
|
request = sender
|
||||||
|
nav_items = []
|
||||||
|
|
||||||
|
if (
|
||||||
|
global_preferences["helper__event_state"] == "AFTER"
|
||||||
|
and request.user.is_authenticated
|
||||||
|
):
|
||||||
|
nav_items.append({"link": reverse("submissions"), "text": "Feedback"})
|
||||||
|
|
||||||
|
return nav_items
|
@ -0,0 +1,22 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block title %}Feedback{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h3 class="title">Feedback von Helfer*innen</h3>
|
||||||
|
<div class="content is-flex">
|
||||||
|
Zum Helfer*innenfest angemeldet:
|
||||||
|
<div class="tags">
|
||||||
|
<span class="tag is-success">ja</span>
|
||||||
|
<span class="tag is-danger">nein</span>
|
||||||
|
<span class="tag is-warning">vielleicht</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% for feedback in submissions %}
|
||||||
|
<div class="message message-{% cycle 'incoming' 'outgoing' %} {{ feedback.color }}">
|
||||||
|
<div class="message-body">
|
||||||
|
{{ feedback.feedback_text }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
{% endblock %}
|
Loading…
Reference in New Issue