mince/templates/index.twig
2023-08-22 23:47:37 +00:00

97 lines
5.3 KiB
Twig

{% extends 'master.twig' %}
{% block content %}
{% if error is defined %}
<div class="error">
<h2>{{ error.title }}</h2>
<p>{{ error.body|default('No further details provided.') }}</p>
</div>
{% endif %}
{% if not is_authed %}
<div class="section">
<h2>You must be logged in to use this website!</h2>
<p>This website allows you to whitelist yourself on our Minecraft servers, for which you need to be logged in.</p>
<p>So it doesn't make sense to display the details either.</p>
</div>
{% else %}
{% if auth.mc_whitelisted < 1 %}
<div class="section whitelist">
<h2>Add to Whitelist</h2>
<p>This will give you access to the server. <strong>The whitelist is being removed in favour of an authentication plugin, go to the <a href="/clients">clients page</a> for more info.</strong></p>
<form method="post" action="/whitelist/add">
<input type="hidden" name="csrfp" value="{{ csrfp }}">
<label>
<div class="label-header">Username</div>
<div class="label-input"><input type="text" name="name" value="{{ wladdform_username }}"></div>
</label>
<input type="submit" value="Add me to the Whitelist">
</form>
</div>
{% endif %}
<div class="section">
<h2>Servers</h2>
<table class="servers">
<thead>
<tr>
<th class="col-name">Name</th>
<th class="col-address">Address</th>
<th class="col-java">Version</th>
{# <th class="col-address">Bedrock address</th> #}
{# <th class="col-bedrock">Bedrock version</th> #}
<th class="col-details">Details</th>
</tr>
</thead>
<tbody>
{% if servers is empty %}
<tr><td class="col-java" colspan="4">There are currently no active servers, check back later!</td></tr>
{% else %}
{% for server in servers %}
<tr id="s{{ server.id }}">
<td class="col-name">{{ server.name }}</td>
<td class="col-address">{% if server.hasJavaAddress %}<code>{{ server.javaAddress }}</code>{% else %}N/A{% endif %}</td>
<td class="col-java">{% if server.hasJavaVersion %}<code>{{ server.javaVersion }}</code>{% else %}N/A{% endif %}</td>
{# <td class="col-address">{% if server.hasBedrockAddress %}<code>{{ server.bedrockAddress }}</code>{% else %}N/A{% endif %}</td> #}
{# <td class="col-bedrock">{% if server.hasBedrockVersion %}<code>{{ server.bedrockVersion }}</code>{% else %}N/A{% endif %}</td> #}
<td class="col-details">{{ server.details|raw }}</td>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
</div>
{% if auth.mc_whitelisted > 0 %}
<div class="section unwhitelist">
<h2>Remove from Whitelist</h2>
<p>This will revoke your access to the server.</p>
<p>You are currently whitelisted as <b>{{ auth.mc_username }}</b> on <b>{{ auth.mc_whitelisted|date('Y-m-d H:i:s T') }}</b>.</p>
{% if whitelist_pending %}
<p><b style="font-size: 1.1em; line-height: 1.4em;">The whitelists are synchronised once every 5 minutes, you'll be able to play soon!</b></p>
<p>If you're playing a modpack, take that time to start the game up; it'll take a while.</p>
{% endif %}
<form method="post" action="/whitelist/remove">
<input type="hidden" name="csrfp" value="{{ csrfp }}">
<input type="submit" value="Remove me from the whitelist">
</form>
</div>
{% endif %}
<div class="section">
<h2>Bedrock versions</h2>
<p>Through the black magic bestowed upon us by <a href="https://geysermc.org/" target="_blank" rel="noopener">GeyserMC</a> it's possible to play on the server through any of the updated Bedrock versions of Minecraft.</p>
<p>This should allow you to play on the server from a phone, a tablet or a console, provided you also have an account for the original version of the game.</p>
<p>You will need to link your Minecraft and Bedrock accounts, you can do this by connecting to <code>link.geysermc.org</code> in both versions of the game and following the on-screen instructions.</p>
<p>Do note that this only works for servers where both a Java and Bedrock version number is listed!</p>
</div>
<div class="section">
<h2>Rules</h2>
<p>1. Observe <a href="//fii.moe/rules">Global Rules</a>.</p>
<p>2. Don't be an asshole.</p>
<p>3. Don't flood.</p>
</div>
{% endif %}
{% endblock %}