71 lines
2.8 KiB
HTML
71 lines
2.8 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 data-toggle="table" class="table table-striped table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th data-sortable="true" data-field="item" scope="col">Item</th>
|
|
<th scope="col">Link</th>
|
|
<th data-sortable="true" data-field="state" 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 %}
|
|
|
|
{% if person_wishlist_item.item_url.len() > 0 %}
|
|
<td><a href="{{ person_wishlist_item.item_url }}">URL</a></td>
|
|
{% else %}
|
|
<td></td>
|
|
{% endif %}
|
|
|
|
{% match person_wishlist_item.received_at %}
|
|
{% when None %}
|
|
<td>Not yet!</td>
|
|
{% when Some with (received_at) %}
|
|
<td>Got it!</td>
|
|
{% endmatch %}
|
|
|
|
{% if my_wishlist %}
|
|
{% match person_wishlist_item.received_at %}
|
|
{% when None %}
|
|
<td><a href="/userwishlist/received/{{ person_wishlist_item.id }}">Received</a></td>
|
|
{% when Some with (received_at) %}
|
|
<td><a href="/userwishlist/delete/{{ person_wishlist_item.id }}">Delete</a></td>
|
|
{% endmatch %}
|
|
{% else %}
|
|
{% match person_wishlist_item.purchased_by %}
|
|
{% when Some with (purchased_by) %}
|
|
{% if purchased_by.clone() == user.id %}
|
|
<td><a href="/userwishlist/returned/{{ person_wishlist_item.id }}">Return</a></td>
|
|
{% else %}
|
|
<td>Purchased</td>
|
|
{% endif %}
|
|
{% when None %}
|
|
<td><a href="/userwishlist/bought/{{ person_wishlist_item.id }}">Bought</a></td>
|
|
{% endmatch %}
|
|
{% endif %}
|
|
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endblock center %} |