diff --git a/cfp/models.py b/cfp/models.py index 4344977..1ff409a 100644 --- a/cfp/models.py +++ b/cfp/models.py @@ -60,7 +60,7 @@ class Proposal(models.Model): description = models.TextField( help_text="The detailed subject and goals for your proposed session. " "This is mandatory.") - topic = models.ForeignKey(Topic, + topic = models.ForeignKey(Topic, default=1, help_text="The topic the session belongs in. Click 'Help' below" " for more details. This is mandatory.") blueprints = models.CharField(max_length=400, blank=True, diff --git a/cfp/templates/cfplist.html b/cfp/templates/cfplist.html index 5777776..bf17f03 100644 --- a/cfp/templates/cfplist.html +++ b/cfp/templates/cfplist.html @@ -13,13 +13,15 @@ Session suggestion is now closed. {% endif %} {% for topic in reviewable_topics %} -<a class=roundedButton href="/cfp/topic/{{ topic.id }}">Review topic: {{ topic.name }}</A> +<a class=roundedButton href="/cfp/topic/{{ topic.id }}">Review {% if multitopic %}topic: {{ topic.name }}{% else %}proposed sessions{% endif %}</A> {% endfor %} <table> <tr> +{% if multitopic %} <th><a class="nolink" href="" onclick="ts_resortTable(this); return false;">Topic<img class="sortarrow" src="/media/arrowBlank" height="6" width="9"></a></th> +{% endif %} <th><a class="nolink" href="" onclick="ts_resortTable(this); return false;">Title<img class="sortarrow" src="/media/arrowBlank" height="6" width="9"></a> @@ -33,7 +35,9 @@ Session suggestion is now closed. </tr> {% for proposal in proposals %} <tr> +{% if multitopic %} <td>{{ proposal.topic.name }}</td> +{% endif %} <td> <a href="/cfp/details/{{ proposal.id }}">{{ proposal.title }}</a> </td> diff --git a/cfp/templates/topiclist.html b/cfp/templates/topiclist.html index c3b9b57..6424350 100644 --- a/cfp/templates/topiclist.html +++ b/cfp/templates/topiclist.html @@ -13,7 +13,7 @@ {% block content %} <script type="text/javascript" src="/media/sorting.js"></script> <div class="span-8"> -<h2>{{ topic.name }}</h2> +<h2>{% if multitopic %}{{ topic.name }}{% else %}Review proposed sessions{% endif %}</h2> <a class=roundedButton href=/>Back to proposals list</A> {% if sched %} <a class=roundedButton href="/scheduling/{{ topic.id }}">Scheduling</A> @@ -22,7 +22,9 @@ </div> <table> <tr> +{% if multitopic %} <th>Topic</th> +{% endif %} <th><a class="nolink" href="" onclick="ts_resortTable(this); return false;">Title<img class="sortarrow" src="/media/arrowBlank" height="6" width="9"></a> @@ -37,6 +39,7 @@ </tr> {% for proposal in proposals %} <tr> +{% if multitopic %} <td> {% if proposal.scheduled %} {{ proposal.topic.name }} @@ -44,6 +47,7 @@ <a href="/cfp/switch/{{ proposal.id }}">{{ proposal.topic.name }}</a> {% endif %} </td> +{% endif %} <td> <a href="/cfp/details/{{ proposal.id }}">{{ proposal.title }}</a> </td> diff --git a/cfp/views.py b/cfp/views.py index f5d779b..15745e0 100644 --- a/cfp/views.py +++ b/cfp/views.py @@ -30,17 +30,20 @@ from cfp.utils import linkify, is_editable, topiclead @login_required def list(request): + multitopic = Topic.objects.count() > 1 proposals = Proposal.objects.all() reviewable_topics = Topic.objects.filter( lead_username=request.user.username) request.session['lastlist'] = "" return TemplateResponse(request, "cfplist.html", {'proposals': proposals, + 'multitopic': multitopic, 'reviewable_topics': reviewable_topics}) @login_required def topiclist(request, topicid): + multitopic = Topic.objects.count() > 1 topic = Topic.objects.get(id=topicid) if not topiclead(request.user, topic): return HttpResponseForbidden("Forbidden") @@ -48,6 +51,7 @@ def topiclist(request, topicid): request.session['lastlist'] = "cfp/topic/%s" % topicid return TemplateResponse(request, "topiclist.html", {'proposals': proposals, + 'multitopic': multitopic, 'sched': 'scheduling' in settings.INSTALLED_APPS, 'topic': topic})