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 @@
Manage your SimpleX accounts, business inboxes and bots โ pick a section to get started.
+@@ -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 yetCreate a business account; each customer who connects gets their own group chat.
{% else %} @@ -115,7 +115,7 @@