rDrama/files/templates/hats.html

143 lines
5.7 KiB
HTML
Raw Normal View History

{% extends "default.html" %}
2022-11-19 22:20:38 +00:00
{% block pagetitle %}Hats{% endblock %}
{% block pagetype %}message{% endblock %}
[DO NOT MERGE] titlesssssssssss (#468) * titles * testing * self * Revert "self" This reverts commit d6c12d5a5ba125feb44673f55e1fdac75f151cb5. * Revert "testing" This reverts commit 86d800f9fd552196b31f0e0b3891d4fc072a9bc0. * testing on devrama * rewrite the html head * reference error or smth idk * tempalte debug * template debug redux * default2 * rename default2 -> root, page title * fix settings2 * include the set_variables block * root scope variables 2 * test 3 * remove unnecessary set * add pagetitles to all settings2 pages * add pagetitle to casino * remove bloat * remove duplicate site name thingy * page titles 2 * page titles 3 * remove duplicate imports and add page titles everywhere iirc * ok but actually this time * remove unnecessary newlines * fix title lol * > * fsdfsfsfsfsfs * fsfs * template configurations * fix 500 * reduce login template bloat * move files and add status codes where needful * move authfroms to login * remove 2fa bloat * verification code * sign up fixes * readability * fssfsfsfs * move forgot password to login/ * readability * don't emit comments * add page titles where needful * gsgsgs * modals: move to respective pages * testing on devrama * get home garbage out of title * remove insane amount of icon duplication * sign up text * add votes pagetitle * fix blank lines * Revert "fix blank lines" This reverts commit b2c54339970725d00b6fc82bb458c1757909952c. * Fix blank lines on sign_up.html. * title: votes.html more meaningful identifier. * titles: Lottery, Directory, Notifications * head final in submission.html * fix missing comma * > * test * title: /comments * fsfsfsfsf * titles: user_cards * head: only load video and audio meta attributes if they actually exist * titlessssss: /admin/lottery/participants * titlessssssss: extra quote in search.html * titlessssss: userpage voters. * titties: /h/<sub>/{followers,blockers,exilees[sic]} * test banner * Revert "test banner" This reverts commit c3d875d03f3e60d72a60dab7d28bf108554a5826. * make submit.html inherit from default.html Co-authored-by: TLSM <duolsm@outlook.com>
2022-11-21 08:52:22 +00:00
{% block banner %}
2022-11-30 20:03:32 +00:00
<style nonce="{{g.nonce}}">
2022-09-19 18:30:54 +00:00
.shop-tabs {
padding-top: 50px;
}
2022-09-08 16:02:53 +00:00
@media (max-width: 768px) {
#hats-banner {
width: 80%;
}
2022-09-19 18:30:54 +00:00
.shop-tabs {
padding-top: 30px;
}
2022-09-08 16:02:53 +00:00
}
2022-09-18 17:12:28 +00:00
.shop-tab {
display: inline-flex;
max-width: 46.6%;
letter-spacing: 3px;
2022-09-19 18:30:54 +00:00
border-radius: 0;
2022-09-18 17:12:28 +00:00
}
.shop-tab.active {
background-color: var(--primary) !important;
pointer-events: none !important;
cursor: default !important;
}
2022-09-08 16:02:53 +00:00
</style>
2022-09-19 18:30:54 +00:00
<div class="container-fluid bg-white sticky shop-tabs" style="padding-bottom: 0 !important;">
2022-09-18 17:12:28 +00:00
<div class="row box-shadow-bottom">
2022-09-19 18:30:54 +00:00
<div class="col p-0">
2022-09-18 17:12:28 +00:00
<div class="container" style="padding-bottom: 0;">
<div class="row box-shadow-bottom bg-white" style="justify-content: center;">
2022-09-19 18:30:54 +00:00
<a class="btn btn-primary btn-block m-0 shop-tab" href="/shop">
2022-09-18 17:12:28 +00:00
<span class="mr-auto ml-auto"><i class="fas fa-gift mr-2"></i>AWARDS</span>
</a>
2022-09-19 18:30:54 +00:00
<a class="btn btn-primary btn-block m-0 shop-tab active" href="/hats">
2022-09-18 17:12:28 +00:00
<span class="mr-auto ml-auto"><i class="fas fa-hat-cowboy mr-2"></i>HATS</span>
</a>
</div>
</div>
</div>
</div>
</div>
2022-09-03 01:11:10 +00:00
<header class="container pb-1 text-center">
2022-09-08 16:02:53 +00:00
<img id="hats-banner" class="mt-5" alt="hats banner" src="/i/hats.webp?v=1" width="50%">
2022-09-03 18:50:20 +00:00
<h5 class="mt-4">Number of hats you bought: {{v.num_of_owned_hats}}</h5>
<h5 class="mt-4">Number of hats you designed: {{v.num_of_designed_hats}}</h5>
2022-09-10 06:43:38 +00:00
<h5 class="mt-4">Coins you spent on hats: {{"{:,}".format(v.coins_spent_on_hats)}}</h5>
<h5 class="mt-4">Total hat sales: {{"{:,}".format(sales)}}</h5>
2022-09-08 18:36:43 +00:00
<h5 class="mt-4">Number of hats: {{num_of_hats}}</h5>
2022-09-03 01:11:10 +00:00
</header>
{% endblock %}
{% block content %}
2022-11-30 20:03:32 +00:00
<script nonce="{{g.nonce}}">
function equip_hat(t, hat_id, hat_name) {
const profile_pic_hat = document.getElementById("profile-pic-35-hat");
function extra_actions(xhr) {
if(xhr.status == 200) {
2022-09-20 21:22:58 +00:00
profile_pic_hat.src = `/i/hats/${hat_name}.webp?h=7`
profile_pic_hat.classList.remove('d-none')
}
}
postToastSwitch(t, `/equip_hat/${hat_id}`, `equip-${hat_id}`, `unequip-${hat_id}`, `d-none`, extra_actions)
}
</script>
<div class="overflow-x-auto mt-1 mb-5">
<table class="table table-striped shop">
<thead class="bg-primary text-white">
<tr>
<th scope="col">Hat</th>
<th scope="col">Name</th>
<th scope="col">Description</th>
2022-11-11 13:52:18 +00:00
{% if SITE == 'rdrama.net' %}
{% if request.values.get("sort") == 'author_asc' %}
<th scope="col"><a href="?sort=author_desc">Author</a></th>
{% else %}
2022-09-05 08:32:52 +00:00
<th scope="col"><a href="?sort=author_asc">Author</a></th>
{% endif %}
2022-09-03 19:36:50 +00:00
<th scope="col" onclick="sort_table(4)">Owners</th>
2022-09-03 03:04:51 +00:00
<th scope="col" onclick="sort_table(5)">Price</th>
2022-09-18 17:18:44 +00:00
<th scope="col">Actions</th>
<th scope="col" onclick="sort_table(7)">Added on</th>
2022-09-03 03:04:51 +00:00
{% else %}
2022-09-03 19:36:50 +00:00
<th scope="col" onclick="sort_table(3)">Owners</th>
2022-09-03 03:04:51 +00:00
<th scope="col" onclick="sort_table(4)">Price</th>
2022-09-18 17:18:44 +00:00
<th scope="col">Actions</th>
<th scope="col" onclick="sort_table(6)">Added on</th>
{% endif %}
</tr>
</thead>
2022-09-03 22:07:59 +00:00
<tbody>
2022-09-03 19:11:02 +00:00
{% for hat, user in hats %}
<tr>
2022-09-06 01:47:14 +00:00
<td>
2022-09-06 07:03:14 +00:00
<div class="profile-pic-75-wrapper mt-4">
2022-10-29 21:42:30 +00:00
<img loading="lazy" alt="avatar" src="{{v.profile_url}}" class="profile-pic-75">
2022-09-20 21:22:58 +00:00
<img loading="lazy" alt="{{hat.name}}" class="profile-pic-75-hat" src="/i/hats/{{hat.name}}.webp?h=7">
2022-09-06 01:47:14 +00:00
</div>
</td>
<td>{{hat.name}}</td>
2022-09-03 22:07:59 +00:00
<td style="word-break:break-word">{{hat.censored_description(v)}}</td>
2022-11-11 13:52:18 +00:00
{% if SITE == 'rdrama.net' %}
2022-09-05 03:01:06 +00:00
<td>{% include "user_in_table.html" %}</td>
{% endif %}
[DO NOT MERGE] import detanglation (#442) * move Base definition to files.classes.__init__.py * fix ImportError * move userpage listing to users.py * don't import the app from classes * consts: set default values to avoid crashes consts: warn if the secret key is the default config value * card view: sneed (user db schema) * cloudflare: use DEFAULT_CONFIG_VALUE * const: set default values * decouple media.py from __main__ * pass database to avoid imports * import cleanup and import request not in const, but in the requests mega import * move asset_submissions site check to __init__ * asset submissions feature flag * flag * g.is_tor * don't import request where it's not needed * i think this is fine * mail: move to own routes and helper * wrappers * required wrappers move * unfuck wrappers a bit * move snappy quotes and marseys to stateful consts * marsify * :pepodrool: * fix missing import * import cache * ...and settings.py * and static.py * static needs cache * route * lmao all of the jinja shit was in feeds.py amazing * classes should only import what they need from flask * import Response * hdjbjdhbhjf * ... * dfdfdfdf * make get a non-required import * isort imports (mostly) * but actually * configs * reload config on import * fgfgfgfg * config * config * initialize snappy and test * cookie of doom debug * edfjnkf * xikscdfd * debug config * set session cookie domain, i think this fixes the can't login bug * sdfbgnhvfdsghbnjfbdvvfghnn * hrsfxgf * dump the entire config on a request * kyskyskyskyskyskyskyskyskys * duifhdskfjdfd * dfdfdfdfdfdfdfdfdfdfdfdf * dfdfdfdf * imoprt all of the consts beacuse fuck it * 😭 * dfdfdfdfdfdfsdasdf * print the entire session * rffdfdfjkfksj * fgbhffh * not the secret keys * minor bug fixes * be helpful in the warning * gfgfgfg * move warning lower * isort main imports (i hope this doesn't fuck something up) * test * session cookie domain redux * dfdfdfd * try only importing Flask * formkeys fix * y * :pepodrool: * route helper * remove before flight * dfdfdfdfdf * isort classes * isort helpers * move check_for_alts to routehelpers and also sort imports and get rid of unused ones * that previous commit but actkally * readd the cache in a dozen places they were implicitly imported * use g.is_tor instead of request.headers. bla bla bla * upgrade streamers to their own route file * get rid of unused imports in __main__ * fgfgf * don't pull in the entire ORM where we don't need it * features * explicit imports for the get helper * explicit imports for the get helper redux * testing allroutes * remove unused import * decouple flask from classes * syntax fix also remember these have side fx for some reason (why?) * move side effects out of the class * posts * testing on devrama * settings * reloading * settingssdsdsds * streamer features * site settings * testing settings on devrama * import * fix modlog * remove debug stuff * revert commit 67275b21ab6e2f2520819e84d10bfc1c746a15b6 * archiveorg to _archiveorg * skhudkfkjfd * fix cron for PCM * fix bugs that snekky wants me to * Fix call to realbody passing db, standardize kwarg * test * import check_for_alts from the right place * cloudflare * testing on devrama * fix cron i think * shadow properly * tasks * Remove print which will surely be annoying in prod. * v and create new session * use files.classes * make errors import little and fix rare 500 in /allow_nsfw * Revert "use files.classes" This reverts commit 98c10b876cf86ce058b7fb955cf1ec0bfb9996c6. * pass v to media functions rather than using g * fix * dfdfdfdfd * cleanup, py type checking is dumb so don't use it where it causes issues * Fix some merge bugs, add DEFAULT_RATELIMIT to main. * Fix imports on sqlalchemy expressions. * `from random import random` is an error. * Fix replies db param. * errors: fix missing import * fix rare 500: only send to GIFT_NOTIF_ID if it exists, and send them the right text * Fix signup formkey. * fix 2 500s * propagate db to submissions * fix replies * dfdfdfdf * Fix verifiedcolor. * is_manual * can't use getters outside of an app context * don't attempt to do gumroad on sites where it's not enabled * don't attempt to do gumraod on sites's where it's unnecessary * Revert "don't attempt to do gumroad on sites where it's not enabled" This reverts commit 6f8a6331878655492dfaf1907b27f8be513c14d3. * fix 500 * validate media type Co-authored-by: TLSM <duolsm@outlook.com>
2022-11-15 09:19:08 +00:00
<td><a href="/hat_owners/{{hat.id}}">{{hat.number_sold(g.db)}}</a></td>
<td>{{hat.price}}</td>
2022-09-03 22:07:59 +00:00
<td class="shop-table-actions" style="width:unset">
2022-11-01 03:37:52 +00:00
{% if hat.id not in owned_hat_ids and hat.is_purchasable %}
2022-09-03 19:11:02 +00:00
<div id="if-not-owned-{{hat.id}}">
2022-11-28 04:35:33 +00:00
<button type="button" id="buy1-{{hat.id}}" class="btn btn-success {% if v.coins < hat.price %}disabled{% endif %}" data-click2="postToastSwitch(this, '/buy_hat/{{hat.id}}', 'if-not-owned-{{hat.id}}', 'if-owned-{{hat.id}}', 'd-none', (xhr)=>{if(xhr.status == 200)document.getElementById('user-coins-amount').innerHTML-={{hat.price}}})" onclick="areyousure(this)"><span class="m-auto">Buy</span></button>
{% if FEATURES['MARSEYBUX'] %}
2022-11-28 04:35:33 +00:00
<button type="button" id="buy2-{{hat.id}}" class="marseybux btn btn-success {% if v.marseybux < hat.price %}disabled{% endif %}" data-click2="postToastSwitch(this, '/buy_hat/{{hat.id}}?mb=true', 'if-not-owned-{{hat.id}}', 'if-owned-{{hat.id}}', 'd-none', (xhr)=>{if(xhr.status == 200)document.getElementById('user-bux-amount').innerHTML-={{hat.price}}})" onclick="areyousure(this)"><span class="m-auto">MBux</span></button>
2022-09-03 19:11:02 +00:00
{% endif %}
</div>
{% endif %}
2022-09-03 19:11:02 +00:00
<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" onclick="postToastSwitch(this, '/unequip_hat/{{hat.id}}', 'equip-{{hat.id}}', 'unequip-{{hat.id}}', 'd-none')"><span class="m-auto">Unequip</span></button>
2022-10-28 23:35:14 +00:00
<button type="button" id="equip-{{hat.id}}" class="equip {% if hat.id in v.equipped_hat_ids %}d-none{% endif %} btn btn-success" onclick="equip_hat(this, '{{hat.id}}', '{{hat.name}}')"><span class="m-auto">Equip</span></button>
2022-09-03 19:11:02 +00:00
</div>
</td>
2022-09-18 17:18:44 +00:00
<td data-time="{{hat.created_utc}}"></td>
</tr>
{% endfor %}
</tbody>
</table>
<script defer src="{{'js/sort_table.js' | asset}}"></script>
2022-09-03 22:07:59 +00:00
{% endblock %}