Group account creation links and use consistent package labels

This commit is contained in:
parkel committed 2026-11-24 08:57:25 +01:00
1 parent 1c3ee425d1
commit 287daf5036
31 files changed
+140 -97

No files matched your search

+13 -13
View File
@@ -631,8 +631,8 @@ A verified superuser can assign a Customer or Manager role to an
active login from **Customers** or **Managers**. Choose **Assign
to existing login** and enter the username. Customer roles use their own
assigned hosting accounts. Managers use their own hosting account
assignments and hosting plan policy. New manager assignments use the default
manager profile when one is configured.
assignments and hosting package policy. New manager assignments use the default
manager package when one is configured.
Logins with multiple roles can choose **Panel role** in the account area.
The role applies to the session, including direct page requests and actions.
@@ -955,7 +955,7 @@ first mailbox adds the signing key's public DKIM record.
## Verify a new installation
Use a test hosting plan, account, and domain for these checks. Enable the
Use a test hosting package, account, and domain for these checks. Enable the
local services that the installation will offer before checking them.
1. Sign in through the hostname clients will use. Check the HTTPS certificate,
@@ -1052,7 +1052,7 @@ to see the latest result. [Website storage measurement](development.md#measure-w
To enforce hard limits, prepare a dedicated ext4 volume with user quotas for
the managed sites. Use **Change storage limit** on the deployed account to
apply the hosting plan's default or choose a per-site value.
apply the hosting package's default or choose a per-site value.
[Website storage quotas](development.md#apply-a-website-storage-limit)
### Choose PHP versions for hosted websites
@@ -1072,7 +1072,7 @@ sudo apt install php8.5-fpm php8.6-fpm
sudo systemctl enable --now php8.5-fpm php8.6-fpm
```
Under **Hosting plans**, enter the **Allowed PHP series** as a comma-separated
Under **Hosting packages**, enter the **Allowed PHP series** as a comma-separated
list, such as `8.5, 8.6`. A blank list makes every installed stable series
available. New website activations select the newest installed stable series
in the plan. Each active site retains its recorded series when a package or
@@ -1104,7 +1104,7 @@ jobs use their own configured runtimes. Use a versioned command such as
### Configure PHP pool limits per website
Under **Hosting plans**, set default PHP memory, upload size, request timeout,
Under **Hosting packages**, set default PHP memory, upload size, request timeout,
or PHP-FPM worker limits. The panel captures these values when an operator
first requests local activation. A repeat activation preserves an installed
pool's settings.
@@ -1157,7 +1157,7 @@ serves no tenant content when unknown hosts should be rejected.
## Host independent websites
Set a hosting plan's **Website limit** above one to allow additional
Set a hosting package's **Website limit** above one to allow additional
websites under an account. The limit includes the primary website. Existing
plans start with one website. In **Independent websites**, choose **Add
website** to provision a domain or subdomain with its own document root,
@@ -2124,7 +2124,7 @@ To locate that file, download the manifest and use the node's `apply` command.
Reapplying the manifest preserves the password and prints the file path.
[Show mailbox connection details in the panel](#show-local-database-and-mailbox-connection-details)
Set a per-mailbox storage limit on the hosting plan for new mailbox requests.
Set a per-mailbox storage limit on the hosting package for new mailbox requests.
Enable Dovecot quota enforcement on the mail node before provisioning them.
[Mailbox storage limits](development.md#enforce-mailbox-storage-limits)
@@ -2167,7 +2167,7 @@ smtpd_reject_unlisted_recipient = yes
Run `sudo postfix check` and `sudo postfix reload`. Set
`COULOBRE_MAIL_ROUTING=1` in `/etc/coulobre/panel.env`. Operators can opt a
hosting plan into catch-all and external forwarding separately. Plan changes
hosting package into catch-all and external forwarding separately. Plan changes
are checked when saving the next routing revision. To revoke an active
forwarder or catch-all, remove the rule and apply the update.
@@ -2689,9 +2689,9 @@ remote receiver, while databases still use the local credential service.
## Set up manager access
Open **Managers** to add a manager login or change an existing manager's
panel access, account limit, and allowed hosting plans. The detail page shows
panel access, account limit, and allowed hosting packages. The detail page shows
allocated accounts and audit history. Viewing account names and plan details
requires the corresponding hosting account and hosting plan permissions.
requires the corresponding hosting account and hosting package permissions.
The account limit and allowed plans apply when a manager creates a hosting
account. Reducing the limit or removing a plan takes effect on the next
@@ -2702,8 +2702,8 @@ changes to manager policy and account assignments made through the panel.
### Onboard customers
Managers can open **My users** to create a customer login and its first
hosting account together. Choose an allowed hosting plan and give the
Managers can open **Add User** to create a customer login and its first
hosting account together. Choose an allowed hosting package and give the
customer's email address to send a welcome email with a link to set their
password. Preview the email before creating the account. To add a login
for an existing unassigned hosting account, open the account and choose
+8 -8
View File
@@ -19,11 +19,11 @@ Select **Add hosting account** and enter a name and a primary domain such as
`example.org`. Open an account from the list to edit its details or request an
Apache preview. Manage users, groups, and permissions at `/admin/`.
Use **Hosting plans** to add named plans with an optional description. Choose a
Use **Hosting packages** to add named plans with an optional description. Choose a
plan when creating or editing an account. Existing accounts start unassigned.
Operators need permission to view hosting plans before they can assign one.
Operators need permission to view hosting packages before they can assign one.
Set a database limit and a mailbox limit on a hosting plan to cap how many
Set a database limit and a mailbox limit on a hosting package to cap how many
requests each assigned account can make through the panel. A blank limit allows
unlimited requests. Zero blocks new requests of that type. Accounts without a
plan have unlimited requests. The account page shows usage for configured
@@ -39,7 +39,7 @@ Set **Website storage limit (MiB)** to supply the initial value when an
operator applies a website quota from the account page.
[Apply a website storage limit](#apply-a-website-storage-limit)
Set optional PHP resource defaults on a hosting plan. Coulobre applies them
Set optional PHP resource defaults on a hosting package. Coulobre applies them
on first local activation and when an operator reapplies the plan on the
account page. See [website PHP settings](deployment.md#configure-php-pool-limits-per-website).
@@ -56,11 +56,11 @@ Then open a hosting account in Coulobre Panel and select the manager when
editing the account. Existing accounts start with no manager assigned.
Managers can sign in to Coulobre Panel to see their assigned hosting accounts
and plans. They can also onboard customers and assign an allowed hosting plan
and plans. They can also onboard customers and assign an allowed hosting package
to an existing account.
To let the manager add accounts, set a positive account limit and select the
available hosting plans in the manager's admin record. The manager's account
available hosting packages in the manager's admin record. The manager's account
list shows their allowance. The limit applies to self-service creation, and
operator assignments also count toward the allowance. New hosting accounts
automatically belong to the manager and require an allowed plan. A limit of
@@ -83,7 +83,7 @@ should be able to access. To give an existing user customer access, add a
The customer signs in after setting or receiving their password.
Their account list shows only the hosting accounts assigned to them. Each
account page shows its hosting plan, database requests, DNS zones, and mailbox
account page shows its hosting package, database requests, DNS zones, and mailbox
requests. Customers can request databases and mailboxes for their own accounts
within their plan limits. Operators deploy those requests on the hosting nodes.
@@ -1095,7 +1095,7 @@ user quotas are active with
On the local installation, open a deployed hosting account and select
**Change storage limit** under **Website storage**. An operator with **Can
change site storage limit** can apply the hosting plan's default or enter
change site storage limit** can apply the hosting package's default or enter
another value in MiB. Clear the field to remove the space limit. The page
shows the last confirmed limit and any pending update.
@@ -51,7 +51,7 @@ class ManagerOnboardingForm(InviteLoginForm):
"primary_domain"
).formfield(required=True)
plan = forms.ModelChoiceField(
queryset=HostingPlan.objects.none(), label="Hosting plan"
queryset=HostingPlan.objects.none(), label="Hosting package"
)
manage_dns = forms.BooleanField(
required=False, label="Manage DNS in Coulobre"
@@ -122,7 +122,7 @@ class ManagerOnboardingView(UserPassesTestMixin, FormView):
form_class = ManagerOnboardingForm
template_name = "hosting/workspace_form.html"
extra_context = {
"title": "Add a new user",
"title": "Add user",
"submit_label": "Create customer and hosting account",
"invitation_preview": True,
}
@@ -301,7 +301,7 @@ class OperatorCreateView(OperatorAuthorization, FormView):
template_name = "hosting/workspace_form.html"
success_url = reverse_lazy("panel:all_users")
extra_context = {
"title": "Add an operator",
"title": "Add operator",
"submit_label": "Create operator",
}
@@ -332,7 +332,7 @@ class MoveHostingForm(forms.Form):
)
confirm = forms.BooleanField(
required=False,
label="I reviewed the destination and its hosting plan policy",
label="I reviewed the destination and its hosting package policy",
)
@@ -398,7 +398,7 @@ class MoveHostingView(OperatorAuthorization, FormView):
item.hosting_plan_id not in allowed_plans for item in moving
):
raise ValidationError(
"The destination must have room and allow every hosting plan."
"The destination needs room and must allow all packages."
)
revision = [
destination.pk,
+1 -1
View File
@@ -77,7 +77,7 @@ def check_version(account, version):
allowed = allowed_versions(account)
if allowed and version not in allowed:
raise ValidationError(
{"php_version": "This PHP series is outside the hosting plan."}
{"php_version": "This PHP series is outside the hosting package."}
)
+2 -2
View File
@@ -47,7 +47,7 @@ def validate_policy(resource, spec, account):
def validate_routing(domain, spec, plan):
if spec.catchall and not (plan and plan.allow_mail_catchall):
raise ValidationError("This hosting plan does not allow catch-all.")
raise ValidationError("This hosting package does not allow catch-all.")
mailboxes = domain.mailboxes.all()
if mailboxes.filter(local_part__in=spec.aliases).exists():
raise ValidationError("An alias cannot replace a requested mailbox.")
@@ -68,7 +68,7 @@ def validate_routing(domain, spec, plan):
)
elif not (plan and plan.allow_external_mail_forwarding):
raise ValidationError(
"This hosting plan does not allow external forwarding."
"This hosting package does not allow external forwarding."
)
+2 -2
View File
@@ -40,7 +40,7 @@ class SitePhpSettingsForm(forms.Form):
)
max_children = php_setting_input("max_children", "Maximum PHP-FPM workers")
use_plan = forms.BooleanField(
label="Apply the current hosting plan defaults",
label="Apply the current hosting package defaults",
required=False,
help_text="Uses the plan's values in place of the limits above.",
)
@@ -116,7 +116,7 @@ def limit_customer_php_settings(account, requested):
value = values[key]
if value is not None and (limit is None or value > limit):
raise ValidationError(
"Keep PHP limits within the account's hosting plan."
"Keep PHP limits within the account's hosting package."
)
if value is None:
values[key] = limit
+1 -1
View File
@@ -131,7 +131,7 @@ def create_reseller_account(access, account):
raise ValidationError(
{
"hosting_plan": (
"This hosting plan is no longer available to you."
"This hosting package is no longer available to you."
)
}
)
@@ -134,7 +134,9 @@ def claim_own_customer_hosting(request, pk):
class ManagerHostingPlanForm(forms.Form):
plan = forms.ModelChoiceField(queryset=HostingPlan.objects.none())
plan = forms.ModelChoiceField(
queryset=HostingPlan.objects.none(), label="Hosting package"
)
def __init__(self, *args, manager, **kwargs):
super().__init__(*args, **kwargs)
@@ -145,8 +147,8 @@ class ManagerHostingPlanView(UserPassesTestMixin, FormView):
form_class = ManagerHostingPlanForm
template_name = "hosting/workspace_form.html"
extra_context = {
"title": "Assign hosting plan",
"submit_label": "Assign plan",
"title": "Assign hosting package",
"submit_label": "Assign package",
}
def test_func(self):
+5 -2
View File
@@ -20,6 +20,7 @@ class ResellerProfileForm(forms.ModelForm):
class Meta:
model = ResellerProfile
fields = ("name", "account_limit", "hosting_plans")
labels = {"hosting_plans": "Allowed hosting packages"}
help_texts = {
"account_limit": "Enter 0 to manage existing accounts only.",
}
@@ -32,7 +33,7 @@ class ResellerProfileForm(forms.ModelForm):
values = super().clean()
if values.get("account_limit") and not values.get("hosting_plans"):
self.add_error(
"hosting_plans", "Select at least one hosting plan."
"hosting_plans", "Select at least one hosting package."
)
return values
@@ -67,7 +68,9 @@ class ProfileEditor(ProfilesAccess):
try:
return super().form_valid(form)
except IntegrityError:
form.add_error(None, "The profiles changed. Review and try again.")
form.add_error(
None, "The manager packages changed. Review and try again."
)
return self.form_invalid(form)
+3 -3
View File
@@ -33,11 +33,11 @@ class ResellerPolicyForm(forms.ModelForm):
class Meta:
model = Reseller
fields = ("is_active", "account_limit", "hosting_plans")
labels = {"hosting_plans": "Allowed hosting plans"}
labels = {"hosting_plans": "Allowed hosting packages"}
help_texts = {
"account_limit": "Enter 0 to manage existing accounts only.",
"hosting_plans": (
"Plans available when a manager creates an account."
"Packages available when a manager creates an account."
),
}
@@ -61,7 +61,7 @@ class ResellerPolicyForm(forms.ModelForm):
and not values.get("hosting_plans")
):
self.add_error(
"hosting_plans", "Select at least one hosting plan."
"hosting_plans", "Select at least one hosting package."
)
return values
+3 -1
View File
@@ -635,7 +635,9 @@ def apply_site_php_version(job):
raise ValueError("Activate the current website before changing PHP.")
versions = plan_php_versions(account)
if versions and job.requested_version not in versions:
raise ValueError("The hosting plan no longer allows this PHP series.")
raise ValueError(
"The hosting package no longer allows this PHP series."
)
site = WebSite(job.account_id, job.domain)
return {
"applied_version": update_local_php_version(
@@ -25,7 +25,7 @@
{% block page_content %}
<dl class="details surface">
{% 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 %}
<div><dt>Hosting package</dt><dd>{% if account.hosting_plan %}{{ account.hosting_plan.name }}{% else %}Unassigned{% endif %}
{% if is_reseller %}<a class="record-link" href="{% url 'panel:manager_assign_plan' account.pk %}">Assign plan</a>{% endif %}</dd></div>
{% endif %}
{% if is_operator and perms.hosting.view_reseller %}
@@ -42,7 +42,7 @@
<th scope="col">Account</th>
<th scope="col">Status</th>
{% if is_operator and perms.hosting.view_customer %}<th scope="col">Customer</th>{% endif %}
{% 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 package</th>{% endif %}
<th scope="col" class="cell-date">Added</th>
</tr>
</thead>
@@ -1,6 +1,11 @@
{% extends "hosting/workspace_page.html" %}
{% block title %}All users · Coulobre Panel{% endblock %}
{% block page_title %}All users{% endblock %}
{% block page_actions %}
{% if perms.hosting.add_customer %}
<a class="button primary" href="{% url 'panel:customer_create' %}">Add user</a>
{% endif %}
{% endblock %}
{% block page_context %}
<form method="get" class="workspace-context form-actions" role="search">
<label class="visually-hidden" for="username-search">Search by username</label>
@@ -11,7 +11,7 @@
{% if request.user.is_superuser and request.user.is_verified %}
<a class="button secondary" href="{% url 'panel:assign_panel_role' %}?role=customer">Assign to existing login</a>
{% endif %}
<a class="button primary" href="{% url 'panel:customer_create' %}">Add customer login</a>
<a class="button primary" href="{% url 'panel:customer_create' %}">Add user</a>
</div>
{% endif %}
</header>
@@ -3,7 +3,7 @@
{% block title %}{{ page_title }} · Coulobre Panel{% endblock %}
{% block page_title %}{{ page_title }}{% endblock %}
{% block page_context %}
<a class="quiet-link" href="{% url 'panel:hosting_plans' %}">← Hosting plans</a>
<a class="quiet-link" href="{% url 'panel:hosting_plans' %}">← Hosting packages</a>
{% endblock %}
{% block page_content %}
<section class="surface editor-surface">
@@ -1,15 +1,15 @@
{% extends "hosting/workspace_page.html" %}
{% block title %}Hosting plans · Coulobre Panel{% endblock %}
{% block title %}Hosting packages · Coulobre Panel{% endblock %}
{% block page_header %}
<header class="page-heading">
<h1>Hosting plans</h1>
<h1>Hosting packages</h1>
{% if perms.hosting.add_hostingplan %}
<a class="button primary" href="{% url 'panel:hosting_plan_create' %}">Add hosting plan</a>
<a class="button primary" href="{% url 'panel:hosting_plan_create' %}">Add hosting package</a>
{% endif %}
</header>
{% endblock %}
{% block page_content %}
<section class="surface" aria-label="Hosting plans">
<section class="surface" aria-label="Hosting packages">
{% if hosting_plans %}
<div class="table-scroll">
<table>
@@ -48,7 +48,7 @@
</table>
</div>
{% else %}
<p class="empty">No hosting plans yet.</p>
<p class="empty">No hosting packages yet.</p>
{% endif %}
{% include "hosting/pagination.html" %}
</section>
@@ -1,6 +1,6 @@
{% extends "hosting/workspace_page.html" %}
{% block title %}User packages · Coulobre Panel{% endblock %}
{% block page_title %}User packages{% endblock %}
{% block title %}Hosting packages · Coulobre Panel{% endblock %}
{% block page_title %}Hosting packages{% endblock %}
{% block page_content %}
<section class="surface">
<ul class="workspace-list">
@@ -9,7 +9,7 @@ Set your password by opening this link within 48 hours:
{{ setup_url }}
{% if account %}Your hosting account is {{ account.primary_domain }}.{% if account.hosting_plan %}
Hosting plan: {{ account.hosting_plan.name }}
Hosting package: {{ account.hosting_plan.name }}
Website limit: {{ account.hosting_plan.website_limit }}
Scheduled tasks per account: {{ account.hosting_plan.website_job_limit }}
Database limit: {{ account.hosting_plan.database_limit|default_if_none:"Unlimited" }}
@@ -21,7 +21,7 @@
<div><dt>Accounts allocated</dt><dd>{{ account_count }} of {{ reseller.account_limit }}</dd></div>
{% if perms.hosting.view_hostingplan %}
<div>
<dt>Allowed hosting plans</dt>
<dt>Allowed hosting packages</dt>
<dd>{% for plan in allowed_plans %}{{ plan.name }}{% if not forloop.last %}, {% endif %}{% empty %}None{% endfor %}</dd>
</div>
{% endif %}
@@ -33,7 +33,7 @@
<div class="table-scroll">
<table>
<thead>
<tr><th scope="col">Account</th><th scope="col">Primary domain</th>{% if perms.hosting.view_hostingplan %}<th scope="col">Hosting plan</th>{% endif %}</tr>
<tr><th scope="col">Account</th><th scope="col">Primary domain</th>{% if perms.hosting.view_hostingplan %}<th scope="col">Hosting package</th>{% endif %}</tr>
</thead>
<tbody>
{% for account in account_page %}
@@ -87,9 +87,9 @@
{% if event.changes.hosting_plans %}
<div>Allowed plans {% for plan in event.changes.hosting_plans.before %}{{ plan.name }}{% if not forloop.last %}, {% endif %}{% empty %}None{% endfor %} → {% for plan in event.changes.hosting_plans.after %}{{ plan.name }}{% if not forloop.last %}, {% endif %}{% empty %}None{% endfor %}</div>
{% endif %}
{% if event.changes.plan %}<div>Hosting plan {{ event.changes.plan.name }}</div>{% endif %}
{% if event.changes.plan %}<div>Hosting package {{ event.changes.plan.name }}</div>{% endif %}
{% if event.changes.account_plan %}
<div>Hosting plan {{ event.changes.account_plan.before.name|default:"Unassigned" }} → {{ event.changes.account_plan.after.name|default:"Unassigned" }}</div>
<div>Hosting package {{ event.changes.account_plan.before.name|default:"Unassigned" }} → {{ event.changes.account_plan.after.name|default:"Unassigned" }}</div>
{% endif %}
{% endif %}
</td>
@@ -9,13 +9,13 @@
{% if profiles %}
<form method="get" class="editor">
<div>
<label for="manager-profile">Load profile</label>
<label for="manager-profile">Manager package</label>
<select id="manager-profile" name="profile">
<option value="">Custom settings</option>
{% for profile in profiles %}<option value="{{ profile.pk }}"{% if profile.pk == selected_profile.pk %} selected{% endif %}>{{ profile }}</option>{% endfor %}
</select>
</div>
<p class="heading-meta">Choose a profile, then review its settings before saving.</p>
<p class="heading-meta">Choose a manager package, then review its settings before saving.</p>
<button class="button secondary" type="submit">Load settings</button>
</form>
{% endif %}
@@ -27,15 +27,15 @@
{{ form.as_div }}
</fieldset>
<fieldset class="editor">
<legend>Access and plans</legend>
<legend>Access and packages</legend>
{{ policy_form.as_div }}
</fieldset>
{% else %}
{{ form.as_div }}
{% endif %}
{% if can_add_hosting_plan %}
<p><a href="{% url 'panel:hosting_plan_create' %}" target="_blank" rel="noopener">Create a hosting plan</a>. The plan opens in a new tab.</p>
<button class="button secondary" type="submit" name="refresh_plans" value="1" formnovalidate>Reload available plans</button>
<p><a href="{% url 'panel:hosting_plan_create' %}" target="_blank" rel="noopener">Create a hosting package</a>. The package opens in a new tab.</p>
<button class="button secondary" type="submit" name="refresh_plans" value="1" formnovalidate>Reload available packages</button>
{% endif %}
<div class="form-actions">
<button class="button primary" type="submit">{{ submit_label }}</button>
@@ -5,7 +5,7 @@
<h1>Managers</h1>
<div class="form-actions">
{% if perms.hosting.change_reseller and perms.hosting.view_hostingplan %}
<a class="button secondary" href="{% url 'panel:reseller_profiles' %}">Profiles</a>
<a class="button secondary" href="{% url 'panel:reseller_profiles' %}">Manager packages</a>
{% endif %}
{% if perms.hosting.add_reseller %}
{% if request.user.is_superuser and request.user.is_verified %}
@@ -1,15 +1,15 @@
{% extends "hosting/workspace_page.html" %}
{% block title %}{% if object %}Edit profile{% else %}Add profile{% endif %} · Coulobre Panel{% endblock %}
{% block page_title %}{% if object %}Edit profile{% else %}Add profile{% endif %}{% endblock %}
{% block title %}{% if object %}Edit manager package{% else %}Add manager package{% endif %} · Coulobre Panel{% endblock %}
{% block page_title %}{% if object %}Edit manager package{% else %}Add manager package{% endif %}{% endblock %}
{% block page_context %}
<a class="quiet-link" href="{% url 'panel:reseller_profiles' %}">← Manager profiles</a>
<a class="quiet-link" href="{% url 'panel:reseller_profiles' %}">← Manager packages</a>
{% endblock %}
{% block page_content %}
<section class="surface editor-surface">
<form method="post" class="editor">
{% csrf_token %}
{{ form.as_div }}
<button type="submit" class="button primary">Save profile</button>
<button type="submit" class="button primary">Save package</button>
</form>
</section>
{% endblock %}
@@ -1,9 +1,9 @@
{% extends "hosting/workspace_page.html" %}
{% block title %}Manager profiles · Coulobre Panel{% endblock %}
{% block title %}Manager packages · Coulobre Panel{% endblock %}
{% block page_header %}
<header class="page-heading">
<h1>Manager profiles</h1>
<a class="button primary" href="{% url 'panel:reseller_profile_create' %}">Add profile</a>
<h1>Manager packages</h1>
<a class="button primary" href="{% url 'panel:reseller_profile_create' %}">Add manager package</a>
</header>
{% endblock %}
{% block page_context %}
@@ -12,7 +12,7 @@
{% block page_content %}
<section class="surface">
<table>
<thead><tr><th scope="col">Profile</th><th scope="col">Account limit</th></tr></thead>
<thead><tr><th scope="col">Package</th><th scope="col">Account limit</th></tr></thead>
<tbody>
{% for profile in object_list %}
<tr>
@@ -20,7 +20,7 @@
<td>{% if profile.account_limit %}{{ profile.account_limit }}{% else %}Manage existing accounts only{% endif %}</td>
</tr>
{% empty %}
<tr><td colspan="2">No profiles yet. Add one to reuse a set of plans, limits, and permissions.</td></tr>
<tr><td colspan="2">No manager packages yet. Add one to reuse account limits and a set of hosting packages.</td></tr>
{% endfor %}
</tbody>
</table>
@@ -14,7 +14,7 @@
{% block page_content %}
<section class="surface editor-surface">
<form method="post" class="editor">
<p>{% if is_customer %}Blank fields use the hosting plan defaults.{% else %}Blank fields use the web node defaults.{% endif %}</p>
<p>{% if is_customer %}Blank fields use the hosting package defaults.{% else %}Blank fields use the web node defaults.{% endif %}</p>
{% csrf_token %}
{{ form.as_div }}
<div class="form-actions">
+2 -2
View File
@@ -319,7 +319,7 @@ class CustomerManagementTests(TestCase):
):
self.client.force_login(self.operator)
customers = reverse("panel:customers")
self.assertContains(self.client.get(customers), "Add customer")
self.assertContains(self.client.get(customers), "Add user")
password = "initial-correct-horse-battery-staple"
self.assertRedirects(
@@ -462,7 +462,7 @@ class CustomerManagementTests(TestCase):
self.client.force_login(reader)
response = self.client.get(reverse("panel:customers"))
self.assertContains(response, "alice")
self.assertNotContains(response, "Add customer")
self.assertNotContains(response, "Add user")
self.assertNotContains(response, "Suspend sign-in")
self.assertEqual(
self.client.post(url, {"access": "suspend"}).status_code, 403
@@ -140,7 +140,7 @@ class IndependentWebsiteTests(TestCase):
response = self.client.post(
self.add, {"domain": "shop.example.test", "php_version": "8.3"}
)
self.assertContains(response, "outside the hosting plan")
self.assertContains(response, "outside the hosting package")
website = self.create_website()
self.assertContains(
self.client.get(self.account.get_absolute_url()),
+1 -1
View File
@@ -252,7 +252,7 @@ class ResellerAccountCreationTests(TestCase):
},
)
self.assertContains(
response, "This hosting plan is no longer available to you."
response, "This hosting package is no longer available to you."
)
self.assertEqual(self.reseller.hostingaccount_set.count(), 1)
+18
View File
@@ -17,6 +17,24 @@ from .models import (
class WorkspaceTests(TestCase):
def test_operator_navigation_keeps_creation_and_package_links_together(
self,
):
operator = get_user_model().objects.create_superuser("operator")
self.client.force_login(operator)
landing = self.client.get(reverse("panel:accounts"))
links = dict(landing.context["navigation_groups"])["Account Manager"]
actions = [
(reverse("panel:customer_create"), "Add User"),
(reverse("panel:reseller_create"), "Add Manager"),
(reverse("panel:operator_create"), "Add Operator"),
(reverse("panel:hosting_plans"), "Hosting Packages"),
(reverse("panel:reseller_profiles"), "Manager Packages"),
]
entries = [(url, label) for url, label, _ in links]
start = entries.index(actions[0])
self.assertEqual(entries[start : start + len(actions)], actions)
@override_settings(WEBSITE_USAGE=True)
def test_operator_summary_respects_usage_and_task_permissions(self):
operator = get_user_model().objects.create_user(
+6 -4
View File
@@ -422,13 +422,14 @@ class AccountEditor:
form = super().get_form(form_class)
if "hosting_plan" in form.fields:
field = form.fields["hosting_plan"]
field.label = "Hosting package"
reseller = reseller_for_user(self.request.user)
if reseller is None:
field.empty_label = "Unassigned"
else:
field.queryset = reseller.hosting_plans.all()
field.required = True
field.empty_label = "Select a hosting plan"
field.empty_label = "Select a hosting package"
for name in ("reseller", "customer"):
if name in form.fields:
field = form.fields[name]
@@ -1909,6 +1910,7 @@ class CustomerCreate(OperatorOnlyMixin, PermissionRequiredMixin, FormView):
permission_required = (VIEW_CUSTOMERS, "hosting.add_customer")
form_class = InviteLoginForm
template_name = "hosting/customer_form.html"
extra_context = {"title": "Add user"}
success_url = reverse_lazy("panel:customers")
def form_valid(self, form):
@@ -2605,8 +2607,8 @@ class HostingPlanCreate(
):
permission_required = (VIEW_HOSTING_PLANS, "hosting.add_hostingplan")
extra_context = {
"page_title": "Add hosting plan",
"submit_label": "Add plan",
"page_title": "Add hosting package",
"submit_label": "Add package",
}
@@ -2615,7 +2617,7 @@ class HostingPlanEdit(
):
permission_required = (VIEW_HOSTING_PLANS, "hosting.change_hostingplan")
extra_context = {
"page_title": "Edit hosting plan",
"page_title": "Edit hosting package",
"submit_label": "Save changes",
}
+27 -16
View File
@@ -78,6 +78,8 @@ WORKSPACE_PARENT_ROUTES = {
"reseller_edit": ("resellers", ()),
"hosting_plan_create": ("hosting_plans", ()),
"hosting_plan_edit": ("hosting_plans", ()),
"reseller_profile_create": ("reseller_profiles", ()),
"reseller_profile_edit": ("reseller_profiles", ()),
"manager_assign_plan": ("manager_packages", ()),
"account": ("accounts", ()),
}
@@ -244,6 +246,7 @@ NAVIGATION_ICONS = {
"accounts": "accounts",
"all_users": "customers",
"customers": "customers",
"customer_create": "customers",
"customer_onboarding": "customers",
"move_accounts": "transfer",
"operator_create": "customers",
@@ -357,24 +360,39 @@ def groups_for(request, *, customer, manager):
(
"Account Manager",
[
link("customer_onboarding", "Add New User"),
link("customers", "My Users"),
link("accounts", "Customer hosting"),
link("manager_packages", "User Packages"),
link("customers", "My Users"),
link("customer_onboarding", "Add User"),
link("manager_packages", "Hosting Packages"),
],
)
]
else:
accounts = []
for permission, route, label in (
("view_hostingaccount", "accounts", "Hosting accounts"),
("view_customer", "all_users", "Show All Users"),
("view_reseller", "resellers", "Managers"),
("add_reseller", "reseller_create", "Add Manager"),
("view_hostingplan", "hosting_plans", "Hosting plans"),
(("view_hostingaccount",), "accounts", "Hosting accounts"),
(("view_customer",), "all_users", "Show All Users"),
(("view_reseller",), "resellers", "Managers"),
(("view_customer", "add_customer"), "customer_create", "Add User"),
(
("view_reseller", "add_reseller"),
"reseller_create",
"Add Manager",
),
):
if user.has_perm(f"hosting.{permission}"):
if user.has_perms(f"hosting.{name}" for name in permission):
accounts.append(link(route, label))
if user.is_superuser:
accounts.append(link("operator_create", "Add Operator"))
if user.has_perm("hosting.view_hostingplan"):
accounts.append(link("hosting_plans", "Hosting Packages"))
if user.is_superuser:
accounts.extend(
(
link("reseller_profiles", "Manager Packages"),
link("move_accounts", "Move Users"),
)
)
server, admin_tools = [], []
if user.has_perm("hosting.view_webprovisioningplan"):
server.append(link("plans", "Web provisioning"))
@@ -389,13 +407,6 @@ def groups_for(request, *, customer, manager):
if user.has_perm("hosting.view_servicehealth"):
admin_tools.append(link("service_health", "System Services"))
if user.is_superuser:
accounts.extend(
(
link("operator_create", "Add New Operator"),
link("reseller_profiles", "Manager Packages"),
link("move_accounts", "Move Users"),
)
)
server.extend(
(
link("operator_settings", "Operator Settings", "general"),