add round and total rounds to update view
This commit is contained in:
parent
e09f17bdfb
commit
e5275db8e8
|
@ -5,7 +5,7 @@
|
||||||
<title>Title</title>
|
<title>Title</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<h1>Runde {{ current_round }} / {{ total_rounds }}</h1>
|
||||||
<form action="{% url 'writing:update_story_part' story_round_pk=story_round_pk story_pk=story_pk pk=pk %}" method="post">
|
<form action="{% url 'writing:update_story_part' story_round_pk=story_round_pk story_pk=story_pk pk=pk %}" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{ form.as_p }}
|
{{ form.as_p }}
|
||||||
|
|
|
@ -67,6 +67,10 @@ class StoryPartUpdate(LoginRequiredMixin, UpdateView):
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super(StoryPartUpdate, self).get_context_data(**kwargs)
|
context = super(StoryPartUpdate, self).get_context_data(**kwargs)
|
||||||
|
context.update({
|
||||||
|
'current_round': self.object.turn_number + 1,
|
||||||
|
'total_rounds': self.object.part_of.part_of_round.number_of_rounds
|
||||||
|
})
|
||||||
context.update(self.kwargs)
|
context.update(self.kwargs)
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue