forked from rDrama/rDrama
shop
parent
38a7632c25
commit
48d909e015
|
@ -146,7 +146,8 @@ def shop(v):
|
||||||
elif v.patron == 4: val["price"] = int(val["price"]*0.75)
|
elif v.patron == 4: val["price"] = int(val["price"]*0.75)
|
||||||
else: val["price"] = int(val["price"]*0.70)
|
else: val["price"] = int(val["price"]*0.70)
|
||||||
|
|
||||||
return render_template("settings_shop.html", owned=owned, awards=list(AWARDS.values()), v=v)
|
sales = g.db.query(Vote.id).count() + g.db.query(CommentVote.id).count() - g.db.query(func.sum(User.coins)).scalar()
|
||||||
|
return render_template("shop.html", owned=owned, awards=list(AWARDS.values()), v=v, sales=sales)
|
||||||
|
|
||||||
|
|
||||||
@app.post("/buy/<award>")
|
@app.post("/buy/<award>")
|
||||||
|
|
|
@ -268,11 +268,13 @@
|
||||||
|
|
||||||
<body id="{% if request.path != '/comments' %}{% block pagetype %}frontpage{% endblock %}{% endif %}" style="overflow-x: hidden; {% if v and v.background %} background:url(/assets/images/backgrounds/{{v.background}}) no-repeat center center fixed !important; background-size: cover!important; background-color: #000!important;{% endif %} {% if 'rama' in request.host %}margin-top: 29px!important;{% endif %}">
|
<body id="{% if request.path != '/comments' %}{% block pagetype %}frontpage{% endblock %}{% endif %}" style="overflow-x: hidden; {% if v and v.background %} background:url(/assets/images/backgrounds/{{v.background}}) no-repeat center center fixed !important; background-size: cover!important; background-color: #000!important;{% endif %} {% if 'rama' in request.host %}margin-top: 29px!important;{% endif %}">
|
||||||
|
|
||||||
{% if '@' not in request.path %}
|
{% block Banner %}
|
||||||
<a rel="nofollow noopener noreferrer" href="{% if 'rama' in request.host %}https://secure.transequality.org/site/Donation2?df_id=1480{% else %}/{% endif %}">
|
{% if '@' not in request.path %}
|
||||||
<img loading="lazy" style="margin-top: -3px;" src="/assets/images/{{'SITE_NAME' | app_config}}/{% if v %}banner.gif{% else %}cached.gif{% endif %}" width="100%">
|
<a rel="nofollow noopener noreferrer" href="{% if 'rama' in request.host %}https://secure.transequality.org/site/Donation2?df_id=1480{% else %}/{% endif %}">
|
||||||
</a>
|
<img loading="lazy" style="margin-top: -3px;" src="/assets/images/{{'SITE_NAME' | app_config}}/{% if v %}banner.gif{% else %}cached.gif{% endif %}" width="100%">
|
||||||
{% endif %}
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% include "header.html" %}
|
{% include "header.html" %}
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
|
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
|
||||||
<a class="nav-link" href="/settings/shop" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" data-bs-original-title="Shop"><i class="fas fa-store"></i></a>
|
<a class="nav-link" href="/shop" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" data-bs-original-title="Shop"><i class="fas fa-store"></i></a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-item d-flex align-items-center justify-content-center text-center">
|
<li class="nav-item d-flex align-items-center justify-content-center text-center">
|
||||||
|
|
|
@ -56,8 +56,8 @@
|
||||||
</button>
|
</button>
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<button type="button" class="col px-0 mr-3 btn btn-dead m-0" style="background: None !important; border: None;">
|
<button type="button" class="col px-0 mr-3 btn btn-dead m-0" style="background: None !important; border: None;">
|
||||||
<a href="/settings/shop" class="text-decoration-none" role="button">
|
<a href="/shop" class="text-decoration-none" role="button">
|
||||||
<div class="text-center {% if request.path=='/settings/shop' %}text-primary{% else %}text-muted{% endif %}">
|
<div class="text-center {% if request.path=='/shop' %}text-primary{% else %}text-muted{% endif %}">
|
||||||
<i class="fas fa-store text-lg"></i>
|
<i class="fas fa-store text-lg"></i>
|
||||||
<div class="text-small">Shop</div>
|
<div class="text-small">Shop</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -128,7 +128,7 @@
|
||||||
<a class="nav-link{% if request.path=='/settings/apps' %} active{% endif %}" href="/settings/apps">Apps</a>
|
<a class="nav-link{% if request.path=='/settings/apps' %} active{% endif %}" href="/settings/apps">Apps</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link{% if 'shop' in request.path %} active{% endif %}" href="/settings/shop">Shop</a>
|
<a class="nav-link{% if 'shop' in request.path %} active{% endif %}" href="/shop">Shop</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@
|
||||||
<a class="nav-link{% if request.path=='/settings/apps' %} active{% endif %} navsettings" href="/settings/apps"><i class="fas fa-code text-base mr-0"></i></a>
|
<a class="nav-link{% if request.path=='/settings/apps' %} active{% endif %} navsettings" href="/settings/apps"><i class="fas fa-code text-base mr-0"></i></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link{% if 'shop' in request.path %} active{% endif %} navsettings" href="/settings/shop"><i class="fas fa-store text-base mr-0"></i></a>
|
<a class="nav-link{% if 'shop' in request.path %} active{% endif %} navsettings" href="/shop"><i class="fas fa-store text-base mr-0"></i></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,101 @@
|
||||||
|
{% extends "default.html" %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
<title>Shop</title>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block pagetype %}message{% endblock %}
|
||||||
|
|
||||||
|
{% block Banner %}
|
||||||
|
<header class="text-center">
|
||||||
|
<img src="/assets/images/shop.gif" width="50%">
|
||||||
|
<h3 class="mt-4">Stir drama. Earn coins.</h3>
|
||||||
|
<h5 class="mt-4">Total sales: {{sales}} dramacoins</h3>
|
||||||
|
</header>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{% if error %}
|
||||||
|
<div class="alert alert-danger alert-dismissible fade show my-3" role="alert">
|
||||||
|
<i class="fas fa-exclamation-circle my-auto"></i>
|
||||||
|
<span>
|
||||||
|
{{error}}
|
||||||
|
</span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true"><i class="far fa-times"></i></span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% if msg %}
|
||||||
|
<div class="alert alert-success alert-dismissible fade show my-3" role="alert">
|
||||||
|
<i class="fas fa-check-circle my-auto" aria-hidden="true"></i>
|
||||||
|
<span>
|
||||||
|
{{msg}}
|
||||||
|
</span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true"><i class="far fa-times"></i></span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<pre></pre>
|
||||||
|
<pre></pre>
|
||||||
|
<h5>Owned Awards</h5>
|
||||||
|
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead class="bg-primary text-white">
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Icon</th>
|
||||||
|
<th scope="col">Title</th>
|
||||||
|
<th scope="col">Description</th>
|
||||||
|
<th scope="col">Owned</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for a in owned %}
|
||||||
|
<tr>
|
||||||
|
<td><i class="{{a['icon']}} {{a['color']}}" style="font-size: 30px"></i></td>
|
||||||
|
<td style="font-weight: bold">{{a['title']}}</td>
|
||||||
|
<td style="font-weight: bold">{{a['description']}}</td>
|
||||||
|
<td style="font-weight: bold">{{a['owned_num']}}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
|
||||||
|
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<h5>Shop</h5>
|
||||||
|
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead class="bg-primary text-white">
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Icon</th>
|
||||||
|
<th scope="col">Title</th>
|
||||||
|
<th scope="col">Description</th>
|
||||||
|
<th scope="col">Price</th>
|
||||||
|
<th scope="col">Buy</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for a in awards %}
|
||||||
|
<tr>
|
||||||
|
<td><i class="{{a['icon']}} {{a['color']}}" style="font-size: 30px"></i></td>
|
||||||
|
<td style="font-weight: bold">{{a['title']}}</td>
|
||||||
|
<td style="font-weight: bold">{{a['description']}}</td>
|
||||||
|
<td style="font-weight: bold">{{a['price']}}</td>
|
||||||
|
{% set kind = a['kind'] %}
|
||||||
|
<td style="font-weight: bold"><a class="btn btn-success" href="javascript:void(0)" onclick="post_toast('/buy/{{kind}}')">Buy</a></td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
<pre>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</pre>
|
||||||
|
{% endblock %}
|
Loading…
Reference in New Issue