Fix product detail template a bit for mobile.

This commit is contained in:
Víðir Valberg Guðmundsson 2016-05-30 22:28:17 +02:00
parent a4b578642d
commit 539b3ee105

View file

@ -1,54 +1,48 @@
{% extends 'shop_base.html' %}
{% load bootstrap3 %}
{% load commonmark %}
{% block shop_content %}
<div class="col-md-8">
<div class="row">
<h2>{{ product.name }}</h2>
</div>
<div class="row">
<p>
{{ product.description }}
</p>
</div>
<div class="col-xs-12 col-md-8">
<h2>{{ product.name }}</h2>
{{ product.description|commonmark }}
</div>
<div class="col-xs-12 col-md-4">
<h3>Add to order</h3>
{% if user.is_authenticated %}
{% if product.is_available %}
<form method="POST">
{% csrf_token %}
{% bootstrap_form form %}
{% bootstrap_button "Add to order" button_type="submit" button_class="btn-primary" %}
</form>
{% else %}
<p>
This product is available from
{{ product.available_in.lower|date:"Y-m-d H:i" }}
</p>
{% endif %}
{% 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 %}
{% endblock %}
</div>
</div>
<div class="col-md-4">
<h3>Add to order</h3>
{% if user.is_authenticated %}
{% if product.is_available %}
<form method="POST">
{% csrf_token %}
{% bootstrap_form form %}
{% bootstrap_button "Add to order" button_type="submit" button_class="btn-primary" %}
</form>
{% else %}
<p>
This product is available from
{{ product.available_in.lower|date:"Y-m-d H:i" }}
</p>
{% endif %}
{% 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 %}
{% endblock %}
</div>