diff --git a/proposals/templates/proposals/talks.html b/proposals/templates/proposals/talks.html index 8875c5a..0990e09 100644 --- a/proposals/templates/proposals/talks.html +++ b/proposals/templates/proposals/talks.html @@ -6,12 +6,14 @@ Propose a talk +{% if my_talks %}
My participing talks:
+{% include "proposals/_talk_list.html" with talk_list=my_talks %} +{% endif %} -{% include "proposals/_talk_list.html" with talk_list=my_talks%} - +{% if other_talks %}
Others talks:
- -{% include "proposals/_talk_list.html" with talk_list=other_talks%} +{% include "proposals/_talk_list.html" with talk_list=other_talks %} +{% endif %} {% endblock %} diff --git a/proposals/views.py b/proposals/views.py index 0111cfa..9f17009 100644 --- a/proposals/views.py +++ b/proposals/views.py @@ -8,6 +8,7 @@ from django.shortcuts import get_object_or_404, redirect, render from django.views.generic import CreateView, DetailView, ListView from accounts.mixins import StaffRequiredMixin +from accounts.models import Participation from proposals.forms import TalkForm from proposals.models import Speech, Talk, Topic @@ -20,9 +21,10 @@ def home(request): @login_required def talk_list(request): + participation = Participation.on_site.get(user=request.user) return render(request, 'proposals/talks.html', { 'my_talks': Talk.on_site.filter(speakers=request.user), - 'other_talks': Talk.on_site.exclude(speakers=request.user), + 'other_talks': Talk.on_site.exclude(speakers=request.user).filter(topics__reviewers=participation), })