1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-02 17:06:09 +00:00
webvirtcloud/templates/common/form.html
catborise 7196871880 fix(ui): pages have a main heading, a skip link and labelled search boxes
An accessibility sweep (axe-core on 22 pages in four themes, and the
keyboard) found:

- No page had an h1: the page heading was an h3, and pages with their
  own heading (sign-in, Computes, errors) kept an empty one. The heading
  is an h1 at the same size; those pages leave the empty one out, and
  Balance has a hidden h1 beside its breadcrumb. Tests check every page,
  an error page and the lock page for one h1 and no empty heading.
- Keyboard users went through the whole menu on every page: a "Skip to
  content" link shows when it has the focus, and brings the content up
  below the sticky navbar. The OTP QR page takes only a signed token from
  its fragment, not the link's #main.
- Tom Select moves a field's label to its own box, leaving the hidden
  select it keeps unnamed (the Tags field of a host, the owner forms'
  user and VM): the label names it too.
- Put in maintenance was yellow text on white (1.6:1), an outline
  secondary button now.
- The pool page's Volumes heading skipped a level.
2026-11-21 15:16:49 +03:00

40 lines
1.3 KiB
HTML

{% extends "base.html" %}
{% load django_bootstrap5 %}
{% load i18n %}
{% load static %}
{% block title %}{{ title }}{% endblock %}
{% block style %}
{% if searchable %}<link href="{% static 'css/tom-select.bootstrap5.min.css' %}" rel="stylesheet">{% endif %}
{% endblock style %}
{% block page_header %}
<div class="row justify-content-center">
<div class="col-lg-8"><h1 class="h3 mb-3">{{ title }}</h1></div>
</div>
{% endblock page_header %}
{% block content %}
<div class="row justify-content-center">
<div class="col-lg-8">
<form method="post">
{% csrf_token %}
<div class="card mb-3">
<div class="card-body">{% bootstrap_form form %}</div>
</div>
<div class="d-flex flex-wrap justify-content-end gap-2">
<a class="btn btn-outline-secondary" href="#" data-history-back>{% trans "Cancel" %}</a>
<button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
</div>
</form>
</div>
</div>
{% endblock content %}
{% block script %}
{% if searchable %}{# its selects with data-searchable #}
<script src="{% static 'js/tom-select.complete.min.js' %}"></script>
<script src="{% static 'js/searchable_select.js' %}"></script>
{% endif %}
{% endblock script %}