Titan/titanembeds/templates/administrate_guild.html.j2
2017-03-26 02:00:20 -07:00

107 lines
4.7 KiB
Django/Jinja

{% extends 'site_layout.html.j2' %}
{% block title %}Administrate Guild: {{ guild['name'] }}{% endblock %}
{% block content %}
<h1>Administrating: {{ guild['name'] }}</h1>
<p class="flow-text">For this server, you are allowed the following actions:
{% for permission in permissions %}
{{ permission }}
{% if not loop.last %}
,
{% endif %}
{% endfor %}
.</p>
<div class="row">
<div class="col s12">
<h2 class="header">Embed URLs</h2>
<div class="card horizontal black-text indigo lighten-5 z-depth-3 hoverable">
<div class="card-stacked">
<div class="card-content">
<p class="flow-text">Direct Link</p>
<input readonly value="{{ url_for("embed.guild_embed", guild_id=guild['id'], _external=True) }}" id="disabled" type="text" onClick="this.setSelectionRange(0, this.value.length)">
<p class="flow-text">iFrame Embed</p>
<input readonly value=" &lt;iframe src=&quot;{{ url_for("embed.guild_embed", guild_id=guild['id'], _external=True) }}&quot; height=&quot;200&quot; width=&quot;300&quot; /&gt; " id="disabled" type="text" onClick="this.setSelectionRange(0, this.value.length)">
</div>
</div>
</div>
</div>
{% if "Manage Embed Settings" in permissions %}
<div class="col s12">
<h2 class="header">Embed Settings</h2>
<div class="card horizontal black-text indigo lighten-5 z-depth-3 hoverable">
<div class="card-stacked">
<div class="card-content">
<p class="flow-text">Unauthenticated (Guest) Users</p>
<div class="switch">
<label>
Disable
<input type="checkbox" id="unauth_users" name="unauth_users" {% if dbguild['unauth_users'] %}checked{% endif %} >
<span class="lever"></span>
Enable
</label>
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% if "Ban Members" in permissions or "Kick Members" in permissions %}
<div class="col s12">
<h2 class="header">Moderate Unauthenticated Members</h2>
<div class="card horizontal black-text indigo lighten-5 z-depth-3 hoverable">
<div class="card-stacked">
<div class="card-content">
<p class="flow-text">Select Action</p>
<table class="striped responsive-table">
<thead>
<tr>
<th>Kick User</th>
<th>Ban User</th>
<th>Username</th>
<th>Discrim</th>
<th>Last Visit</th>
<th>IP Address</th>
<th>Banned Timestamp</th>
<th>Banned by</th>
<th>Banned Reason</th>
<th>Ban Lifted by</th>
</tr>
</thead>
<tbody>
{% for member in members %}
<tr>
<td><a class="waves-effect waves-light btn orange" {% if "Kick Members" not in permissions or member["kicked"] %}disabled{% endif %} onclick='revoke_user( "{{ guild['id'] }}" , {{ member['id'] }} )' >Kick</a></td>
{% if not member["banned"] %}
<td><a class="waves-effect waves-light btn red" {% if "Ban Members" not in permissions %}disabled{% endif %} {% if "Ban Members" in permissions %} onclick='initiate_ban( "{{ guild['id'] }}" , {{ member['id'] }} )' {% endif %} >Ban</a></td>
{% else %}
<td><a class="waves-effect waves-light btn red lighten-2" {% if "Ban Members" not in permissions %}disabled{% endif %} {% if "Ban Members" in permissions %} onclick='remove_ban( "{{ guild['id'] }}" , {{ member['id'] }} )' {% endif %} >Lift</a></td>
{% endif %}
<td>{{ member['username'] }}</td>
<td>{{ member['discrim'] }}</td>
<td>{{ member['last_visit'] }}</td>
<td>{{ member['ip'] }}</td>
<td>{{ member['banned_timestamp'] }}</td>
<td>{{ member['banned_by'] }}</td>
<td>{{ member['banned_reason'] }}</td>
<td>{{ member['ban_lifted_by'] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<p>Note that all bans are by IP. Seeing duplicates? It is because users are generated a unique session on each browser load.</p>
</div>
</div>
</div>
</div>
{% endif %}
</div>
{% endblock %}
{% block script %}
<script type="text/javascript" src="{{ url_for('static', filename='js/administrate_guild.js') }}"></script>
{% endblock %}