make rounds visible on start page

This commit is contained in:
Gesche 2021-04-19 00:19:32 +02:00
parent af2825fda8
commit 02e1677c0d
2 changed files with 6 additions and 4 deletions

View File

@ -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>

View File

@ -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]