v0.2.1: top-bar avatar, You/Admin settings groups, admin models
- Replace the gear/username button with a round initials avatar (per-user deterministic color via a new daybook_extras template filter); dropdown now shows the username and keeps Settings/About/theme/logout. Sets up an optional profile photo later. - Regroup the settings nav into "You" (Account, API Keys, Storage, Demo Data) and a superuser-only "Admin" (Users), About separate — the split now reflects who each setting affects, not a flat list. - Register ApiKey (key read-only) and TagColor in Django admin so /admin/ is complete as the operator break-glass tool, distinct from the themed Settings product surface. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
19c1798f90
commit
b382eb857b
8 changed files with 134 additions and 12 deletions
|
|
@ -1,3 +1,4 @@
|
|||
{% load daybook_extras %}
|
||||
<header class="topbar">
|
||||
<div class="brandline">
|
||||
<a class="brand-link" href="{% url 'feed' %}"><img class="brand-logo" src="/static/logo.png" alt=""><h1>AgentFeed</h1></a>
|
||||
|
|
@ -6,12 +7,12 @@
|
|||
{% if topbar_toolbar %}{% include topbar_toolbar %}{% endif %}
|
||||
</div>
|
||||
<div class="topbar-actions">
|
||||
<button class="icon-button" type="button" data-user-menu-toggle aria-haspopup="true" aria-expanded="false" title="{{ request.user.username }}">
|
||||
⚙ {{ request.user.username }}
|
||||
<button class="avatar-button" type="button" data-user-menu-toggle aria-haspopup="true" aria-expanded="false" title="{{ request.user.username }}" aria-label="{{ request.user.username }} menu">
|
||||
<span class="avatar" style="background: {{ request.user.username|avatar_color }};">{{ request.user.username|avatar_initial }}</span>
|
||||
</button>
|
||||
<div class="user-menu-dropdown" hidden data-user-menu>
|
||||
<div class="user-menu-name">{{ request.user.username }}</div>
|
||||
<a href="{% url 'settings-account' %}">Settings</a>
|
||||
<a href="{% url 'settings-demo-data' %}">Demo Data</a>
|
||||
<a href="{% url 'settings-about' %}">About</a>
|
||||
<button type="button" data-theme-toggle>Dark mode</button>
|
||||
<form method="post" action="{% url 'logout' %}">{% csrf_token %}<button type="submit">Log out</button></form>
|
||||
|
|
|
|||
|
|
@ -24,14 +24,25 @@
|
|||
<main class="settings-layout">
|
||||
<nav class="settings-nav">
|
||||
<a class="settings-nav-back" href="{% url 'feed' %}">← Back to Feed</a>
|
||||
<a class="{% if active_section == 'account' %}selected{% endif %}" href="{% url 'settings-account' %}">Account</a>
|
||||
<a class="{% if active_section == 'api-keys' %}selected{% endif %}" href="{% url 'settings-api-keys' %}">API Keys</a>
|
||||
<a class="{% if active_section == 'storage' %}selected{% endif %}" href="{% url 'settings-storage' %}">Storage</a>
|
||||
<a class="{% if active_section == 'demo-data' %}selected{% endif %}" href="{% url 'settings-demo-data' %}">Demo Data</a>
|
||||
|
||||
<div class="settings-nav-group">
|
||||
<span class="settings-nav-heading">You</span>
|
||||
<a class="{% if active_section == 'account' %}selected{% endif %}" href="{% url 'settings-account' %}">Account</a>
|
||||
<a class="{% if active_section == 'api-keys' %}selected{% endif %}" href="{% url 'settings-api-keys' %}">API Keys</a>
|
||||
<a class="{% if active_section == 'storage' %}selected{% endif %}" href="{% url 'settings-storage' %}">Storage</a>
|
||||
<a class="{% if active_section == 'demo-data' %}selected{% endif %}" href="{% url 'settings-demo-data' %}">Demo Data</a>
|
||||
</div>
|
||||
|
||||
{% if request.user.is_superuser %}
|
||||
<a class="{% if active_section == 'users' %}selected{% endif %}" href="{% url 'settings-users' %}">Users</a>
|
||||
<div class="settings-nav-group">
|
||||
<span class="settings-nav-heading">Admin</span>
|
||||
<a class="{% if active_section == 'users' %}selected{% endif %}" href="{% url 'settings-users' %}">Users</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<a class="{% if active_section == 'about' %}selected{% endif %}" href="{% url 'settings-about' %}">About</a>
|
||||
|
||||
<div class="settings-nav-group">
|
||||
<a class="{% if active_section == 'about' %}selected{% endif %}" href="{% url 'settings-about' %}">About</a>
|
||||
</div>
|
||||
</nav>
|
||||
<section class="settings-panel">
|
||||
{% if messages %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue