From 270766b99b3ee5e59e76cf3add53e2639dbe37b5 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 5 Jun 2026 17:45:28 +0100 Subject: [PATCH] =?UTF-8?q?Add=20tiled=20homepage;=20rename=20Business?= =?UTF-8?q?=E2=86=92Businesses;=20link=20footer=20copyright?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Home page (home.html) at / shows the sidebar sections as tiles; reachable by clicking the 'SimpleX Manager' brand in the sidebar (was redirecting to /users). - Rename the category to 'Businesses' (route /businesses, tab/nav/_category), keeping the per-account bot_type 'business'. Fix profile back-link label. - Footer: link 'Bournemouth Technology Ltd' -> bournemouthtechnology.co.uk and 'SimpleX Network' -> simplex.chat. Co-Authored-By: Claude Opus 4.8 --- manager/main.py | 16 ++++---- manager/templates/base.html | 8 ++-- manager/templates/home.html | 69 ++++++++++++++++++++++++++++++++++ manager/templates/list.html | 10 ++--- manager/templates/profile.html | 2 +- 5 files changed, 88 insertions(+), 17 deletions(-) create mode 100644 manager/templates/home.html diff --git a/manager/main.py b/manager/main.py index a06b7b0..fdecb1d 100644 --- a/manager/main.py +++ b/manager/main.py @@ -71,9 +71,9 @@ def _enrich(profiles: list[dict]) -> list[dict]: def _category(bot_type: str) -> str: - """Which sidebar category a profile belongs to: users / business / bots.""" + """Which sidebar category a profile belongs to: users / businesses / bots.""" if bot_type in pm.BUSINESS_TYPES: - return "business" + return "businesses" if bot_type in pm.USER_TYPES: return "users" return "bots" @@ -106,7 +106,9 @@ async def logout(): @app.get("/", response_class=HTMLResponse) async def index(request: Request): - return RedirectResponse("/users", status_code=302) + if redir := _redirect_if_unauth(request): + return redir + return TEMPLATES.TemplateResponse(request, "home.html", {"nav_active": "home"}) @app.get("/users", response_class=HTMLResponse) @@ -120,14 +122,14 @@ async def users_page(request: Request): }) -@app.get("/business", response_class=HTMLResponse) -async def business_page(request: Request): +@app.get("/businesses", response_class=HTMLResponse) +async def businesses_page(request: Request): if redir := _redirect_if_unauth(request): return redir items = _enrich([p for p in db.list_profiles() if p["bot_type"] in pm.BUSINESS_TYPES]) return TEMPLATES.TemplateResponse(request, "list.html", { - "tab": "business", "items": items, "create_types": pm.BUSINESS_TYPES, - "nav_active": "business", + "tab": "businesses", "items": items, "create_types": pm.BUSINESS_TYPES, + "nav_active": "businesses", }) diff --git a/manager/templates/base.html b/manager/templates/base.html index d5f70ec..c52c9fe 100644 --- a/manager/templates/base.html +++ b/manager/templates/base.html @@ -264,12 +264,12 @@ diff --git a/manager/templates/home.html b/manager/templates/home.html new file mode 100644 index 0000000..054dfdf --- /dev/null +++ b/manager/templates/home.html @@ -0,0 +1,69 @@ +{% extends "base.html" %} +{% block title %}Home โ€” SimpleX Manager{% endblock %} + +{% block head %} + +{% endblock %} + +{% block content %} +
+

SimpleX Manager

+

Manage your SimpleX accounts, business inboxes and bots โ€” pick a section to get started.

+
+ + +{% endblock %} diff --git a/manager/templates/list.html b/manager/templates/list.html index 778c6f5..1e58409 100644 --- a/manager/templates/list.html +++ b/manager/templates/list.html @@ -23,7 +23,7 @@ {% endblock %} {% block content %} -{% set new_label = 'User' if tab == 'users' else ('Business' if tab == 'business' else 'Bot') %} +{% set new_label = 'User' if tab == 'users' else ('Business' if tab == 'businesses' else 'Bot') %}

{{ tab | title }}

-{% if tab == 'business' %} +{% if tab == 'businesses' %}

Business accounts

@@ -99,7 +99,7 @@ {% if tab == 'users' %} No users yet

Create a SimpleX user account to manage contacts and channels.

- {% elif tab == 'business' %} + {% elif tab == 'businesses' %} No business accounts yet

Create a business account; each customer who connects gets their own group chat.

{% else %} @@ -115,7 +115,7 @@
- +
@@ -128,7 +128,7 @@
- {% if tab == 'business' %} + {% if tab == 'businesses' %}
diff --git a/manager/templates/profile.html b/manager/templates/profile.html index 6a63e09..3f3c87a 100644 --- a/manager/templates/profile.html +++ b/manager/templates/profile.html @@ -29,7 +29,7 @@ {% block content %}