button next cafe
This commit is contained in:
parent
e85cee2265
commit
b13934b439
4 changed files with 94 additions and 2 deletions
|
|
@ -10,11 +10,14 @@
|
||||||
<p>
|
<p>
|
||||||
<a href="{% url 'cafe' %}" class="btn btn-primary">Repair-Cafés</a>
|
<a href="{% url 'cafe' %}" class="btn btn-primary">Repair-Cafés</a>
|
||||||
<a href="{% url 'guest' %}" class="btn btn-primary">Gäste</a>
|
<a href="{% url 'guest' %}" class="btn btn-primary">Gäste</a>
|
||||||
|
<a href="{% url 'device_questions' %}" class="btn btn-primary">Rückfragen</a>
|
||||||
</p>
|
</p>
|
||||||
<hr class="mt-0 mb-4">
|
<hr class="mt-0 mb-4">
|
||||||
<h1 class="mt-2">Repair-Cafés</h1>
|
<h1 class="mt-2">Repair-Cafés</h1>
|
||||||
<a href="{% url 'create_cafe' %}" class="btn btn-primary">Neues Repair-Café anlegen</a>
|
<p>
|
||||||
// TODO: Button nächstes Repair-Café
|
<a href="{% url 'create_cafe' %}" class="btn btn-primary">Neues Repair-Café anlegen</a>
|
||||||
|
<a href="{% url 'edit_cafe' next_cafe.pk %}" class="btn btn-primary">Nächstes Repair-Café</a>
|
||||||
|
</p>
|
||||||
<hr class="mt-0 mb-4">
|
<hr class="mt-0 mb-4">
|
||||||
<h1 class="mt-2">Geräte</h1>
|
<h1 class="mt-2">Geräte</h1>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
|
|
|
||||||
63
rc_hip/repapp/templates/repapp/orga/questions.html
Normal file
63
rc_hip/repapp/templates/repapp/orga/questions.html
Normal file
|
|
@ -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 %}
|
||||||
|
<p>
|
||||||
|
<a onclick="history.back()" class="btn btn-primary">Zurück</a>
|
||||||
|
</p>
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Geräts</th>
|
||||||
|
<th scope="col">Hersteller</th>
|
||||||
|
<th scope="col">Gast</th>
|
||||||
|
<th scope="col">Organisator</th>
|
||||||
|
<th scope="col">Reparateur</th>
|
||||||
|
<th scope="col">gesendet</th>
|
||||||
|
<th scope="col">beantwortet</th>
|
||||||
|
<th scope="col"></th>
|
||||||
|
<th scope="col"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for question in questions %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ question.device.device }}</td>
|
||||||
|
<td>{{ question.device.manufacturer }}</td>
|
||||||
|
<td>{{ question.device.guest.name }}</td>
|
||||||
|
<td>{{ question.organisator.mail }}</td>
|
||||||
|
<td>{{ question.reparateur.mail }}</td>
|
||||||
|
<td>
|
||||||
|
{% if question.sent %}
|
||||||
|
Ja
|
||||||
|
{% else %}
|
||||||
|
Nein
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{% if question.answered %}
|
||||||
|
Ja
|
||||||
|
{% else %}
|
||||||
|
Nein
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="{% url 'view_device_question' question.pk %}"
|
||||||
|
class="btn btn-primary">ansehen</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{% if not question.sent %}
|
||||||
|
<a href="{% url 'edit_device_question' question.pk %}"
|
||||||
|
class="btn btn-primary">senden</a>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{% endblock content %}
|
||||||
|
|
@ -39,6 +39,8 @@ urlpatterns = [
|
||||||
views.QuestionUpdateView.as_view(), name="edit_device_question"),
|
views.QuestionUpdateView.as_view(), name="edit_device_question"),
|
||||||
path("member/question/<int:question>/",
|
path("member/question/<int:question>/",
|
||||||
views.question, name="view_device_question"),
|
views.question, name="view_device_question"),
|
||||||
|
path("member/question/",
|
||||||
|
views.questions, name="device_questions"),
|
||||||
path("repa/", views.repa, name="repa"),
|
path("repa/", views.repa, name="repa"),
|
||||||
path("cafe/", views.CafeView.as_view(), name="cafe"),
|
path("cafe/", views.CafeView.as_view(), name="cafe"),
|
||||||
path("cafe/create", views.CafeCreateView.as_view(), name="create_cafe"),
|
path("cafe/create", views.CafeCreateView.as_view(), name="create_cafe"),
|
||||||
|
|
|
||||||
|
|
@ -505,6 +505,9 @@ def orga(request):
|
||||||
questions_open_and_answered = Question.objects.filter(
|
questions_open_and_answered = Question.objects.filter(
|
||||||
open=True, answered=True).order_by('-date')
|
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(
|
return render(
|
||||||
request,
|
request,
|
||||||
"repapp/orga/main.html",
|
"repapp/orga/main.html",
|
||||||
|
|
@ -512,6 +515,7 @@ def orga(request):
|
||||||
'devices': devices,
|
'devices': devices,
|
||||||
'questions_not_sent': questions_not_sent,
|
'questions_not_sent': questions_not_sent,
|
||||||
'questions_open_and_answered': questions_open_and_answered,
|
'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'))
|
@login_required(login_url=reverse_lazy('member'))
|
||||||
def select_role(request):
|
def select_role(request):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Reference in a new issue