forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-07-30 13:05:20 +02:00
parent c52f65d19e
commit b2b075f96d
3 changed files with 51 additions and 63 deletions

View File

@ -11,7 +11,7 @@ def admin_vote_info_get(v):
if v and v.is_banned and not v.unban_utc: return render_template("seized.html")
link = request.args.get("link")
if not link: return render_template("admin/votes.html", v=v)
if not link: return render_template("votes.html", v=v)
ids = re.search("://[^/]+\w+/post/(\w+)/[^/]+(/(\w+))?", link)
@ -54,7 +54,7 @@ def admin_vote_info_get(v):
else:
abort(400)
return render_template("admin/votes.html",
return render_template("votes.html",
v=v,
thing=thing,
ups=ups,

View File

@ -1,61 +0,0 @@
{% extends "default.html" %}
{% block title %}
<title>Drama</title>
<meta name="description" content="Drama Help">
{% endblock %}
{% block content %}
<h1>Vote Info</h1>
<form action="votes" method="get" class="mb-6">
<label for="link-input">Paste permalink</label>
<input id="link-input" type="text" class="form-control mb-2" name="link" value="{{thing.permalink if thing else ''}}">
<input type="submit" value="Submit" class="btn btn-primary">
</form>
{% if thing %}
<h1>Info</h1>
<p><a href="{{thing.permalink}}">{{thing.permalink}}</a></p>
<p><b>Author:</b> <a href="{{thing.author.permalink}}">@{{thing.author.username}}</a></p>
<p><b>Author Created At:</b> {{thing.author.created_utc}} ({{thing.author.created_datetime}} UTC)</p>
<p><b>Counted Upvotes:</b> {{thing.upvotes}} out of {{ups | length}}</p>
<p><b>Counted Downvotes:</b> {{thing.downvotes}} out of {{downs | length}}</p>
<h2>Upvotes</h2>
<table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th>User</th>
</tr>
</thead>
{% for vote in ups %}
<tr>
<td style="font-weight:bold;"><a style="color:#{{vote.user.namecolor}}" href="/@{{vote.user.username}}">{{vote.user.username}}</a></td>
</tr>
{% endfor %}
</table>
<h2>Downvotes</h2>
<table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th>User</th>
</tr>
</thead>
{% for vote in downs %}
<tr>
<td style="font-weight:bold;"><a style="color:#{{vote.user.namecolor}}" href="/@{{vote.user.username}}">{{vote.user.username}}</a></td>
</tr>
{% endfor %}
</table>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,49 @@
{% extends "default.html" %}
{% block title %}
<title>Drama</title>
<meta name="description" content="Drama Votes">
{% endblock %}
{% block content %}
<h1>Vote Info</h1>
<form action="votes" method="get" class="mb-6">
<label for="link-input">Paste permalink</label>
<input id="link-input" type="text" class="form-control mb-2" name="link" value="{{thing.permalink if thing else ''}}">
<input type="submit" value="Submit" class="btn btn-primary">
</form>
{% if thing %}
<h1>Info</h1>
<p><a href="{{thing.permalink}}">{{thing.permalink}}</a></p>
<p><b>Author:</b> <a href="{{thing.author.permalink}}">@{{thing.author.username}}</a></p>
<p><b>Author Created At:</b> {{thing.author.created_utc}} ({{thing.author.created_datetime}} UTC)</p>
<p><b>Upvotes:</b>{{ups | length}}</p>
<p><b>Downvotes:</b>{{downs | length}}</p>
<h2>Upvotes</h2>
<table class="table table-striped mb-5">
<thead class="bg-primary text-white"><tr><th>User</th></tr></thead>
{% for vote in ups %}
<tr><td><a {% if vote.user.animatedname %}class="{% if vote.user.patron %}patron{% else %}leaderboard{% endif %}"{% endif %} style="color:#{{vote.user.namecolor}}; font-weight:bold;" href="/@{{vote.user.username}}"><img src="/@{{vote.user.username}}/pic/profile" class="profile-pic-20 mr-1">{{vote.user.username}}</a></td></tr>
{% endfor %}
</table>
<h2>Downvotes</h2>
<table class="table table-striped mb-5">
<thead class="bg-primary text-white"><tr><th>User</th></tr></thead>
{% for vote in downs %}
<tr><td><a {% if vote.user.animatedname %}class="{% if vote.user.patron %}patron{% else %}leaderboard{% endif %}"{% endif %} style="color:#{{vote.user.namecolor}}; font-weight:bold;" href="/@{{vote.user.username}}"><img src="/@{{vote.user.username}}/pic/profile" class="profile-pic-20 mr-1">{{vote.user.username}}</a></td></tr>
{% endfor %}
</table>
{% endif %}
{% endblock %}