From 0250f2800b7e21642410b00eded2f60b467a96f7 Mon Sep 17 00:00:00 2001 From: Michael Manfre Date: Fri, 30 Dec 2022 03:01:03 -0500 Subject: [PATCH] Identity profile menus --- static/css/style.css | 74 ++++++++++++++++++++++++++++-- takahe/urls.py | 2 +- templates/activities/_menu.html | 3 ++ templates/base.html | 2 +- templates/identity/_menu.html | 2 +- templates/identity/_view_menu.html | 43 +++++++++++++++++ templates/identity/view.html | 24 +--------- users/models/identity.py | 1 + 8 files changed, 121 insertions(+), 30 deletions(-) create mode 100644 templates/identity/_view_menu.html diff --git a/static/css/style.css b/static/css/style.css index e1ac792..7b03cb9 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -285,6 +285,11 @@ header menu a.identity i { padding: 0 7px 2px 0; } +header menu a.identity a.view-profile { + display: inline-block; + margin-right: 20px; +} + header menu a img { display: inline-block; vertical-align: middle; @@ -592,26 +597,85 @@ form.inline { padding: 0; } -form.follow-profile { +div.follow-profile { float: right; margin: 20px 0 0 0; font-size: 16px; text-align: center; } -form.follow-profile.has-reverse { +div.follow-profile.has-reverse { margin-top: 0; } -form.follow-profile .reverse-follow { +div.follow-profile .reverse-follow { display: block; margin: 0 0 5px 0; } -form.follow-profile button { +div.follow-profile button, +div.follow-profile .button { margin: 0; } +div.follow-profile .actions { + /* display: flex; */ + position: relative; + justify-content: space-between; + /* padding: 8px 0 0 0; */ + align-items: center; + align-content: center; +} + +div.follow-profile .actions a { + border-radius: 4px; + min-width: 40px; + text-align: center; + cursor: pointer; +} + +div.follow-profile .actions menu { + display: none; + background-color: var(--color-bg-menu); + border-radius: 5px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); + position: absolute; + right: 0; + top: 43px; +} + +div.follow-profile .actions menu.enabled { + display: block; + min-width: 160px; + z-index: 10; +} + +div.follow-profile .actions menu a { + text-align: left; + display: block; + font-size: 15px; + padding: 4px 10px; + color: var(--color-text-dull); +} + +div.follow-profile .actions menu a i { + margin-right: 4px; + width: 16px; +} + +div.follow-profile .actions a:hover { + color: var(--color-text-main); +} + +div.follow-profile .actions a.active { + color: var(--color-highlight); +} + +form.inline-menu { + margin: 0px; + display:inline; +} + form.follow { display: inline; } @@ -1166,6 +1230,8 @@ table.metadata td .emoji { /* Fixes a bit of extra padding on the bottom of the link. */ } + + /* Posts */ .post { diff --git a/takahe/urls.py b/takahe/urls.py index 1421d44..6603de7 100644 --- a/takahe/urls.py +++ b/takahe/urls.py @@ -186,7 +186,7 @@ urlpatterns = [ path("auth/reset//", auth.PerformReset.as_view(), name="password_reset"), # Identity selection path("@/activate/", identity.ActivateIdentity.as_view()), - path("identity/select/", identity.SelectIdentity.as_view()), + path("identity/select/", identity.SelectIdentity.as_view(), name="identity_select"), path("identity/create/", identity.CreateIdentity.as_view()), # Flat pages path("about/", core.About.as_view(), name="about"), diff --git a/templates/activities/_menu.html b/templates/activities/_menu.html index b5c4faf..6c6a451 100644 --- a/templates/activities/_menu.html +++ b/templates/activities/_menu.html @@ -36,6 +36,9 @@ Settings + + Select Identity + {% else %} Local Posts diff --git a/templates/base.html b/templates/base.html index ae3104d..afec60a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -55,7 +55,7 @@ {% endif %}
- + {% if not request.identity %} No Identity diff --git a/templates/identity/_menu.html b/templates/identity/_menu.html index 0e22c9d..9b4854c 100644 --- a/templates/identity/_menu.html +++ b/templates/identity/_menu.html @@ -1,6 +1,6 @@