48 lines
1.8 KiB
HTML
48 lines
1.8 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Overlays | left4me{% endblock %}
|
|
|
|
{% block content %}
|
|
<section class="panel">
|
|
<div class="page-heading">
|
|
<h1>Overlays</h1>
|
|
</div>
|
|
|
|
{% if g.user.admin %}
|
|
<form method="post" action="/overlays" class="stack form-panel">
|
|
<input type="hidden" name="csrf_token" value="{{ session.get('csrf_token', '') }}">
|
|
<label>Name <input name="name" required></label>
|
|
<label>Path <input name="path" required placeholder="/opt/l4d2/overlays/example"></label>
|
|
<button type="submit">Add overlay</button>
|
|
</form>
|
|
{% endif %}
|
|
|
|
<table class="table">
|
|
<thead><tr><th>Name</th><th>Path</th>{% if g.user.admin %}<th>Actions</th>{% endif %}</tr></thead>
|
|
<tbody>
|
|
{% for overlay in overlays %}
|
|
<tr>
|
|
<td>{{ overlay.name }}</td>
|
|
<td class="muted">{{ overlay.path }}</td>
|
|
{% if g.user.admin %}
|
|
<td>
|
|
<form method="post" action="/overlays/{{ overlay.id }}" class="inline-form">
|
|
<input type="hidden" name="csrf_token" value="{{ session.get('csrf_token', '') }}">
|
|
<input name="name" value="{{ overlay.name }}" required>
|
|
<input name="path" value="{{ overlay.path }}" required>
|
|
<button type="submit">Save</button>
|
|
</form>
|
|
<form method="post" action="/overlays/{{ overlay.id }}/delete" class="inline-form">
|
|
<input type="hidden" name="csrf_token" value="{{ session.get('csrf_token', '') }}">
|
|
<button class="danger" type="submit">Delete</button>
|
|
</form>
|
|
</td>
|
|
{% endif %}
|
|
</tr>
|
|
{% else %}
|
|
<tr><td colspan="{% if g.user.admin %}3{% else %}2{% endif %}" class="muted">No overlays configured.</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
{% endblock %}
|