make rounds visible on start page

master
Gesche 3 years ago
parent af2825fda8
commit 02e1677c0d

@ -8,11 +8,12 @@
<h1>Geschichten!</h1> <h1>Geschichten!</h1>
{% if latest_story_round_list %} <h2>Offene Runden</h2>
{% if open_story_round_list %}
<ul> <ul>
{% for question in latest_story_round_list %} {% for story in open_story_round_list %}
<li><a href="/polls/{{ story.id }}"></a></li> <li><a href="{% url 'writing:redirect_story_part' story_pk=story.pk %}">{{ story.name }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>

@ -11,9 +11,10 @@ from writingtogether.models import Story, StoryPart, StoryRound, Participant
class IndexView(generic.ListView): class IndexView(generic.ListView):
template_name = 'writingtogether/index.html' template_name = 'writingtogether/index.html'
context_object_name = 'latest_story_round_list' context_object_name = 'open_story_round_list'
def get_queryset(self): def get_queryset(self):
# TODO: show open & finished rounds
return StoryRound.objects.order_by('-created')[:5] return StoryRound.objects.order_by('-created')[:5]

Loading…
Cancel
Save