jean-marie/backend/templates/userwishlist.html

61 lines
2.3 KiB
HTML

{% extends "authorized.html" %}
{% block title %}User Wishlist{% endblock %}
{% block center %}
{% if my_wishlist %}
<h1>My Wishlist</h1>
{% else %}
<h1>{{ person.given_name }} Wishlist</h1>
{% endif %}
<br />
<h2>List</h2>
{% if my_wishlist %}
<a href="/userwishlist/add/{{ user.id }}">Add</a>
{% endif %}
<div class="table-responsive overflow-auto">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th scope="col">Item</th>
<th scope="col">Link</th>
<th scope="col">State</th>
<th scope="col">Action</th>
</tr>
</thead>
<tbody>
{% for person_wishlist_item in person_wishlist_items %}
<tr>
{% if my_wishlist %}
<td><a href="/userwishlist/edit/{{ person_wishlist_item.id }}">{{ person_wishlist_item.item }}</a></td>
{% else %}
<td>{{ person_wishlist_item.item }}</td>
{% endif %}
<td><a href="{{ person_wishlist_item.item_url }}">URL</a></td>
{% if person_wishlist_item.received_at > 0 %}
<td>Got it!</td>
{% else %}
<td>Not yet!</td>
{% endif %}
{% if my_wishlist %}
{% if person_wishlist_item.received_at > 0 %}
<td><a href="/userwishlist/delete/{{ person_wishlist_item.id }}">Delete</a></td>
{% else %}
<td><a href="/userwishlist/received/{{ person_wishlist_item.id }}">Received</a></td>
{% endif %}
{% else %}
{% if person_wishlist_item.purchased_by == user.id %}
<td><a href="/userwishlist/returned/{{ person_wishlist_item.id }}">Return</a></td>
{% else if person_wishlist_item.purchased_by > 0 %}
<td>Purchased</td>
{% else %}
<td><a href="/userwishlist/bought/{{ person_wishlist_item.id }}">Bought</a></td>
{% endif %}
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock center %}