Add some configuration options for instance admins

This commit is contained in:
Bat
2018-07-27 19:05:36 +02:00
parent 826772ca20
commit 74ec59e77c
21 changed files with 200 additions and 9 deletions
+5
View File
@@ -36,6 +36,11 @@
<span>Plume 0.1.0</span>
<a href="https://github.com/Plume-org/Plume">{{ "Source code" | _ }}</a>
<a href="https://riot.im/app/#/room/#funkwhale-troubleshooting:matrix.org">{{ "Matrix room" | _ }}</a>
{% if account %}
{% if account.is_admin %}
<a href="/admin">{{ "Administration" | _ }}</a>
{% endif %}
{% endif %}
</footer>
</body>
</html>
+34
View File
@@ -0,0 +1,34 @@
{% extends "base" %}
{% import "macros" as macros %}
{% block title %}
Administration of {{ instance.name }}
{% endblock title %}
{% block content %}
<h1>{{ "Administration" | _ }}</h1>
<h2>{{ "Instance settings" | _ }}</h2>
<form method="post">
{{ macros::input(name="name", label="Name", errors=errors, form=form, props='minlenght="1"', default=instance) }}
<label for="open_registrations">
{% if instance.open_registrations %}
<input type="checkbox" name="open_registrations" id="open_registrations" checked>
{% else %}
<input type="checkbox" name="open_registrations" id="open_registrations">
{% endif %}
{{ "Allow anyone to register" | _ }}
</label>
<label for="short_description">{{ "Short description" | _ }}<small>{{ "Markdown is supported" }}</small></label>
<textarea id="short_description" name="short_description">{{ form.short_description | default(value=instance.short_description) }}</textarea>
<label for="long_description">{{ "Long description" | _ }}<small>{{ "Markdown is supported" }}</small></label>
<textarea id="long_description" name="long_description">{{ form.long_description | default(value=instance.long_description) }}</textarea>
{{ macros::input(name="default_license", label="Default license", errors=errors, form=form, props='minlenght="1"', default=instance) }}
<input type="submit" value="{{ "Save settings" | _ }}"/>
</form>
{% endblock content %}
+3 -2
View File
@@ -17,7 +17,7 @@
</p>
</div>
{% endmacro post_card %}
{% macro input(name, label, errors, form, type="text", props="", optional=false) %}
{% macro input(name, label, errors, form, type="text", props="", optional=false, default='') %}
<label for="{{ name }}">
{{ label | _ }}
{% if optional %}
@@ -29,7 +29,8 @@
<p class="error">{{ err.message | default(value="Unknown error") | _ }}</p>
{% endfor %}
{% endif %}
<input type="{{ type }}" id="{{ name }}" name="{{ name }}" value="{{ form[name] | default(value="") }}" {{ props | safe }}/>
{% set default = default[name] | default(value="") %}
<input type="{{ type }}" id="{{ name }}" name="{{ name }}" value="{{ form[name] | default(value=default) }}" {{ props | safe }}/>
{% endmacro input %}
{% macro paginate(page, total, previous="Previous page", next="Next page") %}
<div class="pagination">
+1 -1
View File
@@ -19,6 +19,6 @@
<label for="summary">{{ "Summary" | _ }}</label>
<input name="summary" value="{{ account.summary }}">
<input type="submit" value="{{ "Update account" | _ }}"/>
<input type="submit" value="{{ "Update account" | _ }}"/>
</form>
{% endblock content %}