catask/templates/admin/categories/accessibility.html
2025-02-28 07:14:24 +03:00

49 lines
2.7 KiB
HTML

{% extends 'admin/base.html' %}
{% block _title %}{{ _('Accessibility') }}{% endblock %}
{% set access_link = 'active' %}
{% block _content %}
<form hx-post="{{ url_for('api.updateConfig') }}" hx-target="#response-container" hx-swap="none">
<h2 id="general" class="mb-2 fw-normal">{{ _('Accessibility') }}</h2>
<p class="fs-5 h3 text-body-secondary mb-3">{{ _('Make {} accessible to everyone').format(const.appName) }}</p>
<div class="form-group mb-4">
<label class="form-label" for="accessibility.font">{{ _('Font') }}</label>
<select id="accessibility.font" name="accessibility.font" class="form-select">
<option value="default"{% if cfg.accessibility.font == 'default' %} selected{% endif %}>{{ _('Default') }}</option>
<option value="system"{% if cfg.accessibility.font == 'system' %} selected{% endif %}>{{ _('System') }}</option>
<option value="atkinson"{% if cfg.accessibility.font == 'atkinson' %} selected{% endif %}>{{ _('Atkinson Hyperlegible') }}</option>
</select>
</div>
{#- i dont think userway should be translated since its a company name and those usually arent translated #}
<h3 id="antispam" class="mb-2 fw-normal d-flex align-items-center gap-2">UserWay <a href="https://userway.org/" target="_blank" class="fs-5" title="{{ _("what's this?") }}"><i class="bi bi-question-circle"></i></a></h3>
<div class="form-check form-switch mb-3">
<input
class="form-check-input"
type="checkbox"
name="_accessibility.userway.enabled"
id="_accessibility.userway.enabled"
value="{{ cfg.accessibility.userway.enabled }}"
role="switch"
{% if cfg.accessibility.userway.enabled %}checked{% endif %}>
<input type="hidden" id="accessibility.userway.enabled" name="accessibility.userway.enabled" value="{{ cfg.accessibility.userway.enabled }}">
<label for="_accessibility.userway.enabled" class="form-check-label">{{ _('Enabled') }}</label>
</div>
<div class="form-group mb-3">
<label class="form-label" for="accessibility.userway.account">{{ _('Account key') }}</label>
<input type="text" id="accessibility.userway.account" name="accessibility.userway.account" value="{{ cfg.accessibility.userway.account }}" class="form-control">
<p class="form-text">
{{ _('UserWay account key, find one at') }} <a href="https://manage.userway.org/embed-code" target="_blank">manage.userway.org/embed-code</a>
</p>
</div>
{% include 'snippets/admin/saveBtn.html' %}
</form>
{% endblock %}
{% block _scripts %}
<script>
// fix handling checkboxes
document.querySelectorAll('.form-check-input[type=checkbox]').forEach(function(checkbox) {
checkbox.addEventListener('change', function() {
checkbox.nextElementSibling.value = this.checked ? 'True' : 'False';
});
});
</script>
{% endblock %}