MarseyWorld/files/templates/hats.html

106 lines
4.7 KiB
HTML

{% extends "default.html" %}
{% block pagetitle %}Hats{% endblock %}
{% block pagetype %}message{% endblock %}
{% block banner %}
<div class="container-fluid bg-white sticky shop-tabs" style="padding-bottom: 0 !important;">
<div class="row box-shadow-bottom">
<div class="col p-0">
<div class="container" style="padding-bottom: 0;">
<div class="row box-shadow-bottom bg-white" style="justify-content: center;">
<a class="btn btn-primary btn-block m-0 shop-tab" href="/shop/awards">
<span class="mr-auto ml-auto"><i class="fas fa-gift mr-2"></i>AWARDS</span>
</a>
<a class="btn btn-primary btn-block m-0 shop-tab active" href="/shop/hats">
<span class="mr-auto ml-auto"><i class="fas fa-hat-cowboy mr-2"></i>HATS</span>
</a>
</div>
</div>
</div>
</div>
</div>
<header id="shop-header" class="container text-center pb-0">
<img loading="lazy" id="shop-banner" class="mt-5" alt="shop banner" src="{{SITE_FULL_IMAGES}}/i/hats.webp?x=6">
<ul id="shop-stats" class="my-1 my-md-2">
<li class="mt-2">Number of hats you bought: {{v.num_of_owned_hats}}</li>
<li>Number of hats you designed: {{v.num_of_designed_hats}}</li>
<li>Coins you spent on hats: {{"{:,}".format(v.coins_spent_on_hats)}}</li>
<li>Number of hats: {{num_of_hats}}</li>
<li>Total hat sales: {{"{:,}".format(sales)}}</li>
<li>Your current coins: {{"{:,}".format(v.coins)}}</li>
{% if FEATURES['MARSEYBUX'] %}
<li>Your current marseybux: {{"{:,}".format(v.marseybux)}}</li>
{% endif %}
</ul>
</header>
{% endblock %}
{% block content %}
<script defer src="{{'js/hats.js' | asset}}"></script>
<div class="overflow-x-auto mt-3 mb-5">
<table class="table table-striped shop">
<thead class="bg-primary text-white">
<tr>
<th class="disable-sort-click">Hat</th>
<th class="disable-sort-click" {% if sort=="name" %}disabled{% endif %}><a href="?sort=name">Name</a></th>
<th class="disable-sort-click" {% if sort=="description" %}disabled{% endif %}><a href="?sort=description">Description</a></th>
{% if SITE == 'rdrama.net' %}
<th class="disable-sort-click" {% if sort=="author" %}disabled{% endif %}><a href="?sort=author">Author</a></th>
{% endif %}
<th class="disable-sort-click" {% if sort=="owners" %}disabled{% endif %}><a href="?sort=owners">Owners</a></th>
<th class="disable-sort-click" {% if sort=="price" %}disabled{% endif %}><a href="?sort=price">Price</a></th>
<th class="disable-sort-click">Actions</th>
<th class="disable-sort-click" {% if sort=="added_on" %}disabled{% endif %}><a href="?sort=added_on">Added on</a></th>
</tr>
</thead>
<tbody>
{% for item in hats %}
{% if SITE == 'rdrama.net' %}
{% set hat = item[0] %}
{% set user = item[1] %}
{% else %}
{% set hat = item %}
{% endif %}
<tr>
<td>
<div class="profile-pic-75-wrapper mt-4">
<img loading="lazy" alt="avatar" src="{{v.profile_url}}" class="profile-pic-75">
<img loading="lazy" alt="{{hat.name}}" class="profile-pic-75-hat" src="{{SITE_FULL_IMAGES}}/i/hats/{{hat.name}}.webp?x=6">
</div>
</td>
<td>{{hat.name}}</td>
<td>{{hat.censored_description(v)}}</td>
{% if SITE == 'rdrama.net' %}
<td>{% include "user_in_table.html" %}</td>
{% endif %}
<td><a href="/hat_owners/{{hat.id}}">{{hat.number_sold}}</a></td>
<td>{{hat.price}}</td>
<td class="shop-table-actions" style="width:unset">
{% if hat.id not in owned_hat_ids and hat.is_purchasable %}
<div id="if-not-owned-{{hat.id}}">
<button type="button" id="buy-{{hat.id}}" class="btn btn-success {% if v.coins+v.marseybux < hat.price %}disabled{% endif %}" data-areyousure="postToastSwitch(this, '/buy_hat/{{hat.id}}', 'if-not-owned-{{hat.id}}', 'if-owned-{{hat.id}}', 'd-none')" data-nonce="{{g.nonce}}" data-onclick="areyousure(this)">Buy</button>
</div>
{% endif %}
<div id="if-owned-{{hat.id}}" {% if hat.id not in owned_hat_ids %}class="d-none"{% endif %}>
<button type="button" id="unequip-{{hat.id}}" class="unequip {% if hat.id not in v.equipped_hat_ids %}d-none{% endif %} btn btn-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this, '/unequip_hat/{{hat.id}}', 'equip-{{hat.id}}', 'unequip-{{hat.id}}', 'd-none')">Unequip</button>
<button type="button" id="equip-{{hat.id}}" class="equip {% if hat.id in v.equipped_hat_ids %}d-none{% endif %} btn btn-success" data-nonce="{{g.nonce}}" data-onclick="equip_hat(this, '{{hat.id}}', '{{hat.name}}')">Equip</button>
</div>
</td>
<td data-time="{{hat.created_utc}}"></td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
{% block pagenav %}
{% include "pagination.html" %}
{% endblock %}