diff --git a/rc_hip/repapp/templates/repapp/orga/main.html b/rc_hip/repapp/templates/repapp/orga/main.html index 6ec43ce..da312b3 100644 --- a/rc_hip/repapp/templates/repapp/orga/main.html +++ b/rc_hip/repapp/templates/repapp/orga/main.html @@ -10,11 +10,14 @@

Repair-Cafés Gäste + Rückfragen


Repair-Cafés

- Neues Repair-Café anlegen - // TODO: Button nächstes Repair-Café +

+ Neues Repair-Café anlegen + Nächstes Repair-Café +


Geräte

diff --git a/rc_hip/repapp/templates/repapp/orga/questions.html b/rc_hip/repapp/templates/repapp/orga/questions.html new file mode 100644 index 0000000..53c1198 --- /dev/null +++ b/rc_hip/repapp/templates/repapp/orga/questions.html @@ -0,0 +1,63 @@ +{% extends "repapp/base.html" %} +{% load crispy_forms_tags %} +{% block title %} + - Rückfragen +{% endblock title %} +{% block page_title %} + Rückfragen +{% endblock page_title %} +{% block content %} +

+ Zurück +

+
+ + + + + + + + + + + + + + + {% for question in questions %} + + + + + + + + + + + + {% endfor %} + +
GerätsHerstellerGastOrganisatorReparateurgesendetbeantwortet
{{ question.device.device }}{{ question.device.manufacturer }}{{ question.device.guest.name }}{{ question.organisator.mail }}{{ question.reparateur.mail }} + {% if question.sent %} + Ja + {% else %} + Nein + {% endif %} + + {% if question.answered %} + Ja + {% else %} + Nein + {% endif %} + + ansehen + + {% if not question.sent %} + senden + {% endif %} +
+{% endblock content %} diff --git a/rc_hip/repapp/urls.py b/rc_hip/repapp/urls.py index e87c4d9..85c8219 100644 --- a/rc_hip/repapp/urls.py +++ b/rc_hip/repapp/urls.py @@ -39,6 +39,8 @@ urlpatterns = [ views.QuestionUpdateView.as_view(), name="edit_device_question"), path("member/question//", views.question, name="view_device_question"), + path("member/question/", + views.questions, name="device_questions"), path("repa/", views.repa, name="repa"), path("cafe/", views.CafeView.as_view(), name="cafe"), path("cafe/create", views.CafeCreateView.as_view(), name="create_cafe"), diff --git a/rc_hip/repapp/views.py b/rc_hip/repapp/views.py index 0cb3686..4b76842 100644 --- a/rc_hip/repapp/views.py +++ b/rc_hip/repapp/views.py @@ -505,6 +505,9 @@ def orga(request): questions_open_and_answered = Question.objects.filter( open=True, answered=True).order_by('-date') + next_cafe = Cafe.objects.filter( + event_date__gte=datetime.datetime.today()).order_by('event_date').first() + return render( request, "repapp/orga/main.html", @@ -512,6 +515,7 @@ def orga(request): 'devices': devices, 'questions_not_sent': questions_not_sent, 'questions_open_and_answered': questions_open_and_answered, + 'next_cafe': next_cafe, } ) @@ -728,6 +732,26 @@ def question(request, question): ) +@login_required(login_url=reverse_lazy('member')) +def questions(request): + """ + List of all questions. + """ + # TODO: test + if not is_member(request.user): + raise PermissionDenied('Not organisator!') + + questions = Question.objects.order_by('-date') + + return render( + request, + "repapp/orga/questions.html", + { + 'questions': questions, + } + ) + + @login_required(login_url=reverse_lazy('member')) def select_role(request): """