2017-03-26 00:50:10 +00:00
|
|
|
from django.contrib.auth.decorators import login_required
|
2012-07-12 05:32:07 +00:00
|
|
|
from django.shortcuts import render, redirect
|
2018-06-29 22:56:52 +00:00
|
|
|
from symposion.proposals.models import ProposalSection
|
2012-07-12 05:32:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
@login_required
|
|
|
|
def dashboard(request):
|
|
|
|
if request.session.get("pending-token"):
|
2018-06-29 22:56:52 +00:00
|
|
|
return redirect("speaker_create_token", request.session["pending-token"])
|
|
|
|
|
|
|
|
# Patching available proposal kinds into the dashboard to enable creating
|
|
|
|
# proposals from the dashboard directly.
|
|
|
|
sections = ProposalSection.available().prefetch_related('section__proposal_kinds')
|
|
|
|
kinds = [kind for section in sections for kind in section.section.proposal_kinds.all()]
|
|
|
|
|
|
|
|
return render(request, "dashboard.html", {'proposal_kinds': kinds})
|