GameExpo23/TFR/server/templates/views/scores.html

104 lines
No EOL
4.4 KiB
HTML

{% extends "base.html" %}
{% block nav %}
<hr>
<nav>
<form method="GET" action="{{ url_for('views.index') }}" class="compact">
<select name="diff" class="button">
{% for difficulty in config["GAME_DIFFICULTIES"] %}
<option value="{{ difficulty }}" {% if diff==difficulty %}selected{% endif %}>
{{ config["GAME_DIFFICULTIES"][difficulty] }}
</option>
{% endfor %}
</select>
<select name="ver" class="button">
{% for version in config["GAME_VERSIONS"] %}
<option value="{{ version }}" {% if ver==version %}selected{% endif %}>
{{ config["GAME_VERSIONS"][version] }}
</option>
{% endfor %}
</select>
<span class="text-input">
<label for="search" style="min-width:auto">Username</label>
<input
type="text"
name="user"
id="search"
{% if user %}value="{{ user.username }}"{% endif %}
autocomplete="off"
/>
</span>
<button class="button"><i class="ph ph-magnifying-glass"></i></button>
</form>
</nav>
{% endblock %}
{% block content %}
{% if user %}
<div class="account-block">
{% if user.picture %}
<img src="{{ url_for('api.upload_dir', filename=user.picture) }}" alt="Profile picture">
{% else %}
<img src="{{ url_for('static', filename='images/pfp.png') }}" alt="Profile picture">
{% endif %}
<div class="other">
<div class="profile-title">
<h2>{{ user.username }}</h2>
{% for tag in tags %}<span class="profile-tag" style="background-color:{{ tag.color }};">{{ tag.tag }}</span>{% endfor %}
</div>
<p>Joined {{ user.joined_at|timesince }}</p>
<hr>
<div class="profile-links">
{% if user.discord %}<button class="discord"><i class="ph ph-discord-logo"></i></button>{% endif %}
{% if user.twitter %}<a href="https://twitter.com/{{ user.twitter }}" class="twitter"><i class="ph ph-twitter-logo"></i></a>{% endif %}
{% if user.twitch %}<a href="https://twitch.com/{{ user.twitch }}" class="twitch"><i class="ph ph-twitch-logo"></i></a>{% endif %}
{% if user.youtube %}<a href="https://youtube.com/{{ user.youtube }}" class="youtube"><i class="ph ph-youtube-logo"></i></a>{% endif %}
</div>
</div>
</div>
{% endif %}
{% if scores %}
<div class="table">
<table>
<tr>
<th>Pos</th>
<th>Name</th>
<th>Time Set</th>
<th>Submitted</th>
</tr>
{% for score in scores %}
<tr>
{% if loop.index == 1 %}
<td><i class="first ph-fill ph-crown"></i></td>
{% elif loop.index == 2 %}
<td><i class="second ph-duotone ph-crown"></i></td>
{% elif loop.index == 3 %}
<td><i class="third ph ph-crown"></i></td>
{% else %}
<td>{{ loop.index }}</td>
{% endif %}
<td>
<a href="{{ url_for('views.index', user=score.users.username) }}"
{% if score.users.id == current_user.id %}id="you"{% endif %}>
{{ score.users.username }}
</a>
</td>
<td>{{ score.score|format_result }}</td>
<td>{{ score.scored_at.strftime('%Y-%m-%d') }}</td>
</tr>
{% endfor %}
</table>
</div>
{% else %}
<div class="center-text">
<h2>No scores</h2>
<p>We searched far and wide, but nothing was found</p>
</div>
{% endif %}
{% endblock %}