handle closed cfp

This commit is contained in:
Élie Bouttier 2017-11-04 21:37:53 +01:00
parent c7f20b2362
commit 6820aaea13
4 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,18 @@
{% extends 'base.html' %}
{% load i18n %}
{% block proposetab %} class="active"{% endblock %}
{% block content %}
<div class="page-header">
<h1>
{% trans "Participate" %}
</h1>
</div>
<h2>{% trans "Sorry, the Call for Participation is closed!" %}</h2>
{% url 'proposal-mail-token' as mail_token_url %}
<p>{% blocktrans %}If you already have submitted a talk and you want to edit it, please click <a href="{{ mail_token_url }}">here</a>.{% endblocktrans %}</p>
{% endblock %}

View File

@ -71,7 +71,9 @@
<i>{% trans "No proposals." %}</i>
{% endfor %}
</p>
{% if conference.opened_categories.exists %}
<p>
<a href="{% url 'proposal-talk-add' speaker_token=speaker.token %}" class="btn btn-primary">{% trans "New proposal" %}</a>
</p>
{% endif %}
{% endblock %}

View File

@ -13,9 +13,11 @@
<a href="{% url 'proposal-dashboard' speaker_token=speaker.token %}" class="btn btn-primary">
<span class="glyphicon glyphicon-chevron-left"></span>&nbsp;{% trans "My profile" %}
</a>
{% if conference.opened_categories.exists %}
<a href="{% url 'proposal-talk-add' speaker_token=speaker.token %}" class="btn btn-info">
<span class="glyphicon glyphicon-plus"></span>&nbsp;{% trans "New proposal" %}
</a>
{% endif %}
<a href="{% url 'proposal-talk-edit' speaker_token=speaker.token talk_id=talk.pk %}" class="btn btn-success">
<span class="glyphicon glyphicon-pencil"></span>&nbsp;{% trans "Edit this proposal" %}
</a>

View File

@ -143,6 +143,8 @@ def proposal_home(request):
categories = TalkCategory.objects.filter(site=request.conference.site)
else:
categories = request.conference.opened_categories
if not categories.exists():
return render(request, 'cfp/closed.html')
speaker_form = ParticipantForm(request.POST or None, conference=request.conference, social=False)
talk_form = TalkForm(request.POST or None, categories=categories)
if request.method == 'POST' and all(map(lambda f: f.is_valid(), [speaker_form, talk_form])):