diff --git a/docs/panel-design.md b/docs/panel-design.md index 361f844..205a1dd 100644 --- a/docs/panel-design.md +++ b/docs/panel-design.md @@ -58,6 +58,20 @@ heading, help, fields, and actions should share a left edge. and its theme tokens for type, color, spacing, and focus states. Avoid fixed control widths, inline styles, and page-specific font sizes. +### Resource actions + +- Style explicit resource actions as buttons. Use `.button secondary compact` + for row-level actions such as **Import mail**, **Change password**, and + **Manage logins**. Use `.button danger compact` for opening a removal + workflow. Keep the final destructive confirmation visually distinct. +- Group row actions in a wrapping `.table-actions` or `.form-actions` + container. Keep a single, full-size primary action in the page or section + header when the page offers one, such as **Add mailbox**. +- Keep ordinary navigation, record names, and contextual help as links. An + action that opens a form, confirmation page, or download is still an + `` styled as a button. An action that submits the change uses a + native ` + {% endif %} {% endif %} @@ -80,7 +80,7 @@ {% if job.archive_bytes %}
{{ job.archive_bytes|filesizeformat }}
{% endif %} {% if job.retention_protected %}
Protected from retention
{% endif %} {% if manage_backup_retention and job.scheduled_for %} -
Manage protection
+
Manage protection
{% endif %} {% if manage_backup_retention and job.expiration.problem %}
{{ job.expiration.problem }}
@@ -88,13 +88,13 @@ {% if job.pk in website_restore_sources or job.pk in database_restore_sources or job.pk in mailbox_restore_sources %}
{% if job.pk in website_restore_sources %} - Restore website + Restore website {% endif %} {% if job.pk in database_restore_sources %} - Restore database + Restore database {% endif %} {% if job.pk in mailbox_restore_sources %} - Restore mailbox + Restore mailbox {% endif %}
{% endif %} diff --git a/src/coulobre/hosting/templates/hosting/account_detail.html b/src/coulobre/hosting/templates/hosting/account_detail.html index 83ddc3b..af9ede8 100644 --- a/src/coulobre/hosting/templates/hosting/account_detail.html +++ b/src/coulobre/hosting/templates/hosting/account_detail.html @@ -26,7 +26,7 @@
{% if is_tenant or perms.hosting.view_hostingplan %}
Hosting package
{% if account.hosting_plan %}{{ account.hosting_plan.name }}{% else %}Unassigned{% endif %} - {% if is_reseller %}Assign plan{% endif %}
+ {% if is_reseller %}Assign plan{% endif %} {% endif %} {% if is_operator and perms.hosting.view_reseller %}
Manager
{{ account.reseller|default_if_none:"Unassigned" }}
@@ -41,12 +41,12 @@ {{ account.customer }} {% else %}Assigned{% endif %} {% else %} - Add customer login + Add customer login
{% csrf_token %}
{% if reseller_customer_link %} - Link existing customer + Link existing customer {% endif %} {% endif %} @@ -171,16 +171,16 @@ {% endif %} {% if not database.provisioning %}Requested{% endif %} {% if show_database_credentials %} - Connection details + Connection details {% endif %} {% if show_phpmyadmin %}
{% csrf_token %} - +
{% endif %} {% if is_operator %} - Download manifest + Download manifest {% endif %} {% if is_operator and manage_database_provisioning and database.provisioning.problem %} @@ -229,9 +229,9 @@ {% if is_operator %}
- Download manifest + Download manifest {% if show_dns_replication %} - Check replication + Check replication {% endif %} {% if manage_dns_publishing %} {% include "hosting/dns_publication.html" with publication=zone.publication %} @@ -301,15 +301,15 @@ {{ domain }} {% include "hosting/mail_domain_assignment.html" with may_retry=local_mailbox_enabled %} - Check email setup + Check email setup {% if manage_mail_routing %} - Manage routing + Manage routing {% endif %} {% if show_mail_queue %} - Mail queue + Mail queue {% endif %} {% if can_manage_smtp_apps %} - Application SMTP + Application SMTP {% endif %} {% endfor %} @@ -362,17 +362,17 @@ {% if mailbox.pk in webmail_mailbox_ids %}
{% csrf_token %} - +
{% endif %} {% if manage_mail_vacation %} - Automatic replies + Automatic replies {% endif %} {% if show_mailbox_credentials %} - Connection details + Connection details {% endif %} {% if is_operator %} - Download manifest + Download manifest {% endif %} {% endif %} {% include "hosting/mailbox_management_links.html" %} diff --git a/src/coulobre/hosting/templates/hosting/all_users.html b/src/coulobre/hosting/templates/hosting/all_users.html index d5b6a12..d7a6796 100644 --- a/src/coulobre/hosting/templates/hosting/all_users.html +++ b/src/coulobre/hosting/templates/hosting/all_users.html @@ -35,13 +35,13 @@
{% if not login.is_staff and not login.is_superuser %} {% if login.hosting_reseller and perms.hosting.change_reseller %} - Contact and invitation + Contact and invitation {% elif not login.hosting_reseller and login.hosting_customer and perms.hosting.change_customer %} - Contact and invitation + Contact and invitation {% endif %} {% endif %} {% if may_delete %} - Delete user + Delete user {% endif %}
diff --git a/src/coulobre/hosting/templates/hosting/authenticator_setup.html b/src/coulobre/hosting/templates/hosting/authenticator_setup.html index 9dabf97..2ddeb40 100644 --- a/src/coulobre/hosting/templates/hosting/authenticator_setup.html +++ b/src/coulobre/hosting/templates/hosting/authenticator_setup.html @@ -3,7 +3,7 @@

Scan this QR code with your authenticator app.

Authenticator setup QR code -

Open in an authenticator app

+

Open in an authenticator app

Enter the setup key manually
diff --git a/src/coulobre/hosting/templates/hosting/customer_databases.html b/src/coulobre/hosting/templates/hosting/customer_databases.html index 423a6ab..82f328a 100644 --- a/src/coulobre/hosting/templates/hosting/customer_databases.html +++ b/src/coulobre/hosting/templates/hosting/customer_databases.html @@ -10,12 +10,12 @@
{% for db in databases %} - + {% empty %}{% endfor %}
DatabaseStatePrimary loginAdditional logins
{{ db.spec.name }}{{ db.provisioning.state|default:"Requested"|capfirst }} +
{{ db.spec.name }}{{ db.provisioning.state|default:"Requested"|capfirst }}
{% if db.provisioning.state == 'configured' %} - {% if can_reveal %}Credentials{% endif %} - {% if show_sso %}
{% csrf_token %}
{% endif %} + {% if can_reveal %}Credentials{% endif %} + {% if show_sso %}
{% csrf_token %}
{% endif %} {% endif %} -
{{ db.logins.count }} · Manage logins
{{ db.logins.count }} · Manage logins
No databases in this hosting account.
{% endblock %} diff --git a/src/coulobre/hosting/templates/hosting/customer_redirects.html b/src/coulobre/hosting/templates/hosting/customer_redirects.html index 59d935e..1eb15ed 100644 --- a/src/coulobre/hosting/templates/hosting/customer_redirects.html +++ b/src/coulobre/hosting/templates/hosting/customer_redirects.html @@ -17,7 +17,7 @@ {% endblock %} {% block page_content %} {% if sites %} - {% if job and not job.finished_at %}

{{ job.state|capfirst }} · Refresh status

{% endif %} + {% if job and not job.finished_at %}

{{ job.state|capfirst }} · Refresh status

{% endif %} {% if problem %}{% endif %} {% if job.problem %}{% endif %}
diff --git a/src/coulobre/hosting/templates/hosting/database_logins.html b/src/coulobre/hosting/templates/hosting/database_logins.html index e7b3399..6c4212a 100644 --- a/src/coulobre/hosting/templates/hosting/database_logins.html +++ b/src/coulobre/hosting/templates/hosting/database_logins.html @@ -11,13 +11,13 @@ {% for login in logins %} - + {% if login.finished_at %}{% csrf_token %}{% endif %} + {% empty %}{% endfor %}
LoginAccessStateActions
{{ login.label }}
{{ login.spec.name }}
{{ login.get_access_display }}{{ login.state|capfirst }}{% if login.problem %}

{{ login.problem }}

{% endif %}
+
{% if login.state == 'configured' and login.action == 'grant' %} - {% if can_reveal %}Credentials{% endif %} - {% if show_sso %}
{% csrf_token %}
{% endif %} + {% if can_reveal %}Credentials{% endif %} + {% if show_sso %}
{% csrf_token %}
{% endif %} {% endif %} - {% if login.finished_at %}
{% csrf_token %}
{% endif %} -
No additional logins.
diff --git a/src/coulobre/hosting/templates/hosting/domain_workspace.html b/src/coulobre/hosting/templates/hosting/domain_workspace.html index 46cd69e..305214a 100644 --- a/src/coulobre/hosting/templates/hosting/domain_workspace.html +++ b/src/coulobre/hosting/templates/hosting/domain_workspace.html @@ -70,9 +70,9 @@
{% if mailbox.provisioning.state == 'configured' and not mailbox.removal %} {% if show_mailbox_credentials %} - Credentials + Credentials {% elif not show_mailbox_rotation and not customer_mailbox_quota %}Use the current mailbox password{% endif %} - {% if roundcube_enabled %}
{% csrf_token %}
{% endif %} + {% if roundcube_enabled %}
{% csrf_token %}
{% endif %} {% endif %} {% include "hosting/mailbox_management_links.html" %}
@@ -88,8 +88,8 @@ {% endif %} {% endif %} {% if mail_domain %}
- Check email DNS - {% if can_manage_smtp_apps %}Application SMTP{% endif %} + Check email DNS + {% if can_manage_smtp_apps %}Application SMTP{% endif %}
{% endif %}
{% endif %} diff --git a/src/coulobre/hosting/templates/hosting/feature_setup.html b/src/coulobre/hosting/templates/hosting/feature_setup.html index c3e9343..8be887b 100644 --- a/src/coulobre/hosting/templates/hosting/feature_setup.html +++ b/src/coulobre/hosting/templates/hosting/feature_setup.html @@ -2,6 +2,6 @@
Setup guide {% if show_dns_link and feature.setting == 'DEFAULT_DNS_ZONES' %} - Configure DNS defaults + Configure DNS defaults {% endif %}
diff --git a/src/coulobre/hosting/templates/hosting/independent_websites.html b/src/coulobre/hosting/templates/hosting/independent_websites.html index a4676de..ba3a5e1 100644 --- a/src/coulobre/hosting/templates/hosting/independent_websites.html +++ b/src/coulobre/hosting/templates/hosting/independent_websites.html @@ -27,14 +27,14 @@ {% if website.storage_limit_mib %}{{ website.storage_limit_mib }} MiB{% elif website.activated %}Unlimited{% else %}—{% endif %}
{% if manage_website_files and website.activated and not website.suspended and not website.retired_at %} - Files + Files {% endif %} {% for action in actions %} - {% if action.value == 'settings' %}{{ action.label }} - {% else %}{{ action.label }}{% endif %} + {% if action.value == 'settings' %}{{ action.label }} + {% else %}{{ action.label }}{% endif %} {% endfor %} {% if is_operator and perms.hosting.view_hostingaccount %} - Download manifest + Download manifest {% endif %}
diff --git a/src/coulobre/hosting/templates/hosting/installation.html b/src/coulobre/hosting/templates/hosting/installation.html index a2c11bb..76654a9 100644 --- a/src/coulobre/hosting/templates/hosting/installation.html +++ b/src/coulobre/hosting/templates/hosting/installation.html @@ -41,7 +41,7 @@ {% if enabled and not feature.socket_ready %}Service socket unavailable{% endif %} {% if configured and feature.role %}{% if feature.linked %}Linked receiver{% else %}Local{% endif %}{% endif %} {% if request.user.is_superuser and feature.setting == 'DEFAULT_DNS_ZONES' %} - Configure DNS defaults + Configure DNS defaults {% endif %}
diff --git a/src/coulobre/hosting/templates/hosting/mailbox_management_links.html b/src/coulobre/hosting/templates/hosting/mailbox_management_links.html index 6cee312..cb7fcee 100644 --- a/src/coulobre/hosting/templates/hosting/mailbox_management_links.html +++ b/src/coulobre/hosting/templates/hosting/mailbox_management_links.html @@ -1,20 +1,20 @@ {% if mailbox.removal %} {% if can_remove_mailbox and mailbox.removal.problem %} - Retry removal + Retry removal {% endif %} {% else %} {% if mailbox_import_enabled and mailbox.provisioning.state == "configured" %} - Import mail + Import mail {% endif %} {% if show_mailbox_rotation and mailbox.provisioning.state == "configured" %} - Change password + Change password {% endif %} {% if change_mailbox_quota or customer_mailbox_quota and mailbox.provisioning.state == "configured" %} - Change storage limit + Change storage limit {% elif customer_mailbox_quota and mailbox.provisioning.state == "failed" and mailbox.provisioning.quota_update %} - Retry storage limit change + Retry storage limit change {% endif %} {% if can_remove_mailbox and mailbox.provisioning.state == "configured" %} - Remove mailbox + Remove mailbox {% endif %} {% endif %} diff --git a/src/coulobre/hosting/templates/hosting/operator_backups.html b/src/coulobre/hosting/templates/hosting/operator_backups.html index 8956f25..fe6e1c2 100644 --- a/src/coulobre/hosting/templates/hosting/operator_backups.html +++ b/src/coulobre/hosting/templates/hosting/operator_backups.html @@ -15,7 +15,7 @@ {{ account.primary_domain }}{{ account.reseller|default:"Unassigned" }} {% if account.last_backup %}{{ account.last_backup|date:"j M Y H:i" }} UTC · {% if account.last_problem %}Failed{% elif account.last_completed %}Completed{% else %}Queued{% endif %}{% else %}None{% endif %} {% if account.backup_schedule.enabled %}{{ account.backup_schedule.get_frequency_display }} at {{ account.backup_schedule.time|time:"H:i" }} UTC{% else %}Disabled{% endif %} - Archives and restores{% if enabled %} · Schedule{% endif %} +
Archives and restores{% if enabled %}Schedule{% endif %}
{% empty %}No accounts available.{% endfor %}
diff --git a/src/coulobre/hosting/templates/hosting/panel_peers.html b/src/coulobre/hosting/templates/hosting/panel_peers.html index 07c1be3..ac3a554 100644 --- a/src/coulobre/hosting/templates/hosting/panel_peers.html +++ b/src/coulobre/hosting/templates/hosting/panel_peers.html @@ -65,13 +65,13 @@ {% endif %} - Authorize a check of this panel + Authorize a check of this panel {% endif %}
Revoke access
{% csrf_token %} - +
diff --git a/src/coulobre/hosting/templates/hosting/website_aliases.html b/src/coulobre/hosting/templates/hosting/website_aliases.html index 8ac2361..cd99333 100644 --- a/src/coulobre/hosting/templates/hosting/website_aliases.html +++ b/src/coulobre/hosting/templates/hosting/website_aliases.html @@ -31,12 +31,12 @@
{% if alias.problem %} {% if alias.operation != "https" or can_enable_alias_https %} - Retry + Retry {% endif %} {% elif can_enable_alias_https and alias.http_active and not alias.https_active %} - Enable HTTPS + Enable HTTPS {% endif %} - Remove + Remove
{% endif %} diff --git a/src/coulobre/hosting/templates/hosting/website_files.html b/src/coulobre/hosting/templates/hosting/website_files.html index 2246185..448e522 100644 --- a/src/coulobre/hosting/templates/hosting/website_files.html +++ b/src/coulobre/hosting/templates/hosting/website_files.html @@ -49,8 +49,8 @@ {% if entry.is_directory %}Folder{% else %}{{ entry.size|filesizeformat }}{% endif %} diff --git a/src/coulobre/hosting/test_mailbox_imports.py b/src/coulobre/hosting/test_mailbox_imports.py index 8a4984a..8124703 100644 --- a/src/coulobre/hosting/test_mailbox_imports.py +++ b/src/coulobre/hosting/test_mailbox_imports.py @@ -76,6 +76,30 @@ class MailboxImportTests(TestCase): def queue(self): return imports.queue_import(self.mailbox, self.customer, self.data()) + @override_settings(MAILBOX_PASSWORD_CHANGES=True) + def test_mailbox_actions_use_compact_buttons_on_both_pages(self): + self.sign_in(self.customer) + account = self.mailbox.mail_domain.account + email = reverse("panel:domain_workspace", args=[account.pk, "email"]) + for path in (email, account.get_absolute_url()): + response = self.client.get(path, secure=True) + for name, label, variant in ( + ("mailbox_import", "Import mail", "secondary"), + ( + "mailbox_credential_rotation", + "Change password", + "secondary", + ), + ("mailbox_removal", "Remove mailbox", "danger"), + ): + with self.subTest(path=path, action=name): + url = reverse(f"panel:{name}", args=[self.mailbox.pk]) + self.assertContains( + response, + f'{label}") + def test_only_the_owner_and_authorized_operator_can_start_import(self): self.sign_in(self.stranger) self.assertEqual(self.client.get(self.url()).status_code, 404)