Unify organizer navigation and add personal widget dashboard
This commit is contained in:
1 parent
a9249009f0
commit
6ba30bc9f4
44 files changed
+843
-54
No files matched your search
@@ -13,6 +13,7 @@
|
||||
<link rel="stylesheet" href="/static/css/notifications.css?v=3">
|
||||
<link rel="stylesheet" href="/static/css/notification-active.css?v=1">
|
||||
<link rel="stylesheet" href="/static/css/nav-modals.css?v=3">
|
||||
<link rel="stylesheet" href="/static/css/organizer.css?v=1">
|
||||
<button type="button" class="city-map-launch" data-city-map-launch aria-label="{{ T "city.map" }}" title="{{ T "city.map" }}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="m3 6 5-3 8 3 5-3v15l-5 3-8-3-5 3V6Zm5-1v11m8-8v11M5 7.2v10.3l3-1.8 8 3 3-1.8V6.5l-3 1.8-8-3L5 7.2Z"/></svg></button>
|
||||
<dialog class="city-map-dialog" data-city-map-dialog aria-label="{{ T "city.map" }}"><div class="city-map-dialog-head"><strong>{{ T "city.map" }}</strong><a href="/v/city">↗</a><button type="button" data-city-map-close aria-label="Close">×</button></div><iframe title="{{ T "city.map" }}" data-city-map-frame data-src="/v/city?popup=1"></iframe></dialog>
|
||||
{{ if .AuthUser }}<button type="button" class="notification-launch" data-notification-launch aria-label="{{ T "notification.title" }}" title="{{ T "notification.title" }}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 9a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9M10 21h4"/></svg><span class="notification-badge" data-notification-badge hidden></span></button><dialog class="notification-dialog" data-notification-dialog data-owner="{{ .AuthUser.UUID }}" data-domain="{{ .Context.Domain.UUID }}" aria-label="{{ T "notification.title" }}"><form method="dialog"><header><h2>{{ T "notification.title" }}</h2><button type="button" data-notification-close aria-label="Close">×</button></header><div class="notifications-list" data-notifications-list></div><footer><a href="/v/notification">{{ T "notification.all" }}</a></footer></form></dialog>{{ end }}
|
||||
@@ -25,6 +26,7 @@
|
||||
<dialog class="calendar-upcoming-dialog" data-calendar-upcoming-dialog data-timezone="{{ .Timezone }}" aria-modal="true" aria-labelledby="calendar-upcoming-title"><div class="nav-modal-content"><header><h2 id="calendar-upcoming-title">{{ T "calendar.upcoming" }}</h2><button type="button" data-calendar-upcoming-close aria-label="Close">×</button></header><p data-calendar-upcoming-status role="status"></p><div class="calendar-upcoming-list" data-calendar-upcoming-list></div><footer><a href="/v/plan">{{ T "calendar.title" }} ↗</a></footer></div></dialog>
|
||||
{{ end }}{{ end }}
|
||||
<script src="/static/js/nav-modals.js?v=2" defer></script>
|
||||
{{ if .AuthUser }}<span class="organizer-nav-icons">{{ template "organizer-shortcuts" . }}</span>{{ end }}
|
||||
{{ if .QuickThemes }}
|
||||
<details class="theme-picker" data-theme-picker data-default-css="{{ .DefaultThemeCSS }}" data-current-css="{{ .ThemeCSS }}" data-current-id="{{ .QuickThemeID }}" data-failed="{{ T "theme.failed" }}">
|
||||
<summary title="{{ T "theme.quick" }}" aria-label="{{ T "theme.quick" }}">◐</summary>
|
||||
@@ -39,7 +41,7 @@
|
||||
<div class="auth-menu">
|
||||
{{ if .AuthUser }}
|
||||
<details><summary aria-label="{{ T "auth.profile" }}"><span class="auth-avatar">{{ if .AuthUser.HasAvatar }}<img src="/u/{{ .AuthUser.Username }}/_/avatar" alt="">{{ else }}{{ printf "%.1s" .AuthUser.DisplayName }}{{ end }}</span><span class="auth-user-name">{{ .AuthUser.DisplayName }}</span></summary>
|
||||
<div class="auth-menu-popover"><a href="/u/{{ .AuthUser.Username }}">{{ T "auth.profile" }}</a>{{ if .CalendarEnabled }}<a href="/v/plan">{{ T "calendar.title" }}</a>{{ end }}{{ if .TasksEnabled }}<a href="/v/plan/today">{{ T "tasks.title" }}</a>{{ end }}{{ if .AuthIsAdmin }}<a href="/-/sys/config">{{ T "config.title" }}</a>{{ end }}<form method="post" action="/_/auth/logout"><button type="submit">{{ T "auth.logout" }}</button></form></div></details>
|
||||
<div class="auth-menu-popover"><a href="/u/{{ .AuthUser.Username }}">{{ T "auth.profile" }}</a>{{ if .CalendarEnabled }}<a href="/v/plan">{{ T "calendar.title" }}</a>{{ end }}{{ if .TasksEnabled }}<a href="/v/plan/today">{{ T "tasks.title" }}</a>{{ end }}{{ if .ContactsEnabled }}<a href="/v/plan/contacts">{{ T "organizer.contacts" }}</a>{{ end }}<a href="/-/sys/config?panel=organizer">{{ T "organizer.settings" }}</a>{{ if .AuthIsAdmin }}<a href="/-/sys/config">{{ T "config.title" }}</a>{{ end }}<form method="post" action="/_/auth/logout"><button type="submit">{{ T "auth.logout" }}</button></form></div></details>
|
||||
{{ else }}<a class="auth-login-link" href="/_/auth/login">{{ T "auth.login" }}</a>{{ end }}
|
||||
</div>
|
||||
<style>.topbar{display:flex;align-items:center}.topbar .city-map-launch{display:grid;place-items:center;width:2.25rem;height:2.25rem;margin-inline-start:auto;margin-inline-end:.55rem;padding:.38rem;border:1px solid var(--border,currentColor);border-radius:50%;background:transparent;color:var(--fg,currentColor);cursor:pointer}.city-map-launch:hover,.city-map-launch:focus-visible{background:color-mix(in srgb,var(--accent,#5267df) 15%,transparent);color:var(--accent,#5267df)}.city-map-launch svg{width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.topbar .auth-menu{margin-inline-start:0;position:relative}.city-map-dialog{width:min(74rem,calc(100vw - 2rem));height:min(48rem,calc(100vh - 2rem));box-sizing:border-box;padding:0;border:1px solid var(--border,currentColor);border-radius:1rem;background:var(--bg,#111);color:var(--fg,#eee);box-shadow:0 1.5rem 5rem #000a;overflow:hidden}.city-map-dialog::backdrop{background:#0009;backdrop-filter:blur(3px)}.city-map-dialog-head{display:none}.city-map-dialog iframe{display:block;width:100%;height:100%;border:0;background:var(--bg,#111)}.auth-menu details>summary{display:flex;align-items:center;gap:.45rem;cursor:pointer;list-style:none}.auth-menu details>summary::-webkit-details-marker{display:none}.auth-avatar{display:grid;place-items:center;width:2rem;height:2rem;overflow:hidden;border-radius:50%;background:var(--accent,#5267df);color:var(--bg,#fff);font-weight:700;text-transform:uppercase}.auth-avatar img{width:100%;height:100%;object-fit:cover}.auth-menu-popover{position:absolute;z-index:50;right:0;top:calc(100% + .5rem);display:grid;min-width:12rem;padding:.4rem;background:var(--input-bg,var(--bg,#111));color:var(--fg,#eee);border:1px solid var(--border,currentColor);border-radius:.5rem;box-shadow:0 .5rem 1.5rem #0008}.auth-menu-popover form{margin:0}.auth-menu-popover button{display:block;width:100%;border:0;background:transparent;text-align:left;font:inherit;cursor:pointer}.auth-menu-popover a,.auth-menu-popover button{padding:.55rem .7rem;white-space:nowrap;color:var(--link,var(--fg,#eee))}.auth-menu-popover a:hover,.auth-menu-popover button:hover{background:var(--row-hover,var(--border-soft,transparent));color:var(--link-hover,var(--fg,#fff))}.auth-user-name{max-width:12rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.site-broadcast{position:fixed;z-index:40;left:50%;top:.6rem;transform:translateX(-50%);display:flex;gap:.75rem;align-items:baseline;max-width:min(58rem,calc(100vw - 2rem));padding:.55rem .9rem;border:1px solid var(--accent);border-radius:.45rem;background:var(--bg);box-shadow:0 .35rem 1.2rem #0005}.site-broadcast span{overflow:hidden;text-overflow:ellipsis}.site-broadcast-warning{border-color:#d89b2b}.site-broadcast-critical{border-color:#e5484d}.site-broadcast-success{border-color:#2eaa67}@media(max-width:700px){.auth-user-name{display:none}.city-map-dialog{width:100vw;height:100vh;max-width:none;max-height:none;border:0;border-radius:0}.site-broadcast{top:3.2rem;display:grid;gap:.15rem}}</style>
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{{ define "organizer-nav" }}
|
||||
<link rel="stylesheet" href="/static/css/organizer.css?v=1">
|
||||
<nav class="organizer-nav" aria-label="{{ T "organizer.title" }}">
|
||||
{{ if .TasksEnabled }}<a href="/v/plan/dashboard" {{ if eq .OrganizerSection "dashboard" }}aria-current="page"{{ end }}>▦ <span>{{ T "organizer.dashboard" }}</span></a><a href="/v/plan/tasks" {{ if eq .OrganizerSection "tasks" }}aria-current="page"{{ end }}>✓ <span>{{ T "tasks.title" }}</span></a>{{ end }}
|
||||
{{ if .CalendarEnabled }}<a href="/v/plan" {{ if eq .OrganizerSection "calendar" }}aria-current="page"{{ end }}>▤ <span>{{ T "calendar.title" }}</span></a>{{ end }}
|
||||
{{ if .ContactsEnabled }}<a href="/v/plan/contacts" {{ if eq .OrganizerSection "contacts" }}aria-current="page"{{ end }}>♧ <span>{{ T "organizer.contacts" }}</span></a>{{ end }}
|
||||
{{ if .AuthUser }}<a href="/-/sys/config?panel=organizer" {{ if eq .OrganizerSection "settings" }}aria-current="page"{{ end }}>⚙ <span>{{ T "organizer.settings" }}</span></a>{{ end }}
|
||||
</nav>{{ end }}
|
||||
{{ define "organizer-shortcuts" }}
|
||||
{{ if .TasksEnabled }}<a href="/v/plan/dashboard" class="organizer-launch" data-home-shortcut="dashboard" title="{{ T "organizer.dashboard" }}" aria-label="{{ T "organizer.dashboard" }}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 3h7v7H3zM14 3h7v11h-7zM3 14h7v7H3zM14 18h7v3h-7z"/></svg></a>{{ end }}
|
||||
{{ if .ContactsEnabled }}<a href="/v/plan/contacts" class="organizer-launch" data-home-shortcut="contacts" title="{{ T "organizer.contacts" }}" aria-label="{{ T "organizer.contacts" }}"><svg viewBox="0 0 24 24" aria-hidden="true"><rect x="4" y="3" width="15" height="18" rx="2"/><circle cx="12" cy="9" r="3"/><path d="M8 17c0-5 8-5 8 0M2 7h4M2 12h4M2 17h4"/></svg></a>{{ end }}
|
||||
{{ end }}
|
||||
Reference in new issue
Block a user