mirror of
https://github.com/godotengine/godot-showreel-voting.git
synced 2026-09-03 18:15:13 +03:00
added management for showreel status and submission history for users
This commit is contained in:
@@ -13,27 +13,39 @@
|
||||
}
|
||||
</style>
|
||||
<main id="admin">
|
||||
<h1 style="margin-bottom: 20px;">Vote results</h1>
|
||||
<div>
|
||||
<p>Total votes: <strong>{{ total_votes }}</strong></p>
|
||||
<p>Positive votes: <strong>{{ positive_votes }}</strong></p>
|
||||
<p>Negative votes: <strong>{{ total_votes - positive_votes }}</strong></p>
|
||||
</div>
|
||||
<br>
|
||||
<form action="{{ url_for('votes.download_vote_results') }}" method="get" style="display:inline;">
|
||||
<button type="submit" class="button primary small">Download results .csv</button>
|
||||
</form>
|
||||
<div>
|
||||
<div class="entries">
|
||||
{% for entry in vote_tally %}
|
||||
<div class="entry panel padded">
|
||||
<h2><a href="{{ url_for('votes.video_view', video_id=entry[0].id) }}">{{ entry[0].game }}</a></h2>
|
||||
<p>Category: <strong>{{ entry[0].showreel.title }}</strong></p>
|
||||
<p>Author: <strong>{{ entry[0].author_name }}</strong></p>
|
||||
<p>Vote sum: <strong>{{ entry[1] }}</strong></p>
|
||||
<p>Votes received: <strong>{{ entry[2] }}</strong></p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<h1>Manage Shorwreels</h1>
|
||||
<form action="{{ url_for('votes.update_showreel_status') }}" method="post" style="display:inline;">
|
||||
{{ form.csrf_token }}
|
||||
|
||||
{{ form.showreel_id.label }}
|
||||
{{ form.showreel_id() }}
|
||||
|
||||
{{ form.showreel_status.label }}
|
||||
{{ form.showreel_status() }}
|
||||
|
||||
<button type="submit" class="button primary small">Save</button>
|
||||
</form>
|
||||
<h1 style="margin-bottom: 20px;">Vote results</h1>
|
||||
<div>
|
||||
<p>Total votes: <strong>{{ total_votes }}</strong></p>
|
||||
<p>Positive votes: <strong>{{ positive_votes }}</strong></p>
|
||||
<p>Negative votes: <strong>{{ total_votes - positive_votes }}</strong></p>
|
||||
</div>
|
||||
<br>
|
||||
<form action="{{ url_for('votes.download_vote_results') }}" method="get" style="display:inline;">
|
||||
<button type="submit" class="button primary small">Download results .csv</button>
|
||||
</form>
|
||||
<div>
|
||||
<div class="entries">
|
||||
{% for entry in vote_tally %}
|
||||
<div class="entry panel padded">
|
||||
<h2><a href="{{ url_for('votes.video_view', video_id=entry[0].id) }}">{{ entry[0].game }}</a></h2>
|
||||
<p>Category: <strong>{{ entry[0].showreel.title }}</strong></p>
|
||||
<p>Author: <strong>{{ entry[0].author_name }}</strong></p>
|
||||
<p>Vote sum: <strong>{{ entry[1] }}</strong></p>
|
||||
<p>Votes received: <strong>{{ entry[2] }}</strong></p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
@@ -16,6 +16,9 @@
|
||||
</a>
|
||||
<div id="dropdown-menu" class="dropdown-content">
|
||||
<a href="/about">About</a>
|
||||
{% if user %}
|
||||
<a href="/user/submissions">Submissions</a>
|
||||
{% endif %}
|
||||
{% if user.can_vote() %}
|
||||
<a href="/vote">Vote</a>
|
||||
<a href="/history">History</a>
|
||||
|
||||
54
templates/manage-submission.html
Normal file
54
templates/manage-submission.html
Normal file
@@ -0,0 +1,54 @@
|
||||
<main id="submission-form">
|
||||
<div>
|
||||
<h1>Showreel Submission</h1>
|
||||
<p>Fill in the form to submit your video for the Godot Showreel.</p>
|
||||
</div>
|
||||
<hr>
|
||||
<form method="POST" enctype="multipart/form-data" hx-post="{{ url_for('votes.update_submission', video_id=video_id, _method='POST') }}" hx-target='#submission-form' hx-swap='outerHTML'>
|
||||
{{ form.csrf_token }}
|
||||
|
||||
{{ form.game.label }}<br>
|
||||
{{ form.game(size=100) }}<br>
|
||||
{% for error in form.game.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}<br>
|
||||
|
||||
{{ form.author_name.label }}<br>
|
||||
{{ form.author_name(size=100) }}<br>
|
||||
{% for error in form.author_name.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}<br>
|
||||
|
||||
{{ form.contact_email.label }}<br>
|
||||
{{ form.contact_email(size=100) }}<br>
|
||||
{% for error in form.contact_email.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}<br>
|
||||
|
||||
{{ form.video_link.label }}<br>
|
||||
{{ form.video_link(size=100) }}<br>
|
||||
{% for error in form.video_link.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}<br>
|
||||
|
||||
{{ form.video_download_link.label }}<br>
|
||||
{{ form.video_download_link(size=100) }}<br>
|
||||
{% for error in form.video_download_link.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}<br>
|
||||
|
||||
{{ form.follow_me_link.label }}<br>
|
||||
{{ form.follow_me_link(size=100) }}<br>
|
||||
{% for error in form.follow_me_link.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}<br>
|
||||
|
||||
{{ form.store_link.label }}<br>
|
||||
{{ form.store_link(size=100) }}<br>
|
||||
{% for error in form.store_link.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}<br>
|
||||
|
||||
<button type="submit" class="button secondary">Update</button>
|
||||
</form>
|
||||
</main>
|
||||
89
templates/user-submissions.html
Normal file
89
templates/user-submissions.html
Normal file
@@ -0,0 +1,89 @@
|
||||
<style>
|
||||
.entry {
|
||||
.info {
|
||||
display: grid;
|
||||
margin-bottom: 5px;
|
||||
gap: 10px;
|
||||
@media (min-width: 768px) {
|
||||
grid-template-columns: 120px 1fr;
|
||||
|
||||
}
|
||||
.category {
|
||||
font-size: 12px;
|
||||
margin: 4px 0px;
|
||||
}
|
||||
}
|
||||
.image-container {
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
img {
|
||||
max-width: 100%;
|
||||
margin-bottom: -15px;
|
||||
margin-top: -11px;
|
||||
width: auto;
|
||||
aspect-ratio: 16/9;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<main id="user-submissions">
|
||||
<h1>User Submissions</h1>
|
||||
<hr>
|
||||
{% if open_submissions %}
|
||||
<h2>Open Submissions</h2>
|
||||
<div>
|
||||
{% for entry in open_submissions %}
|
||||
<div class="entry panel padded">
|
||||
<div class="info">
|
||||
<div>
|
||||
<div class="image-container">
|
||||
<img src="https://img.youtube.com/vi/{{ entry.parse_youtube_video_id() }}/default.jpg" alt="Video thumbnail" loading="lazy">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h2>{{ entry.game }}</h2>
|
||||
<p><strong>{{ entry.author_name }}</strong></p>
|
||||
<p class="category">{{ entry.showreel.title }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a href="{{url_for('votes.manage_submission', video_id=entry.id) }}" style="text-decoration: none;">
|
||||
<form action="{{ url_for('votes.manage_submission', video_id=entry.id) }}" method="get" style="display:inline-block; margin-top: 10px;">
|
||||
<button type="submit" class="button secondary">Edit entry</button>
|
||||
</form>
|
||||
</a>
|
||||
<form action="{{ url_for('votes.delete_submission', video_id=entry.id) }}" method="post" style="display:inline;" onsubmit="return confirm('Are you sure you want to delete this entry?');">
|
||||
<button type="submit" class="button tertiary">Delete entry</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<hr>
|
||||
{% endif %}
|
||||
{% if closed_submissions %}
|
||||
<h2>Closed Submissions</h2>
|
||||
<div>
|
||||
{% for entry in closed_submissions %}
|
||||
<div class="entry panel padded">
|
||||
<div class="info">
|
||||
<div>
|
||||
<div class="image-container">
|
||||
<img src="https://img.youtube.com/vi/{{ entry.parse_youtube_video_id() }}/default.jpg" alt="Video thumbnail" loading="lazy">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h2>{{ entry.game }}</h2>
|
||||
<p><strong>{{ entry.author_name }}</strong></p>
|
||||
<p class="category">{{ entry.showreel.title }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if not open_submissions and not closed_submissions %}
|
||||
<p>You haven't submitted any entries yet.</p>
|
||||
{% endif %}
|
||||
</main>
|
||||
Reference in New Issue
Block a user