You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
xmrauctions/web/templates/items/list_items.html

74 lines
2.3 KiB
HTML

{% extends 'base.html' %}
{% block content %}
<section id="main" class="wrapper">
<div class="container">
<header class="major">
<h2>View Items</h2>
{% if request.user.is_authenticated %}
<a href="{% url 'list_items' %}?mine=true" class="button">Your Items</a>
<a href="{% url 'list_items' %}" class="button alt">All Items</a>
<form method="GET" enctype="multipart/form-data" action="">
{% for field in search_form %}
<div class="fieldWrapper">
{{ field.errors }}
{{ field.label_tag }} {{ field }}
{% if field.help_text %}
<p class="help">{{ field.help_text|safe }} <i class="fa fa-search"></i></p>
{% endif %}
</div>
{% endfor %}
</form>
{% endif %}
</header>
<div id="item-search"></div>
{% if items %}
<table class="table">
<tr>
<th>ID</th>
<th>Whereabouts</th>
<th>Name</th>
<th>List Date</th>
<th>Asking Price (XMR)</th>
</tr>
{% for item in items %}
<tr class="{% if item.owner == request.user %}item-mine{% endif %}">
<td>#{{ item.id }}</td>
<td><a href="https://duckduckgo.com/?q={{ item.whereabouts }}" target="_blank">{{ item.whereabouts }}</a></td>
<td><a href="{% url 'get_item' item.id %}">{{ item.name }}</a></td>
<td>{{ item.list_date | date:"d M, Y H:i:s" }}</td>
<td>{{ item.ask_price_xmr }}</td>
</tr>
{% endfor %}
</table>
{% else %}
<p>No results from the search. Try again!</p>
{% endif %}
</div>
</section>
{% if items.has_other_pages %}
<ul class="pagination">
{% if items.has_previous %}
<li><a href="?{{ request.GET.urlencode }}&page={{ items.previous_page_number }}">&laquo;</a></li>
{% else %}
<li class="disabled"><span>&laquo;</span></li>
{% endif %}
{% for i in items.paginator.page_range %}
{% if items.number == i %}
<li class="active"><span>{{ i }} <span class="sr-only"></span></span></li>
{% else %}
<li><a href="?{{ request.GET.urlencode }}&page={{ i }}">{{ i }}</a></li>
{% endif %}
{% endfor %}
{% if items.has_next %}
<li><a href="?{{ request.GET.urlencode}}&page={{ items.next_page_number }}">&raquo;</a></li>
{% else %}
<li class="disabled"><span>&raquo;</span></li>
{% endif %}
</ul>
{% endif %}
{% endblock %}