appview/pages: rework topbar to incorporate strings #416

merged
opened by oppi.li targeting master from push-potvrpwlpwsl
Changed files
+43 -26
appview
pages
templates
layouts
+20 -3
appview/pages/templates/layouts/topbar.html
···
<div id="right-items" class="flex items-center gap-2">
{{ with .LoggedInUser }}
-
<a href="/repo/new" hx-boost="true" class="btn-create hover:no-underline hover:text-white">
-
{{ i "plus" "w-4 h-4" }}
-
</a>
{{ block "dropDown" . }} {{ end }}
{{ else }}
<a href="/login">login</a>
···
</nav>
{{ end }}
{{ define "dropDown" }}
<details class="relative inline-block text-left">
<summary
···
>
<a href="/{{ $user }}">profile</a>
<a href="/{{ $user }}?tab=repos">repositories</a>
<a href="/knots">knots</a>
<a href="/spindles">spindles</a>
<a href="/settings">settings</a>
···
<div id="right-items" class="flex items-center gap-2">
{{ with .LoggedInUser }}
+
{{ block "newButton" . }} {{ end }}
{{ block "dropDown" . }} {{ end }}
{{ else }}
<a href="/login">login</a>
···
</nav>
{{ end }}
+
{{ define "newButton" }}
+
<details class="relative inline-block text-left">
+
<summary class="btn-create py-0 cursor-pointer list-none flex items-center gap-2">
+
{{ i "plus" "w-4 h-4" }} new
+
</summary>
+
<div class="absolute flex flex-col right-0 mt-4 p-4 rounded w-48 bg-white dark:bg-gray-800 dark:text-white border border-gray-200 dark:border-gray-700">
+
<a href="/repo/new" class="flex items-center gap-2">
+
{{ i "book-plus" "w-4 h-4" }}
+
new repository
+
</a>
+
<a href="/strings/new" class="flex items-center gap-2">
+
{{ i "line-squiggle" "w-4 h-4" }}
+
new string
+
</a>
+
</div>
+
</details>
+
{{ end }}
+
{{ define "dropDown" }}
<details class="relative inline-block text-left">
<summary
···
>
<a href="/{{ $user }}">profile</a>
<a href="/{{ $user }}?tab=repos">repositories</a>
+
<a href="/strings/{{ $user }}">strings</a>
<a href="/knots">knots</a>
<a href="/spindles">spindles</a>
<a href="/settings">settings</a>
+22 -22
flake.lock
···
{
"nodes": {
"gitignore": {
"inputs": {
"nixpkgs": [
···
"type": "github"
}
},
-
"flake-utils": {
-
"inputs": {
-
"systems": "systems"
-
},
-
"locked": {
-
"lastModified": 1694529238,
-
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
-
"owner": "numtide",
-
"repo": "flake-utils",
-
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
-
"type": "github"
-
},
-
"original": {
-
"owner": "numtide",
-
"repo": "flake-utils",
-
"type": "github"
-
}
-
},
"gomod2nix": {
"inputs": {
"flake-utils": "flake-utils",
···
"lucide-src": {
"flake": false,
"locked": {
-
"lastModified": 1742302029,
-
"narHash": "sha256-OyPVtpnC4/AAmPq84Wt1r1Gcs48d9KG+UBCtZK87e9k=",
"type": "tarball",
-
"url": "https://github.com/lucide-icons/lucide/releases/download/0.483.0/lucide-icons-0.483.0.zip"
},
"original": {
"type": "tarball",
-
"url": "https://github.com/lucide-icons/lucide/releases/download/0.483.0/lucide-icons-0.483.0.zip"
}
},
"nixpkgs": {
···
{
"nodes": {
+
"flake-utils": {
+
"inputs": {
+
"systems": "systems"
+
},
+
"locked": {
+
"lastModified": 1694529238,
+
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
+
"owner": "numtide",
+
"repo": "flake-utils",
+
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
+
"type": "github"
+
},
+
"original": {
+
"owner": "numtide",
+
"repo": "flake-utils",
+
"type": "github"
+
}
+
},
"gitignore": {
"inputs": {
"nixpkgs": [
···
"type": "github"
}
},
"gomod2nix": {
"inputs": {
"flake-utils": "flake-utils",
···
"lucide-src": {
"flake": false,
"locked": {
+
"lastModified": 1754044466,
+
"narHash": "sha256-+exBR2OToB1iv7ZQI2S4B0lXA/QRvC9n6U99UxGpJGs=",
"type": "tarball",
+
"url": "https://github.com/lucide-icons/lucide/releases/download/0.536.0/lucide-icons-0.536.0.zip"
},
"original": {
"type": "tarball",
+
"url": "https://github.com/lucide-icons/lucide/releases/download/0.536.0/lucide-icons-0.536.0.zip"
}
},
"nixpkgs": {
+1 -1
flake.nix
···
flake = false;
};
lucide-src = {
-
url = "https://github.com/lucide-icons/lucide/releases/download/0.483.0/lucide-icons-0.483.0.zip";
flake = false;
};
inter-fonts-src = {
···
flake = false;
};
lucide-src = {
+
url = "https://github.com/lucide-icons/lucide/releases/download/0.536.0/lucide-icons-0.536.0.zip";
flake = false;
};
inter-fonts-src = {