Improve hosting account navigation and mobile panel layout

This commit is contained in:
parkel committed 2026-11-22 01:01:09 +01:00
1 parent f11891efea
commit eb12419c84
11 files changed
+304 -61

No files matched your search

+22
View File
@@ -1,3 +1,18 @@
NAVIGATION_SECTIONS = {
"accounts": "accounts",
"retired-accounts": "accounts",
"databases": "accounts",
"dns-zones": "accounts",
"mailboxes": "accounts",
"mail-domains": "accounts",
"customers": "customers",
"resellers": "resellers",
"hosting-plans": "hosting_plans",
"plans": "plans",
"service-health": "service_health",
}
def customer_for_user(user): def customer_for_user(user):
if not user.is_authenticated or user.is_superuser: if not user.is_authenticated or user.is_superuser:
return None return None
@@ -24,12 +39,19 @@ def is_tenant(user):
def panel_access(request): def panel_access(request):
customer = customer_for_user(request.user) is not None customer = customer_for_user(request.user) is not None
reseller = not customer and reseller_for_user(request.user) is not None reseller = not customer and reseller_for_user(request.user) is not None
match = request.resolver_match
section = None
if match is not None and match.namespace == "panel":
section = NAVIGATION_SECTIONS.get(
match.route.split("/", 1)[0], match.url_name
)
return { return {
"is_customer": customer, "is_customer": customer,
"is_reseller": reseller, "is_reseller": reseller,
"is_tenant": customer or reseller, "is_tenant": customer or reseller,
"is_operator": request.user.is_authenticated "is_operator": request.user.is_authenticated
and not (customer or reseller), and not (customer or reseller),
"panel_section": section,
} }
@@ -0,0 +1,32 @@
const menuToggle = document.querySelector(".menu-toggle");
const navigation = document.getElementById("panel-navigation");
const compactLayout = window.matchMedia("(max-width: 780px)");
function setMenuExpanded(expanded) {
menuToggle.setAttribute("aria-expanded", String(expanded));
navigation.hidden = !expanded;
}
function updateMenuLayout() {
const focusInNavigation = navigation.contains(document.activeElement);
if (!compactLayout.matches && document.activeElement === menuToggle) {
setMenuExpanded(true);
navigation.querySelector("a")?.focus();
}
setMenuExpanded(!compactLayout.matches || focusInNavigation);
menuToggle.hidden = !compactLayout.matches;
}
menuToggle.addEventListener("click", () => {
setMenuExpanded(menuToggle.getAttribute("aria-expanded") !== "true");
});
navigation.addEventListener("keydown", (event) => {
if (event.key === "Escape" && compactLayout.matches) {
setMenuExpanded(false);
menuToggle.focus();
}
});
compactLayout.addEventListener("change", updateMenuLayout);
updateMenuLayout();
+173 -28
View File
@@ -1,16 +1,16 @@
:root { :root {
color-scheme: light; color-scheme: light;
--page: #f4f5ef; --page: #f3f6f3;
--surface: #fffefa; --surface: #fff;
--ink: #182923; --ink: #162b25;
--muted: #516258; --muted: #4c635a;
--line: #dce3d9; --line: #d8e4dd;
--sidebar: #142b26; --sidebar: #112c25;
--sidebar-text: #e7f0e9; --sidebar-text: #eef6ef;
--accent: #235440; --accent: #1b6049;
--accent-hover: #174332; --accent-hover: #104834;
--focus: #8c4d2b; --focus: #93440f;
--radius: 12px; --radius: 14px;
font: 100%/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font: 100%/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
} }
@@ -54,7 +54,7 @@ button, input, select, textarea {
.skip-link:focus { .skip-link:focus {
position: fixed; position: fixed;
z-index: 1; z-index: 2;
top: 1rem; top: 1rem;
left: 1rem; left: 1rem;
padding: 0.6rem 1rem; padding: 0.6rem 1rem;
@@ -64,7 +64,7 @@ button, input, select, textarea {
.panel { .panel {
display: grid; display: grid;
min-height: 100vh; min-height: 100vh;
grid-template-columns: 242px minmax(0, 1fr); grid-template-columns: 235px minmax(0, 1fr);
} }
.sidebar { .sidebar {
@@ -75,7 +75,7 @@ button, input, select, textarea {
flex-direction: column; flex-direction: column;
overflow-y: auto; overflow-y: auto;
padding: 1.65rem 1.1rem 1.1rem; padding: 1.65rem 1.1rem 1.1rem;
background: var(--sidebar); background: linear-gradient(160deg, #163a30, var(--sidebar) 55%);
color: var(--sidebar-text); color: var(--sidebar-text);
} }
@@ -95,10 +95,11 @@ button, input, select, textarea {
display: grid; display: grid;
width: 2.15rem; width: 2.15rem;
height: 2.15rem; height: 2.15rem;
flex: 0 0 2.15rem;
place-items: center; place-items: center;
border-radius: 0.55rem; border-radius: 0.55rem;
background: #d8e7bb; background: #c7e8ca;
color: #18372c; color: #15392f;
font-size: 1.12rem; font-size: 1.12rem;
font-weight: 800; font-weight: 800;
} }
@@ -126,12 +127,43 @@ button, input, select, textarea {
text-decoration: none; text-decoration: none;
} }
.navigation a:hover, .navigation a[aria-current="page"] { .navigation a:hover, .navigation a[aria-current] {
border-color: #527369; border-color: #527369;
background: #28473e; background: #28473e;
color: #fff; color: #fff;
} }
.navigation a[aria-current] {
box-shadow: inset 3px 0 #9dd3a8;
font-weight: 650;
}
.menu-toggle {
display: inline-flex;
align-items: center;
gap: 0.5rem;
min-height: 2.6rem;
padding: 0.35rem 0.7rem;
border: 1px solid #668e7f;
border-radius: 8px;
background: #28473e;
color: var(--sidebar-text);
cursor: pointer;
font-size: 0.85rem;
font-weight: 650;
}
.menu-icon {
width: 0.85rem;
height: 0.65rem;
border-block: 1px solid currentColor;
background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
}
.menu-toggle[hidden], .navigation[hidden] {
display: none;
}
.nav-icon { .nav-icon {
display: inline-block; display: inline-block;
width: 1rem; width: 1rem;
@@ -217,8 +249,8 @@ button, input, select, textarea {
.main { .main {
width: 100%; width: 100%;
max-width: 1230px; max-width: 1320px;
padding: clamp(1.25rem, 4.6vw, 4.5rem); padding: clamp(1.25rem, 4vw, 4rem);
} }
.page-heading { .page-heading {
@@ -226,7 +258,7 @@ button, input, select, textarea {
align-items: flex-start; align-items: flex-start;
justify-content: space-between; justify-content: space-between;
gap: 1rem; gap: 1rem;
margin-bottom: 1.45rem; margin-bottom: 1.65rem;
} }
.page-heading > div { .page-heading > div {
@@ -244,14 +276,14 @@ h1, h2, p, dl {
h1 { h1 {
overflow-wrap: anywhere; overflow-wrap: anywhere;
font-size: clamp(1.75rem, 4vw, 2.65rem); font-size: clamp(1.85rem, 4vw, 2.85rem);
font-weight: 750; font-weight: 760;
letter-spacing: -0.045em; letter-spacing: -0.045em;
line-height: 1.12; line-height: 1.12;
} }
h2 { h2 {
font-size: 1.06rem; font-size: 1.12rem;
font-weight: 700; font-weight: 700;
} }
@@ -266,7 +298,7 @@ h2 {
border: 1px solid var(--line); border: 1px solid var(--line);
border-radius: var(--radius); border-radius: var(--radius);
background: var(--surface); background: var(--surface);
box-shadow: 0 2px 5px #1a2e2010; box-shadow: 0 3px 9px #10291c0d;
} }
.main > section.surface + section.surface { .main > section.surface + section.surface {
@@ -321,6 +353,70 @@ h2 {
justify-content: space-between; justify-content: space-between;
} }
.section-text {
margin: 0.85rem 1.2rem;
overflow-wrap: anywhere;
}
.account-toolbar {
justify-content: space-between;
}
.account-toolbar form {
min-width: 0;
flex: 1 1 25rem;
}
.account-domain {
margin-top: 0.22rem;
}
.account-heading-meta {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.5rem 0.8rem;
margin-top: 0.6rem;
color: var(--muted);
}
.account-content {
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: 1.25rem;
}
.account-content :target {
scroll-margin-top: 1rem;
}
.account-navigation {
display: flex;
flex-wrap: wrap;
gap: 0.35rem 0.6rem;
border-bottom: 1px solid var(--line);
margin-bottom: 1.25rem;
padding-bottom: 0.6rem;
}
.account-navigation:empty {
display: none;
}
.account-navigation a {
min-height: 2.5rem;
padding: 0.5rem 0.75rem;
border-radius: 7px;
font-size: 0.9rem;
font-weight: 680;
text-decoration: none;
}
.account-navigation a:hover {
background: #e2eee6;
text-decoration: underline;
}
.pagination { .pagination {
justify-content: flex-end; justify-content: flex-end;
border-top: 1px solid var(--line); border-top: 1px solid var(--line);
@@ -381,7 +477,7 @@ th, td {
} }
th { th {
background: #edf1e9; background: #edf4ef;
color: #40594b; color: #40594b;
font-size: 0.78rem; font-size: 0.78rem;
font-weight: 700; font-weight: 700;
@@ -484,12 +580,23 @@ dd {
.status { .status {
display: inline-block; display: inline-block;
padding: 0.18rem 0.55rem; padding: 0.18rem 0.62rem;
border-radius: 0.75rem; border-radius: 0.75rem;
font-size: 0.78rem; font-size: 0.78rem;
font-weight: 680; font-weight: 680;
} }
.status::before {
display: inline-block;
width: 0.4rem;
height: 0.4rem;
border-radius: 50%;
margin-inline-end: 0.35rem;
vertical-align: 0.08em;
background: currentColor;
content: "";
}
.status.ready, .status.active { .status.ready, .status.active {
background: #dcebdc; background: #dcebdc;
color: #205038; color: #205038;
@@ -500,6 +607,11 @@ dd {
color: #6b431b; color: #6b431b;
} }
.status.failed {
background: #f9e5e1;
color: #862f25;
}
.configuration { .configuration {
margin: 0; margin: 0;
overflow-x: auto; overflow-x: auto;
@@ -598,7 +710,7 @@ dd {
position: static; position: static;
display: grid; display: grid;
height: auto; height: auto;
grid-template-columns: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr) auto auto;
gap: 0.65rem 0.3rem; gap: 0.65rem 0.3rem;
padding: 0.65rem 0.75rem; padding: 0.65rem 0.75rem;
} }
@@ -607,6 +719,12 @@ dd {
font-size: 1rem; font-size: 1rem;
} }
.brand-mark {
width: 1.95rem;
height: 1.95rem;
flex-basis: 1.95rem;
}
.navigation { .navigation {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@@ -616,10 +734,19 @@ dd {
} }
.navigation a { .navigation a {
padding: 0.38rem 0.55rem; min-height: 2.6rem;
padding: 0.38rem 0.65rem;
}
.menu-toggle {
grid-column: 3;
grid-row: 1;
align-self: center;
} }
.sidebar-account { .sidebar-account {
grid-column: 2;
grid-row: 1;
max-width: 8.5rem; max-width: 8.5rem;
justify-items: end; justify-items: end;
margin: 0; margin: 0;
@@ -629,6 +756,24 @@ dd {
} }
} }
@media (max-width: 375px) {
.sidebar {
grid-template-columns: minmax(0, 1fr) auto;
}
.menu-toggle {
grid-column: 2;
}
.sidebar-account {
grid-column: 1 / -1;
grid-row: 3;
display: flex;
max-width: none;
justify-content: space-between;
}
}
@media (max-width: 520px) { @media (max-width: 520px) {
.page-heading { .page-heading {
flex-direction: column; flex-direction: column;
@@ -1,7 +1,7 @@
<section class="surface" aria-labelledby="backups-heading"> <section class="surface" aria-labelledby="backups-heading">
<header class="section-heading"> <header class="section-heading">
<div> <div>
<h2 id="backups-heading">Backups</h2> <h2 id="backups-heading" tabindex="-1">Backups</h2>
<p class="heading-meta">Includes the website and its MariaDB databases.</p> <p class="heading-meta">Includes the website and its MariaDB databases.</p>
{% if account_backup_schedule %} {% if account_backup_schedule %}
<p class="heading-meta"> <p class="heading-meta">
@@ -5,7 +5,10 @@
<header class="page-heading"> <header class="page-heading">
<div> <div>
<h1>{{ account.name }}</h1> <h1>{{ account.name }}</h1>
<p class="heading-meta domain">{{ account.primary_domain }}</p> <div class="account-heading-meta">
<span class="domain">{{ account.primary_domain }}</span>
{% include "hosting/account_status.html" %}
</div>
</div> </div>
{% if manage_sftp or export_backup_manifest or is_operator and perms.hosting.change_hostingaccount or can_retire_account %} {% if manage_sftp or export_backup_manifest or is_operator and perms.hosting.change_hostingaccount or can_retire_account %}
<div class="form-actions"> <div class="form-actions">
@@ -28,7 +31,6 @@
{% endif %} {% endif %}
</header> </header>
<dl class="details surface"> <dl class="details surface">
<div><dt>Primary domain</dt><dd class="domain">{{ account.primary_domain }}</dd></div>
{% if is_tenant or perms.hosting.view_hostingplan %} {% if is_tenant or perms.hosting.view_hostingplan %}
<div><dt>Hosting plan</dt><dd>{% if account.hosting_plan %}{{ account.hosting_plan.name }}{% else %}Unassigned{% endif %}</dd></div> <div><dt>Hosting plan</dt><dd>{% if account.hosting_plan %}{{ account.hosting_plan.name }}{% else %}Unassigned{% endif %}</dd></div>
{% endif %} {% endif %}
@@ -40,10 +42,21 @@
{% endif %} {% endif %}
<div><dt>Added</dt><dd>{{ account.created_at|date:"j M Y, H:i" }} UTC</dd></div> <div><dt>Added</dt><dd>{{ account.created_at|date:"j M Y, H:i" }} UTC</dd></div>
</dl> </dl>
<nav class="account-navigation" aria-label="On this account">
{% if can_change_hosting_services or service_change %}<a href="#service-access-heading">Services</a>{% endif %}
{% if show_website %}<a href="#account-website">Website</a>{% endif %}
{% if is_tenant or perms.hosting.view_hostingdatabase %}<a href="#databases-heading">Databases</a>{% endif %}
{% if is_tenant or perms.hosting.view_hostingdnszone %}<a href="#dns-zones-heading">DNS</a>{% endif %}
{% if is_tenant or perms.hosting.view_hostingmailbox %}<a href="#mailboxes-heading">Mailboxes</a>{% endif %}
{% if show_account_backups %}<a href="#backups-heading">Backups</a>{% endif %}
</nav>
<div class="account-content">
{% if can_change_hosting_services or service_change %} {% if can_change_hosting_services or service_change %}
{% include "hosting/account_service_access.html" %} {% include "hosting/account_service_access.html" %}
{% endif %} {% endif %}
{% if can_measure_site_storage or website_storage.measured_at or can_change_site_storage_limit or website_limit.applied_at %} {% if show_website %}
<div class="account-content" id="account-website" tabindex="-1" role="group" aria-label="Website">
{% if show_website_storage %}
{% include "hosting/site_storage.html" %} {% include "hosting/site_storage.html" %}
{% endif %} {% endif %}
{% if website_php_settings %} {% if website_php_settings %}
@@ -52,10 +65,7 @@
{% if website_aliases or can_add_website_alias %} {% if website_aliases or can_add_website_alias %}
{% include "hosting/website_aliases.html" %} {% include "hosting/website_aliases.html" %}
{% endif %} {% endif %}
{% if show_account_backups %} {% if show_web_previews %}
{% include "hosting/account_backups.html" %}
{% endif %}
{% if is_reseller or is_operator and perms.hosting.view_webprovisioningplan %}
<section class="surface" aria-labelledby="previews-heading"> <section class="surface" aria-labelledby="previews-heading">
<header class="section-heading"> <header class="section-heading">
<h2 id="previews-heading">Recent Apache previews</h2> <h2 id="previews-heading">Recent Apache previews</h2>
@@ -69,11 +79,13 @@
{% include "hosting/plan_table.html" %} {% include "hosting/plan_table.html" %}
</section> </section>
{% endif %} {% endif %}
</div>
{% endif %}
{% if is_tenant or perms.hosting.view_hostingdatabase %} {% if is_tenant or perms.hosting.view_hostingdatabase %}
<section class="surface" aria-labelledby="databases-heading"> <section class="surface" aria-labelledby="databases-heading">
<header class="section-heading"> <header class="section-heading">
<div> <div>
<h2 id="databases-heading">MariaDB database requests</h2> <h2 id="databases-heading" tabindex="-1">MariaDB database requests</h2>
{% if is_tenant or perms.hosting.view_hostingplan %} {% if is_tenant or perms.hosting.view_hostingplan %}
{% if account.hosting_plan and account.hosting_plan.database_limit is not None %} {% if account.hosting_plan and account.hosting_plan.database_limit is not None %}
<p class="heading-meta">{{ databases|length }} of {{ account.hosting_plan.database_limit }} databases requested</p> <p class="heading-meta">{{ databases|length }} of {{ account.hosting_plan.database_limit }} databases requested</p>
@@ -130,7 +142,7 @@
{% if is_tenant or perms.hosting.view_hostingdnszone %} {% if is_tenant or perms.hosting.view_hostingdnszone %}
<section class="surface" aria-labelledby="dns-zones-heading"> <section class="surface" aria-labelledby="dns-zones-heading">
<header class="section-heading"> <header class="section-heading">
<h2 id="dns-zones-heading">DNS zones</h2> <h2 id="dns-zones-heading" tabindex="-1">DNS zones</h2>
{% if is_operator and perms.hosting.add_hostingdnszone and not has_primary_zone %} {% if is_operator and perms.hosting.add_hostingdnszone and not has_primary_zone %}
<a class="button primary" href="{% url 'panel:dns_zone_create' account.pk %}">Add DNS zone</a> <a class="button primary" href="{% url 'panel:dns_zone_create' account.pk %}">Add DNS zone</a>
{% endif %} {% endif %}
@@ -203,7 +215,7 @@
<section class="surface" aria-labelledby="mailboxes-heading"> <section class="surface" aria-labelledby="mailboxes-heading">
<header class="section-heading"> <header class="section-heading">
<div> <div>
<h2 id="mailboxes-heading">Mailbox requests</h2> <h2 id="mailboxes-heading" tabindex="-1">Mailbox requests</h2>
{% if is_tenant or perms.hosting.view_hostingplan %} {% if is_tenant or perms.hosting.view_hostingplan %}
{% if account.hosting_plan and account.hosting_plan.mailbox_limit is not None %} {% if account.hosting_plan and account.hosting_plan.mailbox_limit is not None %}
<p class="heading-meta">{{ mailboxes|length }} of {{ account.hosting_plan.mailbox_limit }} mailboxes requested</p> <p class="heading-meta">{{ mailboxes|length }} of {{ account.hosting_plan.mailbox_limit }} mailboxes requested</p>
@@ -267,4 +279,8 @@
{% endif %} {% endif %}
</section> </section>
{% endif %} {% endif %}
{% if show_account_backups %}
{% include "hosting/account_backups.html" %}
{% endif %}
</div>
{% endblock %} {% endblock %}
@@ -11,23 +11,25 @@
<a class="button primary" href="{% url 'panel:account_create' %}">Add hosting account</a> <a class="button primary" href="{% url 'panel:account_create' %}">Add hosting account</a>
{% endif %} {% endif %}
</header> </header>
{% if is_operator and perms.hosting.retire_hosting_account %}
<p><a class="record-link" href="{% url 'panel:retirements' %}">Retired accounts</a></p>
{% endif %}
<section class="surface" aria-label="Hosting account list"> <section class="surface" aria-label="Hosting account list">
<form class="toolbar" method="get" action="{% url 'panel:accounts' %}" role="search"> <div class="toolbar account-toolbar">
<form class="form-actions" method="get" action="{% url 'panel:accounts' %}" role="search">
<label class="visually-hidden" for="account-search">Search by name or domain</label> <label class="visually-hidden" for="account-search">Search by name or domain</label>
<input type="search" id="account-search" name="q" placeholder="Name or domain" value="{{ search }}"> <input type="search" id="account-search" name="q" placeholder="Name or domain" value="{{ search }}">
<button class="button secondary" type="submit">Search</button> <button class="button secondary" type="submit">Search</button>
{% if search %}<a class="quiet-link" href="{% url 'panel:accounts' %}">Clear</a>{% endif %} {% if search %}<a class="quiet-link" href="{% url 'panel:accounts' %}">Clear</a>{% endif %}
</form> </form>
{% if is_operator and perms.hosting.retire_hosting_account %}
<a class="quiet-link" href="{% url 'panel:retirements' %}">Retired accounts</a>
{% endif %}
</div>
{% if accounts %} {% if accounts %}
<div class="table-scroll"> <div class="table-scroll">
<table> <table>
<thead> <thead>
<tr> <tr>
<th scope="col">Account</th> <th scope="col">Account</th>
<th scope="col">Primary domain</th> <th scope="col">Status</th>
{% if is_tenant or perms.hosting.view_hostingplan %}<th scope="col">Hosting plan</th>{% endif %} {% if is_tenant or perms.hosting.view_hostingplan %}<th scope="col">Hosting plan</th>{% endif %}
<th scope="col" class="cell-date">Added</th> <th scope="col" class="cell-date">Added</th>
</tr> </tr>
@@ -35,8 +37,11 @@
<tbody> <tbody>
{% for account in accounts %} {% for account in accounts %}
<tr> <tr>
<td><a class="record-link" href="{{ account.get_absolute_url }}">{{ account.name }}</a></td> <td>
<td class="domain">{{ account.primary_domain }}</td> <a class="record-link" href="{{ account.get_absolute_url }}">{{ account.name }}</a>
<div class="domain muted account-domain">{{ account.primary_domain }}</div>
</td>
<td>{% include "hosting/account_status.html" %}</td>
{% if is_tenant or perms.hosting.view_hostingplan %} {% if is_tenant or perms.hosting.view_hostingplan %}
<td>{% if account.hosting_plan %}{{ account.hosting_plan.name }}{% else %}<span class="muted">Unassigned</span>{% endif %}</td> <td>{% if account.hosting_plan %}{{ account.hosting_plan.name }}{% else %}<span class="muted">Unassigned</span>{% endif %}</td>
{% endif %} {% endif %}
@@ -1,5 +1,5 @@
<section class="surface" aria-labelledby="service-access-heading"> <section class="surface" aria-labelledby="service-access-heading">
<header class="section-heading"><h2 id="service-access-heading">Hosting service access</h2></header> <header class="section-heading"><h2 id="service-access-heading" tabindex="-1">Hosting service access</h2></header>
<dl class="details"> <dl class="details">
<div> <div>
<dt>Requested state</dt> <dt>Requested state</dt>
@@ -40,9 +40,9 @@
</table> </table>
</div> </div>
{% endif %} {% endif %}
<p>Suspension blocks website requests and new SFTP, database, and mailbox logins. DNS, incoming mail, and panel sign-in stay available.</p> <p class="section-text">Suspension blocks website requests and new SFTP, database, and mailbox logins. DNS, incoming mail, and panel sign-in stay available.</p>
{% if service_change_history %} {% if service_change_history %}
<details> <details class="section-text">
<summary>Recent service changes</summary> <summary>Recent service changes</summary>
<ul> <ul>
{% for prior_change in service_change_history %} {% for prior_change in service_change_history %}
@@ -56,15 +56,15 @@
{% endif %} {% endif %}
{% if service_change_error %}<p class="errorlist" role="alert">{{ service_change_error }}</p>{% endif %} {% if service_change_error %}<p class="errorlist" role="alert">{{ service_change_error }}</p>{% endif %}
{% if not service_change_pending %} {% if not service_change_pending %}
<form class="form-actions" method="post" action="{% url 'panel:account_service_access' account.pk %}"> <form class="form-actions section-text" method="post" action="{% url 'panel:account_service_access' account.pk %}">
{% csrf_token %} {% csrf_token %}
{% if service_change_failed %} {% if service_change_failed %}
<button type="submit" name="action" value="retry">Retry failed services</button> <button class="button primary" type="submit" name="action" value="retry">Retry failed services</button>
{% endif %} {% endif %}
{% if account.services_suspended %} {% if account.services_suspended %}
<button class="secondary" type="submit" name="action" value="resume">Resume services</button> <button class="button secondary" type="submit" name="action" value="resume">Resume services</button>
{% else %} {% else %}
<button class="secondary" type="submit" name="action" value="suspend">Suspend services</button> <button class="button secondary" type="submit" name="action" value="suspend">Suspend services</button>
{% endif %} {% endif %}
</form> </form>
{% endif %} {% endif %}
@@ -0,0 +1 @@
{% if account.services_suspended %}<span class="status suspended">Suspended</span>{% else %}<span class="status active">Active</span>{% endif %}
@@ -15,34 +15,38 @@
<span class="brand-mark" aria-hidden="true">C</span> <span class="brand-mark" aria-hidden="true">C</span>
<span>Coulobre <span class="brand-product">Panel</span></span> <span>Coulobre <span class="brand-product">Panel</span></span>
</a> </a>
<nav class="navigation" aria-label="Main navigation"> <button class="menu-toggle" type="button" aria-controls="panel-navigation" aria-expanded="true" hidden>
<span class="menu-icon" aria-hidden="true"></span>
Menu
</button>
<nav class="navigation" id="panel-navigation" aria-label="Main navigation">
{% with current=request.resolver_match.url_name %} {% with current=request.resolver_match.url_name %}
{% if is_tenant or perms.hosting.view_hostingaccount %} {% if is_tenant or perms.hosting.view_hostingaccount %}
<a href="{% url 'panel:accounts' %}"{% if current == 'accounts' or current == 'account' or current == 'account_create' or current == 'account_edit' or current == 'database_create' %} aria-current="page"{% endif %}> <a href="{% url 'panel:accounts' %}"{% if panel_section == 'accounts' %} aria-current="{% if current == 'accounts' %}page{% else %}location{% endif %}"{% endif %}>
<span class="nav-icon nav-icon-accounts" aria-hidden="true"></span> <span class="nav-icon nav-icon-accounts" aria-hidden="true"></span>
Hosting accounts Hosting accounts
</a> </a>
{% endif %} {% endif %}
{% if is_operator and perms.hosting.view_customer %} {% if is_operator and perms.hosting.view_customer %}
<a href="{% url 'panel:customers' %}"{% if current == 'customers' or current == 'customer_create' %} aria-current="page"{% endif %}> <a href="{% url 'panel:customers' %}"{% if panel_section == 'customers' %} aria-current="{% if current == 'customers' %}page{% else %}location{% endif %}"{% endif %}>
<span class="nav-icon nav-icon-customers" aria-hidden="true"></span> <span class="nav-icon nav-icon-customers" aria-hidden="true"></span>
Customers Customers
</a> </a>
{% endif %} {% endif %}
{% if is_operator and perms.hosting.view_reseller %} {% if is_operator and perms.hosting.view_reseller %}
<a href="{% url 'panel:resellers' %}"{% if current == 'resellers' or current == 'reseller_create' or current == 'reseller' or current == 'reseller_edit' %} aria-current="page"{% endif %}> <a href="{% url 'panel:resellers' %}"{% if panel_section == 'resellers' %} aria-current="{% if current == 'resellers' %}page{% else %}location{% endif %}"{% endif %}>
<span class="nav-icon nav-icon-resellers" aria-hidden="true"></span> <span class="nav-icon nav-icon-resellers" aria-hidden="true"></span>
Resellers Resellers
</a> </a>
{% endif %} {% endif %}
{% if is_operator and perms.hosting.view_hostingplan %} {% if is_operator and perms.hosting.view_hostingplan %}
<a href="{% url 'panel:hosting_plans' %}"{% if current == 'hosting_plans' or current == 'hosting_plan_create' or current == 'hosting_plan_edit' %} aria-current="page"{% endif %}> <a href="{% url 'panel:hosting_plans' %}"{% if panel_section == 'hosting_plans' %} aria-current="{% if current == 'hosting_plans' %}page{% else %}location{% endif %}"{% endif %}>
<span class="nav-icon nav-icon-packages" aria-hidden="true"></span> <span class="nav-icon nav-icon-packages" aria-hidden="true"></span>
Hosting plans Hosting plans
</a> </a>
{% endif %} {% endif %}
{% if is_reseller or is_operator and perms.hosting.view_webprovisioningplan %} {% if is_reseller or is_operator and perms.hosting.view_webprovisioningplan %}
<a href="{% url 'panel:plans' %}"{% if current == 'plans' or current == 'plan' %} aria-current="page"{% endif %}> <a href="{% url 'panel:plans' %}"{% if panel_section == 'plans' %} aria-current="{% if current == 'plans' %}page{% else %}location{% endif %}"{% endif %}>
<span class="nav-icon nav-icon-plans" aria-hidden="true"></span> <span class="nav-icon nav-icon-plans" aria-hidden="true"></span>
Web provisioning Web provisioning
</a> </a>
@@ -63,7 +67,7 @@
</form> </form>
</div> </div>
</aside> </aside>
<main class="main" id="main-content"> <main class="main" id="main-content" tabindex="-1">
{% if request.impersonation %} {% if request.impersonation %}
<section class="notice customer-preview" aria-label="Customer view"> <section class="notice customer-preview" aria-label="Customer view">
<div> <div>
@@ -83,6 +87,7 @@
{% block content %}{% endblock %} {% block content %}{% endblock %}
</main> </main>
</div> </div>
<script src="{% static 'hosting/panel-navigation.js' %}" defer></script>
{% else %} {% else %}
{% block public_content %}{% endblock %} {% block public_content %}{% endblock %}
{% endif %} {% endif %}
@@ -1,7 +1,7 @@
{% if provisioning.state == "configured" %} {% if provisioning.state == "configured" %}
<span class="status ready">Configured</span> <span class="status ready">Configured</span>
{% elif provisioning.state == "failed" %} {% elif provisioning.state == "failed" %}
<span class="status suspended">Provisioning failed</span> <span class="status failed">Provisioning failed</span>
{% elif provisioning.state == "running" %} {% elif provisioning.state == "running" %}
<span class="status pending">Provisioning</span> <span class="status pending">Provisioning</span>
{% elif provisioning %} {% elif provisioning %}
+17
View File
@@ -511,6 +511,7 @@ class AccountDetail(TenantScopeMixin, PermissionRequiredMixin, DetailView):
if reseller is not None or ( if reseller is not None or (
customer is None and user.has_perm(VIEW_PLANS) customer is None and user.has_perm(VIEW_PLANS)
): ):
context["show_web_previews"] = True
context["plans"] = self.object.webprovisioningplan_set.order_by( context["plans"] = self.object.webprovisioningplan_set.order_by(
"-requested_at", "-pk" "-requested_at", "-pk"
)[:10] )[:10]
@@ -577,6 +578,22 @@ class AccountDetail(TenantScopeMixin, PermissionRequiredMixin, DetailView):
if mailbox_can_open_webmail(mailbox) if mailbox_can_open_webmail(mailbox)
} }
context["mailboxes"] = mailboxes context["mailboxes"] = mailboxes
context["show_website_storage"] = bool(
context["can_measure_site_storage"]
or context["can_change_site_storage_limit"]
or getattr(context.get("website_storage"), "measured_at", None)
or getattr(context.get("website_limit"), "applied_at", None)
)
context["show_website"] = any(
context.get(name)
for name in (
"show_website_storage",
"website_php_settings",
"website_aliases",
"can_add_website_alias",
"show_web_previews",
)
)
return context return context