forked from rDrama/rDrama
more hat shit
parent
0839077838
commit
48affb53e6
|
@ -4876,7 +4876,7 @@ code {
|
||||||
.noshadow {
|
.noshadow {
|
||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
}
|
}
|
||||||
[role="button"] {
|
[role="button"], [onclick] {
|
||||||
cursor: pointer !important;
|
cursor: pointer !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
from sqlalchemy import *
|
from sqlalchemy import *
|
||||||
from sqlalchemy.orm import relationship
|
from sqlalchemy.orm import relationship
|
||||||
from files.__main__ import Base
|
from files.__main__ import Base
|
||||||
|
from files.helpers.lazy import lazy
|
||||||
|
from flask import g
|
||||||
|
|
||||||
class HatDef(Base):
|
class HatDef(Base):
|
||||||
__tablename__ = "hat_defs"
|
__tablename__ = "hat_defs"
|
||||||
|
@ -13,6 +15,11 @@ class HatDef(Base):
|
||||||
|
|
||||||
author = relationship("User", primaryjoin="HatDef.author_id == User.id")
|
author = relationship("User", primaryjoin="HatDef.author_id == User.id")
|
||||||
|
|
||||||
|
@property
|
||||||
|
@lazy
|
||||||
|
def number_sold(self):
|
||||||
|
return g.db.query(Hat).filter_by(hat_id=self.id).count()
|
||||||
|
|
||||||
class Hat(Base):
|
class Hat(Base):
|
||||||
__tablename__ = "hats"
|
__tablename__ = "hats"
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th role="button" onclick="sort_table(2)" style="text-align:right;">Truescore</th>
|
<th onclick="sort_table(2)" style="text-align:right;">Truescore</th>
|
||||||
<th role="button" onclick="sort_table(3)" style="text-align:right;">Mod actions</th>
|
<th onclick="sort_table(3)" style="text-align:right;">Mod actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,12 @@
|
||||||
<table class="table table-striped mb-5">
|
<table class="table table-striped mb-5">
|
||||||
<thead class="bg-primary text-white">
|
<thead class="bg-primary text-white">
|
||||||
<tr>
|
<tr>
|
||||||
<th role="button" onclick="sort_table(0)">#</th>
|
<th onclick="sort_table(0)">#</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Image</th>
|
<th>Image</th>
|
||||||
<th>Description</th>
|
<th>Description</th>
|
||||||
<th role="button" onclick="sort_table(4)">#</th>
|
<th onclick="sort_table(4)">#</th>
|
||||||
<th role="button" onclick="sort_table(4)">Rarity</th>
|
<th onclick="sort_table(4)">Rarity</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,12 @@
|
||||||
<th scope="col">Description</th>
|
<th scope="col">Description</th>
|
||||||
{% if SITE == 'rdrama.net' %}
|
{% if SITE == 'rdrama.net' %}
|
||||||
<th scope="col">Author</th>
|
<th scope="col">Author</th>
|
||||||
|
<th scope="col" onclick="sort_table(4)">Number Sold</th>
|
||||||
|
<th scope="col" onclick="sort_table(5)">Price</th>
|
||||||
|
{% else %}
|
||||||
|
<th scope="col" onclick="sort_table(3)">Number Sold</th>
|
||||||
|
<th scope="col" onclick="sort_table(4)">Price</th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<th scope="col">Price</th>
|
|
||||||
<th scope="col">Actions</th>
|
<th scope="col">Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -42,6 +46,7 @@
|
||||||
{% if SITE == 'rdrama.net' %}
|
{% if SITE == 'rdrama.net' %}
|
||||||
<td><a style="color:#{{user.name_color}}" href="/@{{user.username}}"><img loading="lazy" src="{{user.profile_url}}" class="pp20"><span {% if user.patron %}class="patron" style="background-color:#{{user.name_color}}"{% endif %}>{{user.username}}</span></a></td>
|
<td><a style="color:#{{user.name_color}}" href="/@{{user.username}}"><img loading="lazy" src="{{user.profile_url}}" class="pp20"><span {% if user.patron %}class="patron" style="background-color:#{{user.name_color}}"{% endif %}>{{user.username}}</span></a></td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<td>{{hat.number_sold}}</td>
|
||||||
<td>{{hat.price}}</td>
|
<td>{{hat.price}}</td>
|
||||||
<td class="shop-table-actions">
|
<td class="shop-table-actions">
|
||||||
{% if hat.id == v.equipped_hat.id %}
|
{% if hat.id == v.equipped_hat.id %}
|
||||||
|
@ -61,6 +66,7 @@
|
||||||
{% if SITE == 'rdrama.net' %}
|
{% if SITE == 'rdrama.net' %}
|
||||||
<td><a style="color:#{{user.name_color}}" href="/@{{user.username}}"><img loading="lazy" src="{{user.profile_url}}" class="pp20"><span {% if user.patron %}class="patron" style="background-color:#{{user.name_color}}"{% endif %}>{{user.username}}</span></a></td>
|
<td><a style="color:#{{user.name_color}}" href="/@{{user.username}}"><img loading="lazy" src="{{user.profile_url}}" class="pp20"><span {% if user.patron %}class="patron" style="background-color:#{{user.name_color}}"{% endif %}>{{user.username}}</span></a></td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<td>{{hat.number_sold}}</td>
|
||||||
<td>{{hat.price}}</td>
|
<td>{{hat.price}}</td>
|
||||||
<td class="shop-table-actions">
|
<td class="shop-table-actions">
|
||||||
<a id="buy1-{{hat.id}}" class="btn btn-success {% if v.coins < hat.price %}disabled{% endif %}" role="button" onclick="this.classList.add('d-none');document.getElementById('buy1-go-{{hat.id}}').classList.remove('d-none')"><span class="m-auto">Buy</span></a>
|
<a id="buy1-{{hat.id}}" class="btn btn-success {% if v.coins < hat.price %}disabled{% endif %}" role="button" onclick="this.classList.add('d-none');document.getElementById('buy1-go-{{hat.id}}').classList.remove('d-none')"><span class="m-auto">Buy</span></a>
|
||||||
|
@ -84,4 +90,5 @@
|
||||||
|
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
{% endblock %}
|
<script src="/assets/js/sort_table.js?v=244"></script>
|
||||||
|
{% endblock %}
|
|
@ -19,8 +19,8 @@
|
||||||
<thead class="bg-primary text-white">
|
<thead class="bg-primary text-white">
|
||||||
<tr>
|
<tr>
|
||||||
<th>User</th>
|
<th>User</th>
|
||||||
<th role="button" onclick="sort_table(1)">User Truescore</th>
|
<th onclick="sort_table(1)">User Truescore</th>
|
||||||
<th role="button" onclick="sort_table(2)">Vote Time</th>
|
<th onclick="sort_table(2)">Vote Time</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
<th scope="col">Icon</th>
|
<th scope="col">Icon</th>
|
||||||
<th scope="col">Title</th>
|
<th scope="col">Title</th>
|
||||||
<th scope="col">Price</th>
|
<th scope="col">Price</th>
|
||||||
<th scope="col">Owned</th>
|
<th scope="col" onclick="sort_table(3)">Owned</th>
|
||||||
<th scope="col">Buy</th>
|
<th scope="col">Buy</th>
|
||||||
<th scope="col">Description</th>
|
<th scope="col">Description</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -80,4 +80,5 @@
|
||||||
|
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
|
<script src="/assets/js/sort_table.js?v=244"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th role="button" onclick="sort_table(2)">Posts</th>
|
<th onclick="sort_table(2)">Posts</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{%-
|
{%-
|
||||||
set CACHE_VER = {
|
set CACHE_VER = {
|
||||||
'css/main.css': 502,
|
'css/main.css': 503,
|
||||||
'css/catalog.css': 2,
|
'css/catalog.css': 2,
|
||||||
|
|
||||||
'css/4chan.css': 61,
|
'css/4chan.css': 61,
|
||||||
|
|
|
@ -31,8 +31,8 @@
|
||||||
<thead class="bg-primary text-white">
|
<thead class="bg-primary text-white">
|
||||||
<tr>
|
<tr>
|
||||||
<th>User</th>
|
<th>User</th>
|
||||||
<th role="button" onclick="sort_table(1)">User Truescore</th>
|
<th onclick="sort_table(1)">User Truescore</th>
|
||||||
<th role="button" onclick="sort_table(2)">Vote Time</th>
|
<th onclick="sort_table(2)">Vote Time</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
|
@ -59,8 +59,8 @@
|
||||||
<thead class="bg-primary text-white">
|
<thead class="bg-primary text-white">
|
||||||
<tr>
|
<tr>
|
||||||
<th>User</th>
|
<th>User</th>
|
||||||
<th role="button" onclick="sort_table(1)">User Truescore</th>
|
<th onclick="sort_table(1)">User Truescore</th>
|
||||||
<th role="button" onclick="sort_table(2)">Vote Time</th>
|
<th onclick="sort_table(2)">Vote Time</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue