Add mark to unvoted movies
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
5221094333
commit
a573b80f09
@ -4,7 +4,7 @@
|
|||||||
<h1>Watchlist</h1>
|
<h1>Watchlist</h1>
|
||||||
<ul>
|
<ul>
|
||||||
{% for movie in object_list %}
|
{% for movie in object_list %}
|
||||||
<li><a href="{% url 'watchlist:detail' movie.id %}">{{movie.name}}</a> — {{movie.score}}</li>
|
<li><a href="{% url 'watchlist:detail' movie.id %}">{{movie.name}}</a>{% if movie in voted_movies %}<sup>*</sup>{% endif %} — {{movie.score}}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% if can_add_movie %}
|
{% if can_add_movie %}
|
||||||
|
@ -44,6 +44,7 @@ class IndexView(generic.ListView):
|
|||||||
def get_context_data(self):
|
def get_context_data(self):
|
||||||
context = super().get_context_data()
|
context = super().get_context_data()
|
||||||
context['can_add_movie'] = self.request.user.has_perm("watchlist.add_movie")
|
context['can_add_movie'] = self.request.user.has_perm("watchlist.add_movie")
|
||||||
|
context['voted_movies'] = models.Movie.objects.filter(movievote__user=self.request.user)
|
||||||
return context
|
return context
|
||||||
|
|
||||||
class DetailView(generic.DetailView):
|
class DetailView(generic.DetailView):
|
||||||
|
Loading…
Reference in New Issue
Block a user