1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 01:16:10 +00:00

fix(ui): a page's heading comes before its buttons on a narrow screen

The buttons beside a page's heading floated to its right, so on a phone
they came above the heading. The heading and its buttons are now one
wrapping row: the heading first, the buttons beside it or under it. The
Computes page, which had a heading of its own, uses the same row.
This commit is contained in:
catborise 2026-11-21 20:16:57 +03:00
parent 3167cf12fe
commit 59db1f5515
3 changed files with 16 additions and 20 deletions

View file

@ -4,17 +4,14 @@
{% load bootstrap_icons %}
{% load operations %}
{% block title %}{% trans "Computes" %}{% endblock %}
{% block page_header %}{% endblock page_header %}{# the page has its own heading #}
{% block page_heading %}{% trans "Computes" %}{% endblock page_heading %}
{% block page_heading_extra %}
<input id="filter" class="form-control w-auto" type="text" placeholder="{% trans 'Search' %}" aria-label="{% trans 'Search' %}">
{% if computes|length > 1 %}<a href="{% url 'balance' %}" class="btn btn-outline-primary">{% trans "Balance" %}</a>{% endif %}
{% include 'create_comp_block.html' %}
{% endblock page_heading_extra %}
{% block content %}
<div id="job-panel" aria-live="polite"></div>
<div class="row">
<div class="col-lg-12">
{% include 'create_comp_block.html' %}
{% if computes|length > 1 %}<a href="{% url 'balance' %}" class="btn btn-outline-primary mt-1 ms-1 float-end">{% trans "Balance" %}</a>{% endif %}
{% include 'search_block.html' %}
<h1 class="h3 mb-3">{% trans "Computes" %}</h1>
</div>
</div>
{% include "computes/attention.html" %}
{% if not computes %}
<div class="alert alert-warning shadow-sm">

View file

@ -1,6 +1,6 @@
{% load i18n %}
{% load bootstrap_icons %}
<div class="dropdown float-end mt-1 ms-1">
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
{% bs_icon 'plus-lg' %} {% trans "Add host" %}
</button>

View file

@ -37,16 +37,15 @@
<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>
{# the heading first, the page's buttons beside it, or under it on a narrow screen #}
<div class="d-flex flex-wrap align-items-start justify-content-between column-gap-3 row-gap-2 mb-3">
<h1 class="h3 mb-0">
{% block page_heading %}
{% endblock page_heading %}
</h1>
<div class="d-flex flex-wrap align-items-center gap-1">
{% block page_heading_extra %}
{% endblock page_heading_extra %}
</div>
</div>
{% endblock page_header %}