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.

+
+ +
+ + ๐Ÿ‘ค + Users + Personal SimpleX accounts โ€” contacts, groups and channels. + + + ๐Ÿ’ผ + Businesses + Business inboxes โ€” each customer gets their own group chat. + + + ๐Ÿค– + Bots + Echo, broadcast, support, directory and dead-man's-switch bots. + + + ๐Ÿ“ก + Network + SimpleX servers and connection status. + + + ๐Ÿ”” + Notifications + Recent messages received across all profiles. + + + โš™๏ธ + Settings + Theme and manager preferences. + + + ๐Ÿ“ + File upload + Share files over SimpleX (opens simplex.chat). + +
+{% 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 %}