jean-marie/backend/templates/userwishlist.html

51 lines
1.7 KiB
HTML

{% extends "authorized.html" %}
{% block title %}User Profile{% endblock %}
{% block center %}
{% if my_wishlist %}
<h1>My Wishlist</h1>
{% else %}
<h1>{{ user.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 data-toggle="table" class="table table-striped table-bordered">
<thead>
<tr>
<th data-sortable="true" data-field="item" scope="col">Item</th>
<th data-sortable="true" data-field="state" scope="col">State</th>
<th scope="col">Action</th>
</tr>
</thead>
<tbody>
{% for user_wishlist_item in user_wishlist_items %}
<tr>
<td><a href="{{ user_wishlist_item.item_url }}">{{ user_wishlist_item.item }}</a></td>
{% if user_wishlist_item.received_at > 0 %}
<td>Got it!</td>
{% else %}
<td>Not yet!</td>
{% endif %}
{% if my_wishlist %}
{% if user_wishlist_item.received_at > 0 %}
<td>Got it!</td>
{% else %}
<td><a href="/userwishlist/received/{{ user_wishlist_item.id }}">Received</a></td>
{% endif %}
{% else %}
{% if user_wishlist_item.purchased_by > 0 %}
<td>Purchased</td>
{% else %}
<td><a href="/userwishlist/bought/{{ user_wishlist_item.id }}">Bought</a></td>
{% endif %}
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock center %}