Niklas Brachmann
11 years ago
4 changed files with 101 additions and 63 deletions
@ -1,33 +1,35 @@
@@ -1,33 +1,35 @@
|
||||
{% extends "cash/base.html" %} |
||||
{% load url from future %} |
||||
{% load static %} |
||||
{% load i18n %} |
||||
|
||||
|
||||
{% block content %} |
||||
|
||||
{% trans "Category" %}: |
||||
<ul> |
||||
<li {% if not category %}style="font-weight: bold"{% endif %}><a href="{% url 'products' %}">{% trans "All categories" %}</a></li> |
||||
<ul class="nav nav-tabs"> |
||||
<li {% if not category %}class="active"{% endif %}><a href="{% url 'products' %}">{% trans "All categories" %}</a></li> |
||||
{% for c in categories %} |
||||
<li {% if c == category %}style="font-weight: bold"{% endif %}><a href="{% url 'products' %}{{c.id}}">{{ c.name }}</a></li> |
||||
<li {% if c == category %}class="active"{% endif %}><a href="{% url 'products' %}{{c.id}}">{{ c.name }}</a></li> |
||||
{% endfor %} |
||||
</ul> |
||||
|
||||
<!-- Ugly workaround --> |
||||
<br/> |
||||
|
||||
<table> |
||||
<thead> |
||||
<tr><td>{% trans "Name" %}</td><td>{% trans "price" %}</td><td>{% trans "Actions" %}</td></tr> |
||||
</thead> |
||||
<div class="row"> |
||||
{% for p in product_list %} |
||||
<tr> |
||||
<td>{{ p.name }}</td> |
||||
<td>{{ p.price|floatformat:2 }} €</td> |
||||
<td> |
||||
<a class="btn btn-default" href="{% url 'buy' p.id %}">{% trans "Buy" %}</a> |
||||
<div class="col-xs-12 col-md-3"> |
||||
<div class="thumbnail"> |
||||
<img src="{% if p.image_thumbnail %}{{ p.image_thumbnail.url }}{% else %}{% static "images/no-image.png" %}{% endif %}" alt="{% trans "Product image" %}" style="width: 100%" /> |
||||
<div class="caption"> |
||||
<h3>{{ p.name }}</h3> |
||||
<h4>{{ p.price|floatformat:2 }} €</h4> |
||||
<a class="btn btn-primary" href="{% url 'buy' p.id %}">{% trans "Buy" %}</a> |
||||
<a class="btn btn-default" href="{% url 'product' p.id %}">{% trans "Details" %}</a> |
||||
</td> |
||||
</tr> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endfor %} |
||||
</table> |
||||
</div> |
||||
|
||||
{% endblock %} |
||||
|
Loading…
Reference in new issue