patx/gitman
update the logged in nav to icons for a more minimal look
Commit d8e189e · patx · 2026-05-10T17:02:35-04:00
Comments
No comments yet.
Diff
diff --git a/app.py b/app.py
index 5e9d1ad..50c1e77 100644
--- a/app.py
+++ b/app.py
@@ -4644,7 +4644,7 @@ def login():
redirect(next_url)
[email protected]("/logout")
[email protected]("/logout", method=["GET"])
def logout():
logout_user()
redirect("/")
diff --git a/static/styles.css b/static/styles.css
index ad3ee96..ab2bb01 100644
--- a/static/styles.css
+++ b/static/styles.css
@@ -179,9 +179,18 @@ button, .button {
}
.brand svg {
flex: 0 0 auto;
- transform: scale(3);
+ transform: scale(2);
transform-origin: center;
}
+.nav-icons {
+ display: inline-flex;
+ align-items: center;
+ color: black;
+ font-weight: 700;
+ line-height: 1;
+ text-decoration: none;
+ color: var(--muted);
+}
.nav form, .repo-tabs form, .inline-form { display: inline; }
.link-button { padding: 0; color: var(--link); background: none; border: 0; text-decoration: underline; }
.repo-tabs .repo-tab { padding-bottom: .2rem; border-bottom: 2px solid transparent; }
diff --git a/templates/base.tpl b/templates/base.tpl
index a58f2f5..229913b 100644
--- a/templates/base.tpl
+++ b/templates/base.tpl
@@ -14,7 +14,7 @@
<body>
<header class="site-header">
<a class="brand" href="/">
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-git" viewBox="0 0 16 16">
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-git" viewBox="0 0 16 16">
<path d="M15.698 7.287 8.712.302a1.03 1.03 0 0 0-1.457 0l-1.45 1.45 1.84 1.84a1.223 1.223 0 0 1 1.55 1.56l1.773 1.774a1.224 1.224 0 0 1 1.267 2.025 1.226 1.226 0 0 1-2.002-1.334L8.58 5.963v4.353a1.226 1.226 0 1 1-1.008-.036V5.887a1.226 1.226 0 0 1-.666-1.608L5.093 2.465l-4.79 4.79a1.03 1.03 0 0 0 0 1.457l6.986 6.986a1.03 1.03 0 0 0 1.457 0l6.953-6.953a1.03 1.03 0 0 0 0-1.457"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-arms-up" viewBox="0 0 16 16">
@@ -24,12 +24,17 @@
</a>
<nav class="nav">
% if user:
- <a href="/{{user['username']}}">{{user['username']}}</a>
- <a href="/new">New repo</a>
- <form action="/logout" method="post">
- {{!csrf_field()}}
- <button class="link-button" type="submit">Log out</button>
- </form>
+ <a class="nav-icons" href="/{{user['username']}}">
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-person" viewBox="0 0 16 16">
+ <path d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6m2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0m4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4m-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10s-3.516.68-4.168 1.332c-.678.678-.83 1.418-.832 1.664z"/>
+ </svg>
+ </a>
+ <a class="nav-icons" href="/new">
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-plus-square" viewBox="0 0 16 16">
+ <path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/>
+ <path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"/>
+ </svg>
+ </a>
% else:
<a href="/login">Log in</a>
<a class="button small" href="/signup">Sign up</a>
diff --git a/templates/profile.tpl b/templates/profile.tpl
index ec75096..1cfd365 100644
--- a/templates/profile.tpl
+++ b/templates/profile.tpl
@@ -12,7 +12,7 @@
<p class="muted"><small>
Joined {{profile_user["created_at"]}}
% if is_self:
- <a class="button-link" href="/settings/profile">Edit profile</a>
+ <a class="button-link" href="/settings/profile">Edit profile</a> · <a class="button-link" href="/logout">Log out</a>
% end
</small></p>
% if profile_user["bio"]: