From 965cf0080cc0cf7a7a7e3d9bd0949abf60eb245c Mon Sep 17 00:00:00 2001 From: catborise Date: Tue, 27 Oct 2026 17:58:59 +0300 Subject: [PATCH] refactor(templates): the page width, headings and paragraphs as Bootstrap sets them Three upstream rules in webvirtcloud.css set every page's layout against Bootstrap 5.3: - .container { max-width: 900px } held each page to 900px at any screen width, below Bootstrap's own widths. Pages now take Bootstrap's container widths up to its lg one, 960px, and stop there on wider screens: its xl and xxl widths (1140px, 1320px) leave the panel's forms and lists too wide; - .page-header (margins of 5px 5px 20px 20px) put headings 20px right of the content under them; its 14 uses are mb-3, flush with the content (one carried Bootstrap 4's mr-auto, now me-auto); - p { margin: 10px } indented every paragraph 10px from the content beside it; paragraphs take Bootstrap's own bottom margin. webvirtcloud.css keeps only what Bootstrap has no utility for: the page width cap, the XML editor's place and height, the Tom Select colour fix, the sortable table headers' arrows, the grouped VM list's collapsed hosts and the charts' height. --- admin/templates/admin/group_list.html | 2 +- admin/templates/admin/tombstone_list.html | 2 +- computes/templates/computes/form.html | 2 +- computes/templates/computes/list.html | 2 +- instances/templates/instances/info_tab.html | 2 +- networks/templates/network.html | 10 +++++----- nwfilters/templates/nwfilter.html | 4 ++-- static/css/webvirtcloud.css | 19 ++++++------------- storages/templates/storage.html | 2 +- templates/base.html | 2 +- 10 files changed, 20 insertions(+), 27 deletions(-) diff --git a/admin/templates/admin/group_list.html b/admin/templates/admin/group_list.html index a4a0bda6..151ed739 100644 --- a/admin/templates/admin/group_list.html +++ b/admin/templates/admin/group_list.html @@ -10,7 +10,7 @@ {% bs_icon 'plus-circle-fill' %} {% include 'search_block.html' %} -

{% trans "Groups" %}

+

{% trans "Groups" %}

diff --git a/admin/templates/admin/tombstone_list.html b/admin/templates/admin/tombstone_list.html index 83c13c5a..46e4e097 100644 --- a/admin/templates/admin/tombstone_list.html +++ b/admin/templates/admin/tombstone_list.html @@ -7,7 +7,7 @@
{% include 'search_block.html' %} -

{% trans "Removed VMs" %}

+

{% trans "Removed VMs" %}

{% trans "VMs that vanished from their compute. Their owners come back if the same UUID shows up again before the record expires." %}

diff --git a/computes/templates/computes/form.html b/computes/templates/computes/form.html index b6375c95..24e8dd67 100644 --- a/computes/templates/computes/form.html +++ b/computes/templates/computes/form.html @@ -8,7 +8,7 @@ {% block content %}
- +

{% if form.instance.pk %}{% trans "Edit Compute" %}{% else %}{% trans "Add Compute" %}{% endif %}

diff --git a/computes/templates/computes/list.html b/computes/templates/computes/list.html index 1d9e43c7..1009cd12 100644 --- a/computes/templates/computes/list.html +++ b/computes/templates/computes/list.html @@ -9,7 +9,7 @@
{% include 'create_comp_block.html' %} {% include 'search_block.html' %} - +

{% trans "Computes" %}

diff --git a/instances/templates/instances/info_tab.html b/instances/templates/instances/info_tab.html index 399a4d78..9f6eac4f 100644 --- a/instances/templates/instances/info_tab.html +++ b/instances/templates/instances/info_tab.html @@ -1,6 +1,6 @@ {% load i18n %}
- +

{% trans "Guest Info" %}

{% trans "Hostname" %}
diff --git a/networks/templates/network.html b/networks/templates/network.html index 44c6d4fa..64e1b95f 100644 --- a/networks/templates/network.html +++ b/networks/templates/network.html @@ -67,7 +67,7 @@
- +
{% trans "IPv4 Configuration" %}
{% trans "IPv4 Forwarding" %}
@@ -127,7 +127,7 @@ {% include 'modify_ipv4_fixed_address.html' %} {% endif %} - +
{% trans "IPv4 Fixed Addresses" %}
{% endif %} @@ -189,7 +189,7 @@
{% endif %} - +
{% trans "IPv6 Configuration" %}
{% trans "IPv6 Forwarding" %}
@@ -243,7 +243,7 @@ {% if state %} {% include 'modify_ipv6_fixed_address.html' %} {% endif %} - +
{% trans "IPv6 Fixed Addresses" %}
{% endif %} {% if ipv6_fixed_address %} @@ -308,7 +308,7 @@ {% include 'add_network_qos.html' %} {% endif %} - +
{% trans "QoS Configuration" %}
diff --git a/nwfilters/templates/nwfilter.html b/nwfilters/templates/nwfilter.html index 713cc30f..f2fed219 100644 --- a/nwfilters/templates/nwfilter.html +++ b/nwfilters/templates/nwfilter.html @@ -44,7 +44,7 @@
-
{% trans "Filter References" %}
{% csrf_token %}
@@ -97,7 +97,7 @@ {% include 'add_nwf_rule.html' %} - +
{% trans "Rules" %}
diff --git a/static/css/webvirtcloud.css b/static/css/webvirtcloud.css index bd3f7eb1..07d76056 100644 --- a/static/css/webvirtcloud.css +++ b/static/css/webvirtcloud.css @@ -4,14 +4,12 @@ * For details, see http://www.apache.org/licenses/LICENSE-2.0. */ -/* Global Styles */ - -.container { - max-width: 900px; -} - -.page-header { - margin: 5px 5px 20px 20px; +/* pages stop at Bootstrap's lg container width (960px): its xl and xxl + widths (1140px, 1320px) leave the panel's forms and lists too wide */ +@media (min-width: 1200px) { + .container { + max-width: 960px; + } } #editor { @@ -62,11 +60,6 @@ th[aria-sort="ascending"]:not([data-sort-method="none"])::after { display: none; } -p { - display: block; - margin: 10px 10px 10px 10px; -} - /* a live chart (static/js/charts.js) fills the width of its card at this height */ .chart { height: 160px; diff --git a/storages/templates/storage.html b/storages/templates/storage.html index 47d9f70d..de7d4c65 100644 --- a/storages/templates/storage.html +++ b/storages/templates/storage.html @@ -66,7 +66,7 @@ {% if state %}
{% include 'search_block.html' %} - +
{% trans "Volumes" %}
{% if volumes %}
diff --git a/templates/base.html b/templates/base.html index e580349c..1c5ac447 100644 --- a/templates/base.html +++ b/templates/base.html @@ -47,7 +47,7 @@ {% block page_heading_extra %} {% endblock page_heading_extra %}
-

{% block page_heading %} {% endblock page_heading %}