1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-02 17:06:09 +00:00
webvirtcloud/templates/base.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

91 lines
3.7 KiB
HTML

{% load static %}
{% load django_bootstrap5 %}
{% load i18n %}
<!DOCTYPE html>
{% get_current_language as LANGUAGE_CODE %}<html lang="{{ LANGUAGE_CODE }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="WebVirtCloud panel for manage virtual machine">
<meta name="author" content="anatoliy.guskov@gmail.com">
<title>{% block title %}{% endblock %}</title>
<!-- Bootstrap Core CSS -->
{# error pages render without app_settings: they get zephyr #}
{% with theme=app_settings.BOOTSTRAP_THEME|default:"zephyr" %}<link href="{% static "css/themes/"|add:theme|add:".min.css" %}" rel="stylesheet" id="wvc_css">{% endwith %}
<!-- WebVirtCloud CSS -->
<link href="{% static "css/webvirtcloud.css" %}" rel="stylesheet">
<!-- Aditional CSS -->
{% block style %}{% endblock %}
<!-- Custom Fonts -->
<link href="{% static "css/bootstrap-icons.min.css" %}" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="{% static 'favicon.ico' %}">
</head>
<body class="pb-5"{% block body_attrs %}{% endblock %}>
{% if request.user.is_authenticated %}
{# for the keyboard: past the menu, shown when it has the focus #}
<a class="visually-hidden-focusable d-block text-center p-2" href="#main">{% trans "Skip to content" %}</a>
{% include 'navbar.html' %}
{% endif %}
<div role="main" id="main" class="container">
{% block page_header %}{# a page with a heading of its own leaves it out #}
<div>
<div>
<div class="float-end">
{% block page_heading_extra %}
{% endblock page_heading_extra %}
</div>
<h1 class="h3 mb-3">
{% block page_heading %}
{% endblock page_heading %}
</h1>
</div>
</div>
{% endblock page_header %}
<div id="messages">{% bootstrap_messages %}</div>
{% block content %}{% endblock %}
</div>
{# the dialog every button with data-confirm asks in (confirm_dialog.js) #}
<div class="modal fade" id="confirm-dialog" tabindex="-1" aria-labelledby="confirm-dialog-title" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title text-break" id="confirm-dialog-title"></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{% trans "Close" %}"></button>
</div>
<div class="modal-body text-break"></div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">{% trans "Cancel" %}</button>
<button type="button" class="btn btn-primary" data-confirm-ok></button>
</div>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<!-- jQuery -->
<script src="{% static 'js/jquery.js' %}"></script>
<!-- Bootstrap Core JavaScript -->
<script src="{% static 'js/bootstrap.bundle.min.js' %}"></script>
<script src="{% static 'js/confirm_dialog.js' %}"></script>
<!-- Table sorting -->
<script src="{% static 'js/tablesort.min.js' %}"></script>
<script src="{% static 'js/tablesort.number.min.js' %}"></script>
<script src="{% static 'js/sort_tables.js' %}"></script>
<script src="{% static 'js/error_focus.js' %}"></script>
<script src="{% static 'js/back_links.js' %}"></script>
<script src="{% static 'js/console_window.js' %}"></script>
{% block script %}{% endblock %}
</body>
</html>