Add templates for wishlist app

newer-dal
LEdoian 4 years ago
parent 05088bdbdf
commit 5612f788da

@ -0,0 +1,7 @@
{% extends 'base.html' %}
{% block content %}
<h1>Item: {{ object.name }}</h1>
<p class=description>{{ object.description }}</p>
{% endblock %}

@ -0,0 +1,13 @@
{% extends 'base.html' %}
{% block content %}
<h1>Wishlist of user {{ user }}</h1>
{% if object_list %}
<ul>
{% for item in object_list %}
<li>{{ item }}
{% endfor %}
</ul>
{% else %}
<p>This wishlist is empty</p>
{% endif %}
{% endblock %}

@ -0,0 +1,19 @@
{% extends 'base.html' %}
{% block content %}
<h1>Wishlist {{ wishlist.name }}</h1>
{% if wishlist.description %}
<p class=description>{{ wishlist.description }}</p>
{% endif %}
{% if object_list %}
<ul>
{% for item in object_list %}
{# TODO: Implement checkboxes and hidden items #}
<li>{{ item }}
{% endfor %}
</ul>
{% else %}
<p>This wishlist is empty</p>
{% endif %}
{% endblock %}

@ -4,11 +4,11 @@ import django.views.generic as dv
class WishedItemView(dv.DetailView): class WishedItemView(dv.DetailView):
model = m.WishedItem model = m.WishedItem
template_name = ... template_name = 'wishlist/item.html'
class UserWishLists(dv.ListView): class UserWishLists(dv.ListView):
model = m.WishList model = m.WishList
template_name = ... template_name = 'wishlist/userwishlists.html'
def get_queryset(self): def get_queryset(self):
qs = super().get_queryset() qs = super().get_queryset()
@ -16,7 +16,7 @@ class UserWishLists(dv.ListView):
class WishListView(dv.ListView): class WishListView(dv.ListView):
model = m.WishedItem model = m.WishedItem
template_name = ... template_name = 'wishlist/wishlist.html'
def get_queryset(self): def get_queryset(self):
qs = super().get_queryset() qs = super().get_queryset()

Loading…
Cancel
Save