2026-03-14 00:34:07 -04:00
|
|
|
<div
|
|
|
|
|
id="id_gate_wrapper"
|
|
|
|
|
hx-get="{% url 'epic:gate_status' room.id %}"
|
|
|
|
|
hx-trigger="every 3s"
|
|
|
|
|
hx-swap="outerHTML"
|
|
|
|
|
>
|
|
|
|
|
<div class="gate-overlay">
|
|
|
|
|
<div class="gate-modal" role="dialog" aria-label="Gatekeeper">
|
2026-03-14 02:03:44 -04:00
|
|
|
|
2026-03-14 00:34:07 -04:00
|
|
|
<header class="gate-header">
|
|
|
|
|
<h1>{{ room.name }}</h1>
|
2026-03-14 01:14:05 -04:00
|
|
|
<div class="gate-status-wrap">
|
|
|
|
|
<span class="gate-status-text">{{ room.get_gate_status_display }}</span>
|
|
|
|
|
<span class="status-dots" aria-hidden="true">
|
|
|
|
|
<span></span><span></span><span></span><span></span>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2026-03-14 00:34:07 -04:00
|
|
|
</header>
|
2026-03-13 00:31:17 -04:00
|
|
|
|
2026-03-14 22:00:16 -04:00
|
|
|
<div class="token-slot{% if can_drop %} active{% elif user_reserved_slot %} pending{% elif user_filled_slot %} claimed{% elif token_depleted %} depleted{% else %} locked{% endif %}">
|
2026-03-14 02:03:44 -04:00
|
|
|
{% if can_drop %}
|
|
|
|
|
<form method="POST" action="{% url 'epic:drop_token' room.id %}" style="display:contents">
|
|
|
|
|
{% csrf_token %}
|
|
|
|
|
<button type="submit" class="token-rails" aria-label="Insert token to play">
|
|
|
|
|
<span class="rail"></span>
|
|
|
|
|
<span class="rail"></span>
|
|
|
|
|
</button>
|
|
|
|
|
</form>
|
|
|
|
|
{% else %}
|
|
|
|
|
<div class="token-rails">
|
|
|
|
|
<span class="rail"></span>
|
|
|
|
|
<span class="rail"></span>
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
|
|
|
|
<div class="token-panel">
|
|
|
|
|
<div class="token-denomination">1</div>
|
|
|
|
|
<span class="token-insert-label">INSERT TOKEN TO PLAY</span>
|
2026-03-15 16:08:34 -04:00
|
|
|
<span class="token-return-label">PUSH TO RETURN</span>
|
2026-03-14 02:03:44 -04:00
|
|
|
</div>
|
|
|
|
|
{% if user_can_reject %}
|
2026-03-15 16:08:34 -04:00
|
|
|
<form method="POST" action="{% url 'epic:return_token' room.id %}" style="display:contents">
|
2026-03-14 02:03:44 -04:00
|
|
|
{% csrf_token %}
|
2026-03-15 16:08:34 -04:00
|
|
|
<button type="submit" class="token-return-btn" aria-label="Push to return"></button>
|
2026-03-14 02:03:44 -04:00
|
|
|
</form>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-03-14 22:00:16 -04:00
|
|
|
<div class="gate-slots row">
|
2026-03-14 00:34:07 -04:00
|
|
|
{% for slot in slots %}
|
|
|
|
|
<div
|
2026-03-14 02:03:44 -04:00
|
|
|
class="gate-slot{% if slot.status == 'EMPTY' %} empty{% elif slot.status == 'FILLED' %} filled{% elif slot.status == 'RESERVED' %} reserved{% endif %}"
|
2026-03-14 00:34:07 -04:00
|
|
|
data-slot="{{ slot.slot_number }}"
|
|
|
|
|
>
|
|
|
|
|
<span class="slot-number">{{ slot.slot_number }}</span>
|
|
|
|
|
{% if slot.gamer %}
|
|
|
|
|
<span class="slot-gamer">{{ slot.gamer.email }}</span>
|
|
|
|
|
{% else %}
|
|
|
|
|
<span class="slot-gamer">empty</span>
|
|
|
|
|
{% endif %}
|
2026-03-14 02:03:44 -04:00
|
|
|
{% if slot.status == 'RESERVED' and slot.gamer == request.user %}
|
|
|
|
|
<form method="POST" action="{% url 'epic:confirm_token' room.id %}">
|
2026-03-14 00:34:07 -04:00
|
|
|
{% csrf_token %}
|
2026-03-14 02:03:44 -04:00
|
|
|
{% if is_last_slot %}
|
|
|
|
|
<button type="submit" class="btn btn-primary btn-xl">PICK ROLES</button>
|
|
|
|
|
{% else %}
|
|
|
|
|
<button type="submit" class="btn btn-confirm">OK</button>
|
|
|
|
|
{% endif %}
|
2026-03-14 00:34:07 -04:00
|
|
|
</form>
|
2026-03-14 02:03:44 -04:00
|
|
|
{% endif %}
|
2026-03-14 00:34:07 -04:00
|
|
|
</div>
|
|
|
|
|
{% endfor %}
|
2026-03-13 00:31:17 -04:00
|
|
|
</div>
|
2026-03-14 02:03:44 -04:00
|
|
|
|
2026-03-14 00:34:07 -04:00
|
|
|
{% if request.user == room.owner %}
|
2026-03-14 22:00:16 -04:00
|
|
|
<div class="form-container">
|
|
|
|
|
<h3>Invite Friend</h3>
|
|
|
|
|
<form method="POST" action="{% url 'epic:invite_gamer' room.id %}" style="display:flex; gap:0.5rem; align-items:center;">
|
|
|
|
|
{% csrf_token %}
|
|
|
|
|
<input type="email" name="invitee_email" id="id_invite_email" class="form-control form-control-lg" placeholder="friend@example.com" style="flex:1; min-width:0;" hx-preserve>
|
|
|
|
|
<button type="submit" id="id_invite_btn" class="btn btn-confirm">OK</button>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
2026-03-14 00:34:07 -04:00
|
|
|
{% endif %}
|
2026-03-14 02:03:44 -04:00
|
|
|
|
2026-03-14 00:34:07 -04:00
|
|
|
</div>
|
2026-03-13 00:31:17 -04:00
|
|
|
</div>
|
2026-03-14 00:34:07 -04:00
|
|
|
</div>
|
2026-03-14 02:03:44 -04:00
|
|
|
<script>
|
|
|
|
|
(function () {
|
|
|
|
|
clearInterval(window._gateDots);
|
|
|
|
|
var wrap = document.querySelector('.status-dots');
|
|
|
|
|
if (!wrap) return;
|
|
|
|
|
var dots = wrap.querySelectorAll('span');
|
|
|
|
|
var n = 0;
|
|
|
|
|
window._gateDots = setInterval(function () {
|
|
|
|
|
if (!document.contains(wrap)) { clearInterval(window._gateDots); return; }
|
|
|
|
|
dots.forEach(function (d, i) { d.textContent = i < n ? '.' : ''; });
|
|
|
|
|
n = (n + 1) % 5;
|
|
|
|
|
}, 400);
|
|
|
|
|
}());
|
|
|
|
|
</script>
|