Restore and lock in shop app, admin sidebar, media routing, and Stripe

This commit is contained in:
Zach committed 2026-11-24 18:31:31 +00:00
1 parent 93d83a0d63
commit 3cfea85499
15 files changed
+486 -73

No files matched your search

+11 -3
View File
@@ -30,14 +30,22 @@
<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>
<a class="cta" href="{{ variant.paypal_url }}">Buy {{ variant.get_format_display }} on PayPal →</a>
{% 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 product.legacy_checkout %}<a class="cta" href="{{ product.legacy_checkout }}">Buy on PayPal →</a>
{% else %}<p class="shop-format">Currently unavailable</p>{% endif %}
{% 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>
+1 -1
View File
@@ -1 +1 @@
{% if chapter.cover %}<figure id="chapter-cover" class="reactable-cover chapter-art"><img src="{{ chapter.cover.url }}" alt=""><figcaption>React to the chapter cover{% include 'reaction-strip.html' with group=cover_reactions reaction_for='React to chapter cover art' %}</figcaption></figure>{% endif %}
{% if chapter.cover %}<figure id="chapter-cover" class="reactable-cover chapter-art"><img src="{{ chapter.cover.url }}" alt="Chapter cover" fetchpriority="high" decoding="async"><figcaption>React to the chapter cover{% include 'reaction-strip.html' with group=cover_reactions reaction_for='React to chapter cover art' %}</figcaption></figure>{% endif %}
+34 -19
View File
@@ -3,30 +3,34 @@
{% block content %}<main class="section reader manaa-reader">
{% if frames %}
<section class="reading-deck" data-reader data-direction="{{ chapter.reader_direction }}" aria-label="ManaA reader">
<div class="reading-heading"><h1><span class="kicker">#{{ chapter.number|stringformat:"03d" }}</span> {{ chapter.title|slx_brand }}</h1>{% include "view-eye.html" with views=chapter.public_views %}<a href="#discussion">Discussion ↓</a></div>
<div class="reading-tools" data-reader-tools hidden>
<button type="button" class="fan-button reading-fullscreen" data-fullscreen aria-pressed="false">⛶ Fullscreen</button>
<div class="reading-move" aria-label="Page navigation">
<button type="button" class="fan-button" data-step="{% if chapter.reader_direction == 'rtl' %}1{% else %}-1{% endif %}" aria-label="{% if chapter.reader_direction == 'rtl' %}Next pages{% else %}Previous pages{% endif %}">←</button>
<span data-page-output aria-live="polite"></span>
<button type="button" class="fan-button" data-step="{% if chapter.reader_direction == 'rtl' %}-1{% else %}1{% endif %}" aria-label="{% if chapter.reader_direction == 'rtl' %}Previous pages{% else %}Next pages{% endif %}">→</button>
</div>
<label class="reading-view">View <select data-reader-mode>
<option value="double" selected>Double page</option><option value="single">Single page</option><option value="scroll">Scroll</option>
</select></label>
<div class="reading-zoom" aria-label="Zoom controls">
<button type="button" class="fan-button" data-zoom="-1" aria-label="Zoom out">−</button>
<button type="button" class="fan-button" data-zoom="0" aria-label="Reset zoom to fit">Fit</button>
<button type="button" class="fan-button" data-zoom="1" aria-label="Zoom in">+</button>
</div>
<div class="reading-heading">
<a class="reading-icon" href="{% url 'chapters' %}" aria-label="Chapter archive">‹</a>
<h1><span class="kicker">#{{ chapter.number|stringformat:"03d" }}</span> {{ chapter.title|slx_brand }}</h1>
<a class="reading-icon" href="#discussion" aria-label="Discussion" title="Discussion"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" aria-hidden="true"><path d="M4 4h16v12H9l-5 4z"/></svg></a>
<details class="reading-settings" data-reader-settings hidden>
<summary class="reading-icon" aria-label="Reading settings" title="Reading settings">⚙</summary>
<div class="reading-settings-panel">
<label class="reading-view">Reading mode <select data-reader-mode>
<option value="double" selected>Double page</option><option value="single">Single page</option><option value="scroll">Scroll</option>
</select></label>
<small>{{ chapter.get_reader_direction_display }}</small>
<div class="reading-zoom" aria-label="Zoom controls">
<button type="button" class="fan-button" data-zoom="-1" aria-label="Zoom out">−</button>
<button type="button" class="fan-button" data-zoom="0" aria-label="Reset zoom to fit">Fit</button>
<button type="button" class="fan-button" data-zoom="1" aria-label="Zoom in">+</button>
</div>
<label><input type="checkbox" data-reader-reactions> Show page reactions</label>
<button type="button" class="fan-button reading-fullscreen" data-fullscreen aria-pressed="false">⛶ Fullscreen</button>
</div>
</details>
</div>
<div class="reading-window" data-reader-window tabindex="0" aria-label="Chapter art. Swipe, drag horizontally, or use the arrow keys to turn fitted pages. Scroll or swipe to explore zoomed artwork.">
<div class="reading-window" data-reader-window tabindex="0" aria-label="Chapter art. Tap an edge, swipe, or use the arrow keys to turn fitted pages. Scroll or swipe to explore zoomed artwork.">
<div class="reading-strip">
{% for frame in frames %}
<div class="reading-frame frame-{{ frame.kind }}" data-frame="{{ frame.kind }}">
{% for page in frame.pages %}
<figure data-page data-number="{{ page.number }}" id="page-{{ page.number }}" class="reactable-page">
<img src="{{ page.art.url }}" alt="{% if frame.kind == 'cover' %}Chapter cover{% elif frame.kind == 'spread' %}Double spread, page {{ page.number }}{% else %}Page {{ page.number }}{% endif %}" {% if not forloop.first or not forloop.parentloop.first %}loading="lazy"{% endif %} decoding="async">
<img src="{{ page.art.url }}" alt="{% if frame.kind == 'cover' %}Chapter cover{% elif frame.kind == 'spread' %}Double spread, page {{ page.number }}{% else %}Page {{ page.number }}{% endif %}" {% if not forloop.first or not forloop.parentloop.first %}loading="lazy"{% else %}fetchpriority="high"{% endif %} decoding="async">
<figcaption>{% if frame.kind == 'cover' %}Cover{% elif frame.kind == 'spread' %}Double spread · Page {{ page.number }}{% else %}Page {{ page.number }}{% endif %}
{% include 'reaction-strip.html' with group=page.reactions reaction_for='React to chapter page art' %}</figcaption>
</figure>
@@ -37,9 +41,20 @@
{% endfor %}
<div data-reader-end aria-hidden="true"></div>
</div></div>
<div class="reading-tools" data-reader-tools hidden>
<div class="reading-move" aria-label="Page navigation">
<button type="button" class="fan-button" data-step="{% if chapter.reader_direction == 'rtl' %}1{% else %}-1{% endif %}" aria-label="{% if chapter.reader_direction == 'rtl' %}Next pages{% else %}Previous pages{% endif %}">←</button>
<div class="reading-position">
<input type="range" min="1" max="1" value="1" data-reader-scrubber aria-label="Jump to a page or spread">
<span data-page-output aria-live="polite"></span>
</div>
<button type="button" class="fan-button" data-step="{% if chapter.reader_direction == 'rtl' %}-1{% else %}1{% endif %}" aria-label="{% if chapter.reader_direction == 'rtl' %}Previous pages{% else %}Next pages{% endif %}">→</button>
</div>
</div>
{% include 'chapter-finish.html' %}
</section>
{% else %}<h1>{{ chapter.title|slx_brand }}</h1>{% include "view-eye.html" with views=chapter.public_views %}<p>No pages have been posted for this chapter yet.</p>{% endif %}
{% else %}<h1>{{ chapter.title|slx_brand }}</h1><p>No pages have been posted for this chapter yet.</p>{% endif %}
<div class="reading-chapter-stats">{% include "view-eye.html" with views=chapter.public_views %}</div>
{% if chapter.summary %}<p>{{ chapter.summary|slx_brand }}</p>{% endif %}
<nav class="actions" aria-label="Chapter navigation">
{% if previous_chapter %}<a class="cta secondary" href="{% url 'chapter' previous_chapter.number %}">Previous chapter</a>{% endif %}
+17
View File
@@ -0,0 +1,17 @@
{% extends 'base.html' %}
{% block title %}Shop checkout · SLUMP X LAND{% endblock %}
{% block content %}
<main class="section article theme-shop">
{% if unavailable %}
<h1>Checkout is temporarily unavailable</h1>
<p>Please return to the shop and try again.</p>
{% elif paid %}
<h1>Payment confirmed</h1>
<p>Thank you for your order.</p>
{% else %}
<h1>Waiting for payment confirmation</h1>
<p>Refresh this page in a moment to check the status. If Stripe accepted your payment, you don’t need to pay again.</p>
{% endif %}
<a class="cta" href="{% url 'books' %}">Back to the shop</a>
</main>
{% endblock %}
+4
View File
@@ -0,0 +1,4 @@
<form class="shop-stripe-form" method="post" action="{% url 'shop-stripe-checkout' product_id variant_id %}">
{% csrf_token %}
<button class="cta" type="submit">Buy with Stripe →</button>
</form>