Files
slump-x-land-studio/templates/books.html
T

58 lines
3.2 KiB
HTML

{% extends 'base.html' %}{% load slx_brand static %}
{% block title %}Shop · SLUMP X LAND{% endblock %}
{% block scripts %}<script defer src="{% static 'shop.js' %}"></script>{% endblock %}
{% block content %}
<main class="section theme-shop product-shop">
<p class="kicker">{{ "SLUMP X LAND"|slx_brand }} · OFFICIAL SHOP</p><h1>Shop</h1>
{% if product_groups %}
<nav class="shop-categories" aria-label="Product categories">
{% for group in product_groups %}<a href="#shop-{{ group.key }}">{{ group.name }}</a>{% endfor %}
</nav>
{% endif %}
{% for group in product_groups %}
<section class="shop-group" aria-labelledby="shop-{{ group.key }}">
<div class="section-head"><h2 id="shop-{{ group.key }}">{{ group.name }}</h2></div>
<div class="shop-grid">
{% for product in group.products %}
<article class="card shop-product" data-product>
<header>
<h3>{{ product.title|slx_brand }}</h3>
{% if product.description %}<p>{{ product.description|slx_brand|linebreaksbr }}</p>{% endif %}
</header>
{% if product.store_variants %}
<label class="shop-variant-label" hidden>
<strong>Choose a format or option</strong>
<select data-variant-picker>
{% for variant in product.store_variants %}<option value="{{ variant.pk }}">{{ variant }}</option>{% endfor %}
</select>
</label>
{% for variant in product.store_variants %}
<section class="shop-option" data-variant-panel="{{ variant.pk }}">
{% include 'shop-image.html' with primary=variant.art fallback=product.cover title=product.title only %}
<p class="shop-format">{{ variant }}{% if variant.price_usd != None %} <span>· ${{ variant.price_usd|floatformat:"2" }}</span>{% endif %}</p>
{% if stripe_shop_ready and variant.price_usd >= 0.50 %}
{% include 'shop-stripe-button.html' with product_id=product.pk variant_id=variant.pk %}
{% endif %}
{% if variant.paypal_url %}<a class="cta secondary" href="{{ variant.paypal_url }}">Buy {{ variant.get_format_display }} on PayPal →</a>
{% elif not stripe_shop_ready or not variant.price_usd or variant.price_usd < 0.50 %}<p class="shop-format">Currently unavailable</p>{% endif %}
</section>
{% endfor %}
{% else %}
<section class="shop-option">
{% include 'shop-image.html' with primary=product.cover title=product.title only %}
{% if not product.variants.exists and stripe_shop_ready and product.price_usd >= 0.50 %}
<p class="shop-format">${{ product.price_usd|floatformat:"2" }}</p>
{% include 'shop-stripe-button.html' with product_id=product.pk variant_id=0 %}
{% endif %}
{% if product.legacy_checkout %}<a class="cta secondary" href="{{ product.legacy_checkout }}">Buy on PayPal →</a>
{% elif product.variants.exists or not stripe_shop_ready or not product.price_usd or product.price_usd < 0.50 %}<p class="shop-format">Currently unavailable</p>{% endif %}
</section>
{% endif %}
</article>
{% endfor %}
</div>
</section>
{% empty %}<p>No products are listed right now.</p>{% endfor %}
</main>
{% endblock %}