forked from rDrama/rDrama
master
parent
647f941bc5
commit
975096147b
|
@ -68,10 +68,11 @@ def shop(v):
|
||||||
for row in (r._asdict() for r in query):
|
for row in (r._asdict() for r in query):
|
||||||
kind = row['last_award_kind']
|
kind = row['last_award_kind']
|
||||||
if kind in AWARDS.keys():
|
if kind in AWARDS.keys():
|
||||||
owned.append((AWARDS[kind], row['last_award_count']))
|
award = AWARDS[kind]
|
||||||
|
award["owned_num"] = row['last_award_count']
|
||||||
|
|
||||||
print(owned)
|
print(owned)
|
||||||
return render_template("shop.html", owned=owned.values(), awards=list(AWARDS.values()), v=v)
|
return render_template("shop.html", owned=owned, awards=list(AWARDS.values()), v=v)
|
||||||
|
|
||||||
@app.post("/buy/<award>")
|
@app.post("/buy/<award>")
|
||||||
@auth_required
|
@auth_required
|
||||||
|
|
|
@ -33,23 +33,26 @@
|
||||||
|
|
||||||
<pre></pre>
|
<pre></pre>
|
||||||
<pre></pre>
|
<pre></pre>
|
||||||
<h5>Owned</h5>
|
<h5>Owned Awards</h5>
|
||||||
|
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead class="bg-primary text-white">
|
<thead class="bg-primary text-white">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">Icon</th>
|
<th scope="col">Icon</th>
|
||||||
<th scope="col">Title</th>
|
<th scope="col">Title</th>
|
||||||
|
<th scope="col">Description</th>
|
||||||
<th scope="col">Number</th>
|
<th scope="col">Number</th>
|
||||||
|
<th scope="col">Owned</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for a in awards %}
|
{% for a in owned %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><i class="{{a['icon']}} {{a['color']}}" style="font-size: 30px"></i></td>
|
<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['title']}}</td>
|
||||||
|
<td style="font-weight: bold">{{a['description']}}</td>
|
||||||
<td style="font-weight: bold">{{a['price']}}</td>
|
<td style="font-weight: bold">{{a['price']}}</td>
|
||||||
{% set kind = a['kind'] %}
|
<td style="font-weight: bold">{{a['owned_num']}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
@ -66,6 +69,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">Icon</th>
|
<th scope="col">Icon</th>
|
||||||
<th scope="col">Title</th>
|
<th scope="col">Title</th>
|
||||||
|
<th scope="col">Description</th>
|
||||||
<th scope="col">Price</th>
|
<th scope="col">Price</th>
|
||||||
<th scope="col">Buy</th>
|
<th scope="col">Buy</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -75,6 +79,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td><i class="{{a['icon']}} {{a['color']}}" style="font-size: 30px"></i></td>
|
<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['title']}}</td>
|
||||||
|
<td style="font-weight: bold">{{a['description']}}</td>
|
||||||
<td style="font-weight: bold">{{a['price']}}</td>
|
<td style="font-weight: bold">{{a['price']}}</td>
|
||||||
{% set kind = a['kind'] %}
|
{% 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>
|
<td style="font-weight: bold"><a class="btn btn-success" href="javascript:void(0)" onclick="post_toast('/buy/{{kind}}')">Buy</a></td>
|
||||||
|
|
Loading…
Reference in New Issue