bornhack-website/src/shop/templates/product_detail.html

86 lines
1.9 KiB
HTML
Raw Normal View History

2016-05-19 09:19:51 +00:00
{% extends 'shop_base.html' %}
2016-05-14 17:20:47 +00:00
{% load bootstrap3 %}
{% load commonmark %}
2016-05-31 18:35:20 +00:00
{% load shop_tags %}
2016-05-06 20:33:59 +00:00
2016-07-05 16:46:32 +00:00
{% block title %}
{{ product.name }} | {{ block.super }}
{% endblock %}
2016-05-19 09:19:51 +00:00
{% block shop_content %}
2016-05-06 20:33:59 +00:00
2016-05-30 18:56:03 +00:00
<div class="row">
2016-05-30 22:58:11 +00:00
<div class="col-sm-12 col-md-8">
<h2>{{ product.name }}</h2>
{{ product.description|trustedcommonmark }}
</div>
2016-05-30 18:56:03 +00:00
2016-05-30 22:58:11 +00:00
<div class="col-sm-12 col-md-4">
2016-05-30 18:56:03 +00:00
2016-05-31 18:35:20 +00:00
<h3>
<small>Price</small><br />
{{ product.price|currency }}<br />
2016-05-31 18:35:20 +00:00
</h3>
<hr />
{% if product.stock_amount and product.is_time_available %}
<h3>
<small>Availability</small><br />
{% if product.left_in_stock > 0 %}
<bold>{{ product.left_in_stock }}</bold> available<br />
{% else %}
<bold>Sold out.</bold><br />
{% endif %}
</h3>
<hr />
{% endif %}
{% if product.is_stock_available %}
<h3>{% if already_in_order %}Update order{% else %}Add to order{% endif %}</h3>
{% if already_in_order %}<p>You already have this product in your order.</p>{% endif %}
2016-05-30 18:56:03 +00:00
{% if user.is_authenticated %}
{% if product.is_available %}
2016-05-30 18:56:03 +00:00
<form method="POST">
{% csrf_token %}
{% bootstrap_form form %}
<button type="submit" class="btn btn-primary">
{% if already_in_order %}Update{% else %}Add{% endif %}
</button>
</form>
2016-05-30 18:56:03 +00:00
{% else %}
2016-05-30 18:56:03 +00:00
<p>
{% if product.is_old %}
This product is not available anymore.
{% elif product.is_upcoming %}
This product is available from
{{ product.available_in.lower|date:"Y-m-d H:i T" }}
{% endif %}
</p>
2016-05-30 18:56:03 +00:00
{% endif %}
2016-05-30 18:56:03 +00:00
{% else %}
<a href="{% url 'account_signup' %}?next={% url 'shop:product_detail' slug=product.slug %}">
Signup</a> or
<a href="{% url 'account_login' %}?next={% url 'shop:product_detail' slug=product.slug %}">
login</a>
to order this product
{% endif %}
2016-05-30 18:56:03 +00:00
{% endif %}
</div>
2016-05-30 18:56:03 +00:00
</div>
2016-06-03 19:02:05 +00:00
{% endblock %}