new _kit_bag_panel.html partial in core to allow user to manage equipped kit items from anywhere on site; #id_kit_btn moved from _footer.html partial directly into a base.html include; new trinket for superusers now incl. in apps.lyric.models; apps.gameboard.views handles this new type of PASS token; apps.epic.views allows payment with several different token types based on rarity & expiration hierarchy; kit bag and PASS functionality now handled in apps.dashboard.views; /kit-bag/ now pathed in .urls; styles abound; fully passing test suite (tho much work to be done, chiefly with stacking like coins in FEFO order)
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
48
src/templates/core/_partials/_kit_bag_panel.html
Normal file
48
src/templates/core/_partials/_kit_bag_panel.html
Normal file
@@ -0,0 +1,48 @@
|
||||
{% if tokens %}
|
||||
<div class="kit-bag-section">
|
||||
<span class="kit-bag-label">Trinkets</span>
|
||||
<div class="kit-bag-row">
|
||||
{% for token in tokens %}
|
||||
{% if token.token_type == "coin" or token.token_type == "pass" %}
|
||||
<div
|
||||
class="kit-card"
|
||||
draggable="true"
|
||||
data-token-id="{{ token.id }}"
|
||||
data-token-type="{{ token.token_type }}"
|
||||
>
|
||||
{% if token.token_type == "coin" %}
|
||||
<i class="fa-solid fa-medal"></i>
|
||||
{% else %}
|
||||
<i class="fa-solid fa-clipboard"></i>
|
||||
{% endif %}
|
||||
<span class="kit-card-label">{{ token.tooltip_name }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="kit-bag-section">
|
||||
<span class="kit-bag-label">Tokens</span>
|
||||
<div class="kit-bag-row">
|
||||
{% for token in tokens %}
|
||||
{% if token.token_type == "Free" or token.token_type == "tithe" %}
|
||||
<div
|
||||
class="kit-card"
|
||||
draggable="true"
|
||||
data-token-id="{{ token.id }}"
|
||||
data-token-type="{{ token.token_type }}"
|
||||
>
|
||||
{% if token.token_type == "Free" %}
|
||||
<i class="fa-solid fa-coins"></i>
|
||||
{% else %}
|
||||
<i class="fa-solid fa-piggy-bank"></i>
|
||||
{% endif %}
|
||||
<span class="kit-card-label">{{ token.tooltip_name }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="kit-bag-empty">Kit bag empty.</p>
|
||||
{% endif %}
|
||||
@@ -50,10 +50,18 @@
|
||||
|
||||
{% include "core/_partials/_footer.html" %}
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
<button id="id_kit_btn" data-kit-url="{% url 'kit_bag' %}" aria-label="Open Kit Bag">
|
||||
<i class="fa-solid fa-briefcase"></i>
|
||||
</button>
|
||||
{% endif %}
|
||||
<dialog id="id_kit_bag_dialog"></dialog>
|
||||
|
||||
{% block scripts %}
|
||||
{% endblock scripts %}
|
||||
<script src="{% static "vendor/htmx.min.js" %}"></script>
|
||||
<script src="{% static "apps/scripts/applets.js" %}"></script>
|
||||
<script src="{% static "apps/scripts/game-kit.js" %}"></script>
|
||||
<script>
|
||||
document.body.addEventListener('htmx:configRequest', function(evt) {
|
||||
evt.detail.headers['X-CSRFToken'] = getCookie('csrftoken');
|
||||
|
||||
Reference in New Issue
Block a user