forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

appview: templates: first pass for dark mode

+18 -18
appview/pages/templates/fragments/diff.html
···
{{ $last := sub (len $diff) 1 }}
{{ range $idx, $hunk := $diff }}
{{ with $hunk }}
-
<section class="mt-6 border border-gray-200 w-full mx-auto rounded bg-white drop-shadow-sm">
+
<section class="mt-6 border border-gray-200 dark:border-gray-700 w-full mx-auto rounded bg-white dark:bg-gray-800 drop-shadow-sm">
<div id="file-{{ .Name.New }}">
<div id="diff-file">
<details open>
<summary class="list-none cursor-pointer sticky top-0">
-
<div id="diff-file-header" class="rounded cursor-pointer bg-white flex justify-between">
+
<div id="diff-file-header" class="rounded cursor-pointer bg-white dark:bg-gray-800 flex justify-between">
<div id="left-side-items" class="p-2 flex gap-2 items-center">
{{ $markerstyle := "diff-type p-1 mr-1 font-mono text-sm rounded select-none" }}
{{ if .IsNew }}
-
<span class="bg-green-100 text-green-700 {{ $markerstyle }}">ADDED</span>
+
<span class="bg-green-100 text-green-700 dark:bg-green-800/50 dark:text-green-400 {{ $markerstyle }}">ADDED</span>
{{ else if .IsDelete }}
-
<span class="bg-red-100 text-red-700 {{ $markerstyle }}">DELETED</span>
+
<span class="bg-red-100 text-red-700 dark:bg-red-800/50 dark:text-red-400 {{ $markerstyle }}">DELETED</span>
{{ else if .IsCopy }}
-
<span class="bg-gray-100 text-gray-700 {{ $markerstyle }}">COPIED</span>
+
<span class="bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300 {{ $markerstyle }}">COPIED</span>
{{ else if .IsRename }}
-
<span class="bg-gray-100 text-gray-700 {{ $markerstyle }}">RENAMED</span>
+
<span class="bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300 {{ $markerstyle }}">RENAMED</span>
{{ else }}
-
<span class="bg-gray-100 text-gray-700 {{ $markerstyle }}">MODIFIED</span>
+
<span class="bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300 {{ $markerstyle }}">MODIFIED</span>
{{ end }}
{{ if .IsDelete }}
-
<a {{if $this }}href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.Old }}"{{end}}>
+
<a class="dark:text-white" {{if $this }}href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.Old }}"{{end}}>
{{ .Name.Old }}
</a>
{{ else if (or .IsCopy .IsRename) }}
-
<a {{if $parent}}href="/{{ $repo }}/blob/{{ $parent }}/{{ .Name.Old }}"{{end}}>
+
<a class="dark:text-white" {{if $parent}}href="/{{ $repo }}/blob/{{ $parent }}/{{ .Name.Old }}"{{end}}>
{{ .Name.Old }}
</a>
{{ i "arrow-right" "w-4 h-4" }}
-
<a {{if $this}}href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.New }}"{{end}}>
+
<a class="dark:text-white" {{if $this}}href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.New }}"{{end}}>
{{ .Name.New }}
</a>
{{ else }}
-
<a {{if $this}}href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.New }}"{{end}}>
+
<a class="dark:text-white" {{if $this}}href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.New }}"{{end}}>
{{ .Name.New }}
</a>
{{ end }}
</div>
-
{{ $iconstyle := "p-1 mx-1 hover:bg-gray-100 rounded" }}
+
{{ $iconstyle := "p-1 mx-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded" }}
<div id="right-side-items" class="p-2 flex items-center">
<a title="top of file" href="#file-{{ .Name.New }}" class="{{ $iconstyle }}">{{ i "arrow-up-to-line" "w-4 h-4" }}</a>
{{ if gt $idx 0 }}
···
<div class="transition-all duration-700 ease-in-out">
{{ if .IsDelete }}
-
<p class="text-center text-gray-400 p-4">
+
<p class="text-center text-gray-400 dark:text-gray-500 p-4">
This file has been deleted in this commit.
</p>
{{ else }}
{{ if .IsBinary }}
-
<p class="text-center text-gray-400 p-4">
+
<p class="text-center text-gray-400 dark:text-gray-500 p-4">
This is a binary file and will not be displayed.
</p>
{{ else }}
<pre class="overflow-auto">
{{- range .TextFragments -}}
-
<div class="bg-gray-100 text-gray-500 select-none">{{ .Header }}</div>
+
<div class="bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400 select-none">{{ .Header }}</div>
{{- range .Lines -}}
{{- if eq .Op.String "+" -}}
-
<div class="bg-green-100 text-green-700 p-1 w-full min-w-fit"><span class="select-none mx-2">{{ .Op.String }}</span><span>{{ .Line }}</span></div>
+
<div class="bg-green-100 dark:bg-green-800/30 text-green-700 dark:text-green-400 p-1 w-full min-w-fit"><span class="select-none mx-2">{{ .Op.String }}</span><span>{{ .Line }}</span></div>
{{- end -}}
{{- if eq .Op.String "-" -}}
-
<div class="bg-red-100 text-red-700 p-1 w-full min-w-fit"><span class="select-none mx-2">{{ .Op.String }}</span><span>{{ .Line }}</span></div>
+
<div class="bg-red-100 dark:bg-red-800/30 text-red-700 dark:text-red-400 p-1 w-full min-w-fit"><span class="select-none mx-2">{{ .Op.String }}</span><span>{{ .Line }}</span></div>
{{- end -}}
{{- if eq .Op.String " " -}}
-
<div class="bg-white text-gray-500 px"><span class="select-none mx-2">{{ .Op.String }}</span><span>{{ .Line }}</span></div>
+
<div class="bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 px"><span class="select-none mx-2">{{ .Op.String }}</span><span>{{ .Line }}</span></div>
{{- end -}}
{{- end -}}
+88 -34
appview/pages/templates/knot.html
···
-
{{define "title"}}{{ .Registration.Domain }}{{end}}
+
{{ define "title" }}{{ .Registration.Domain }}{{ end }}
-
{{define "content"}}
-
<h1>{{.Registration.Domain}}</h1>
-
<p>
-
<code>
-
opened by: {{.Registration.ByDid}}
-
{{ if eq $.LoggedInUser.Did $.Registration.ByDid }}
-
(you)
-
{{ end }}
-
</code><br>
-
<code>on: {{.Registration.Created}}</code><br>
-
{{ if .Registration.Registered }}
-
<code>registered on: {{.Registration.Registered}}</code>
-
{{ else }}
-
<code>pending registration</code>
-
<button class="btn my-2" hx-post="/knots/{{.Domain}}/init" hx-swap="none">initialize</button>
+
{{ define "content" }}
+
<div class="p-6">
+
<p class="text-xl font-bold dark:text-white">{{ .Registration.Domain }}</p>
+
</div>
+
+
<div class="flex flex-col">
+
{{ block "registration-info" . }} {{ end }}
+
{{ block "members" . }} {{ end }}
+
{{ block "add-member" . }} {{ end }}
+
</div>
+
{{ end }}
+
+
{{ define "registration-info" }}
+
<section class="rounded bg-white dark:bg-gray-800 drop-shadow-sm px-6 py-4 mb-6 w-full lg:w-fit">
+
<dl class="grid grid-cols-[auto_1fr] gap-x-4 dark:text-gray-200">
+
<dt class="font-bold">opened by</dt>
+
<dd>
+
@{{ .Registration.ByDid }}
+
{{ if eq $.LoggedInUser.Did $.Registration.ByDid }}
+
<span class="text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 px-2 py-1 rounded ml-2">you</span>
{{ end }}
-
</p>
-
+
</dd>
+
+
<dt class="font-bold">opened</dt>
+
<dd>{{ .Registration.Created | timeFmt }}</dd>
+
{{ if .Registration.Registered }}
-
<h3> members </h3>
-
<ol>
-
{{ range $.Members }}
-
<li><a href="/{{.}}">{{.}}</a></li>
+
<dt class="font-bold">registered</dt>
+
<dd>{{ .Registration.Registered | timeFmt }}</dd>
{{ else }}
-
<p>no members</p>
+
<dt class="font-bold">status</dt>
+
<dd class="text-yellow-800 dark:text-yellow-200 bg-yellow-100 dark:bg-yellow-900 rounded px-2 py-1 inline-block">
+
Pending Registration
+
</dd>
{{ end }}
-
{{ end }}
-
</ol>
+
</dl>
+
+
{{ if not .Registration.Registered }}
+
<div class="mt-4">
+
<button
+
class="btn dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600"
+
hx-post="/knots/{{.Domain}}/init"
+
hx-swap="none">
+
Initialize Registration
+
</button>
+
</div>
+
{{ end }}
+
</section>
+
{{ end }}
-
{{ if $.IsOwner }}
-
<h3>add member</h3>
-
<form hx-put="/knots/{{.Registration.Domain}}/member">
-
<label for="member">did or handle:</label>
-
<input type="text" id="member" name="member" required>
-
<button class="btn my-2" type="text">add member</button>
-
</form>
-
{{ end }}
-
{{end}}
+
{{ define "members" }}
+
<h2 class="text-sm font-bold py-2 px-6 uppercase dark:text-gray-300">members</h2>
+
<section class="rounded bg-white dark:bg-gray-800 drop-shadow-sm px-6 py-4 mb-6 w-full lg:w-fit">
+
{{ if .Registration.Registered }}
+
<div id="member-list" class="flex flex-col gap-4">
+
{{ range $.Members }}
+
<div class="inline-flex items-center gap-4">
+
{{ i "user" "w-3 h-3 dark:text-gray-300" }}
+
<a href="/{{.}}" class="text-gray-900 dark:text-white">{{.}}</a>
+
</div>
+
{{ else }}
+
<p class="text-gray-500 dark:text-gray-400">No members have been added yet.</p>
+
{{ end }}
+
</div>
+
{{ else }}
+
<p class="text-gray-500 dark:text-gray-400">Members can be added after registration is complete.</p>
+
{{ end }}
+
</section>
+
{{ end }}
+
+
{{ define "add-member" }}
+
{{ if $.IsOwner }}
+
<h2 class="text-sm font-bold py-2 px-6 uppercase dark:text-gray-300">add member</h2>
+
<section class="rounded bg-white dark:bg-gray-800 drop-shadow-sm px-6 py-4 mb-6 w-full lg:w-fit">
+
<form
+
hx-put="/knots/{{.Registration.Domain}}/member"
+
class="max-w-2xl space-y-4">
+
<input
+
type="text"
+
id="member"
+
name="member"
+
placeholder="did or handle"
+
required
+
class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:placeholder-gray-400"/>
+
+
<button class="btn dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600" type="submit">add member</button>
+
+
<div id="add-member-error" class="error dark:text-red-400"></div>
+
</form>
+
</section>
+
{{ end }}
+
{{ end }}
+79 -85
appview/pages/templates/knots.html
···
{{ define "title" }}knots{{ end }}
-
{{ define "content" }}
-
<h1>knots</h1>
-
-
<section class="mb-12">
-
<h2 class="text-2xl mb-4">register a knot</h2>
-
<form hx-post="/knots/key" class="flex gap-4 items-end">
-
<div>
-
<label for="domain"
-
>Generate a key to start your knot with.</label
-
>
-
<input
-
type="text"
-
id="domain"
-
name="domain"
-
placeholder="knot.example.com"
-
required
-
/>
-
</div>
-
<button class="btn" type="submit">generate key</button>
-
</form>
+
<div class="p-6">
+
<p class="text-xl font-bold dark:text-white">Knots</p>
+
</div>
+
<div class="flex flex-col">
+
<h2 class="text-sm font-bold py-2 px-6 uppercase dark:text-gray-300">register a knot</h2>
+
<section class="rounded bg-white dark:bg-gray-800 drop-shadow-sm px-6 py-4 mb-6 w-full lg:w-fit">
+
<p class="mb-8 dark:text-gray-300">Generate a key to initialize your knot server.</p>
+
<form
+
hx-put="/knots/key"
+
hx-swap="none"
+
class="max-w-2xl mb-8 space-y-4"
+
>
+
<input
+
type="text"
+
id="domain"
+
name="domain"
+
placeholder="knot.example.com"
+
required
+
class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:placeholder-gray-400"
+
/>
+
<button class="btn dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600" type="submit">
+
generate key
+
</button>
+
<div id="settings-knots-error" class="error dark:text-red-400"></div>
+
</form>
</section>
-
<section class="mb-12">
-
<h3 class="text-xl font-semibold mb-4">my knots</h3>
-
<p>This is a list of knots</p>
-
<ul id="my-knots" class="space-y-6">
-
{{ range .Registrations }}
-
{{ if .Registered }}
-
<li class="border rounded p-4 flex flex-col gap-2">
-
<div>
-
<a href="/knots/{{ .Domain }}" class="font-semibold"
-
>{{ .Domain }}</a
-
>
-
</div>
-
<div class="text-gray-600">
-
Owned by
-
{{ .ByDid }}
-
</div>
-
<div class="text-gray-600">
-
Registered on
-
{{ .Registered }}
-
</div>
-
</li>
-
{{ end }}
-
{{ else }}
-
<p class="text-gray-600">you don't have any knots yet</p>
-
{{ end }}
-
</ul>
+
<h2 class="text-sm font-bold py-2 px-6 uppercase dark:text-gray-300">my knots</h2>
+
<section class="rounded bg-white dark:bg-gray-800 drop-shadow-sm px-6 py-4 mb-6 w-full lg:w-fit">
+
<div id="knots-list" class="flex flex-col gap-6 mb-8">
+
{{ range .Registrations }}
+
{{ if .Registered }}
+
<div class="grid grid-cols-[minmax(0,1fr)_auto] items-center gap-4">
+
<div class="flex flex-col gap-1">
+
<div class="inline-flex items-center gap-4">
+
{{ i "git-branch" "w-3 h-3 dark:text-gray-300" }}
+
<p class="font-bold dark:text-white">{{ .Domain }}</p>
+
</div>
+
<p class="text-sm text-gray-500 dark:text-gray-400">owned by {{ .ByDid }}</p>
+
<p class="text-sm text-gray-500 dark:text-gray-400">registered {{ .Registered | timeFmt }}</p>
+
</div>
+
</div>
+
{{ end }}
+
{{ else }}
+
<p class="text-sm text-gray-500 dark:text-gray-400">No knots registered</p>
+
{{ end }}
+
</div>
</section>
-
<section>
-
<h3 class="text-xl font-semibold mb-4">pending registrations</h3>
-
<ul id="pending-registrations" class="space-y-6">
-
{{ range .Registrations }}
-
{{ if not .Registered }}
-
<li class="border rounded p-4 flex flex-col gap-2">
-
<div>
-
<a
-
href="/knots/{{ .Domain }}"
-
class="text-blue-600 hover:underline"
-
>{{ .Domain }}</a
-
>
-
</div>
-
<div class="text-gray-600">
-
Opened by
-
{{ .ByDid }}
-
</div>
-
<div class="text-gray-600">
-
Created on
-
{{ .Created }}
-
</div>
-
<div class="flex items-center gap-4 mt-2">
-
<span class="text-amber-600"
-
>pending registration</span
-
>
-
<button
-
class="btn"
-
hx-post="/knots/{{ .Domain }}/init"
-
>
-
initialize
-
</button>
-
</div>
-
</li>
-
{{ end }}
-
{{ else }}
-
<p class="text-gray-600">no registrations yet</p>
-
{{ end }}
-
</ul>
+
<h2 class="text-sm font-bold py-2 px-6 uppercase dark:text-gray-300">pending registrations</h2>
+
<section class="rounded bg-white dark:bg-gray-800 drop-shadow-sm px-6 py-4 mb-6 w-full lg:w-fit">
+
<div id="pending-knots-list" class="flex flex-col gap-6 mb-8">
+
{{ range .Registrations }}
+
{{ if not .Registered }}
+
<div class="grid grid-cols-[minmax(0,1fr)_auto] items-center gap-4">
+
<div class="flex flex-col gap-1">
+
<div class="inline-flex items-center gap-4">
+
<p class="font-bold dark:text-white">{{ .Domain }}</p>
+
<div class="inline-flex items-center gap-1">
+
<span class="text-xs bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200 px-2 py-1 rounded">
+
pending
+
</span>
+
</div>
+
</div>
+
<p class="text-sm text-gray-500 dark:text-gray-400">opened by {{ .ByDid }}</p>
+
<p class="text-sm text-gray-500 dark:text-gray-400">created {{ .Created | timeFmt }}</p>
+
</div>
+
<div class="flex gap-2 items-center">
+
<button
+
class="btn dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 gap-2"
+
hx-post="/knots/{{ .Domain }}/init">
+
{{ i "square-play" "w-5 h-5" }}
+
<span class="hidden md:inline">initialize</span>
+
</button>
+
</div>
+
</div>
+
{{ end }}
+
{{ else }}
+
<p class="text-sm text-gray-500 dark:text-gray-400">No pending registrations</p>
+
{{ end }}
+
</div>
</section>
-
{{ end }}
+
</div>
+
{{ end }}
+3 -3
appview/pages/templates/layouts/base.html
···
{{ define "layouts/base" }}
<!doctype html>
-
<html lang="en">
+
<html lang="en" class="dark:bg-gray-900">
<head>
<meta charset="UTF-8" />
<meta
···
<title>{{ block "title" . }}{{ end }} · tangled</title>
{{ block "extrameta" . }}{{ end }}
</head>
-
<body class="bg-slate-100">
-
<div class="container mx-auto px-1 pt-4 min-h-screen flex flex-col">
+
<body class="bg-slate-100 dark:bg-gray-900 dark:text-white transition-colors duration-200">
+
<div class="container mx-auto px-1 pt-4 min-h-screen flex flex-col">
<header style="z-index: 5">
{{ block "topbar" . }}
{{ template "layouts/topbar" . }}
+2 -2
appview/pages/templates/layouts/footer.html
···
{{ define "layouts/footer" }}
-
<div class="w-full p-4 bg-white rounded-t">
-
<div class="container mx-auto text-center text-gray-600 text-sm">
+
<div class="w-full p-4 bg-white dark:bg-gray-800 rounded-t">
+
<div class="container mx-auto text-center text-gray-600 dark:text-gray-400 text-sm">
<span class="font-semibold italic">tangled</span> &mdash; made by <a href="/@oppili.bsky.social">@oppili.bsky.social</a> and <a href="/@icyphox.sh">@icyphox.sh</a>
</div>
</div>
+6 -6
appview/pages/templates/layouts/repobase.html
···
{{ define "title" }}{{ .RepoInfo.FullName }}{{ end }}
{{ define "content" }}
-
<section id="repo-header" class="mb-4 py-2 px-6">
+
<section id="repo-header" class="mb-4 py-2 px-6 dark:text-white">
<p class="text-lg">
<a href="/{{ .RepoInfo.OwnerWithAt }}">{{ .RepoInfo.OwnerWithAt }}</a>
<span class="select-none">/</span>
···
<section class="min-h-screen flex flex-col drop-shadow-sm">
<nav class="w-full pl-4 overflow-auto">
<div class="flex z-60">
-
{{ $activeTabStyles := "-mb-px bg-white" }}
+
{{ $activeTabStyles := "-mb-px bg-white dark:bg-gray-800" }}
{{ $tabs := .RepoInfo.GetTabs }}
{{ $tabmeta := .RepoInfo.TabMetadata }}
{{ range $item := $tabs }}
···
hx-boost="true"
>
<div
-
class="px-4 py-1 mr-1 text-black min-w-[80px] text-center relative rounded-t whitespace-nowrap
+
class="px-4 py-1 mr-1 text-black dark:text-white min-w-[80px] text-center relative rounded-t whitespace-nowrap
{{ if eq $.Active $key }}
{{ $activeTabStyles }}
{{ else }}
-
group-hover:bg-gray-200
+
group-hover:bg-gray-200 dark:group-hover:bg-gray-700
{{ end }}
"
>
{{ $key }}
{{ if not (isNil $meta) }}
-
<span class="bg-gray-200 rounded py-1/2 px-1 text-sm">{{ $meta }}</span>
+
<span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-sm">{{ $meta }}</span>
{{ end }}
</div>
</a>
···
</div>
</nav>
<section
-
class="bg-white p-6 rounded relative z-20 w-full mx-auto drop-shadow-sm"
+
class="bg-white dark:bg-gray-800 p-6 rounded relative z-20 w-full mx-auto drop-shadow-sm dark:text-white"
>
{{ block "repoContent" . }}{{ end }}
</section>
+3 -3
appview/pages/templates/layouts/topbar.html
···
{{ define "layouts/topbar" }}
-
<nav class="space-x-4 mb-4 px-6 py-2 rounded bg-white drop-shadow-sm">
+
<nav class="space-x-4 mb-4 px-6 py-2 rounded bg-white dark:bg-gray-800 dark:text-white drop-shadow-sm">
<div class="container flex justify-between p-0">
<div id="left-items">
<a href="/" hx-boost="true" class="flex gap-2 font-semibold italic">
···
{{ didOrHandle .Did .Handle }}
</summary>
<div
-
class="absolute flex flex-col right-0 mt-4 p-4 rounded w-48 bg-white border border-gray-200"
+
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="/{{ didOrHandle .Did .Handle }}">profile</a>
<a href="/knots">knots</a>
<a href="/settings">settings</a>
-
<a href="/logout" class="text-red-400 hover:text-red-700">logout</a>
+
<a href="/logout" class="text-red-400 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300">logout</a>
</div>
</details>
{{ end }}
+7 -7
appview/pages/templates/repo/blob.html
···
{{ $lines := split .Contents }}
{{ $tot_lines := len $lines }}
{{ $tot_chars := len (printf "%d" $tot_lines) }}
-
{{ $code_number_style := "text-gray-400 left-0 bg-white text-right mr-6 select-none inline-block w-12" }}
+
{{ $code_number_style := "text-gray-400 dark:text-gray-500 left-0 bg-white dark:bg-gray-800 text-right mr-6 select-none inline-block w-12" }}
{{ $linkstyle := "no-underline hover:underline" }}
-
<div class="pb-2 mb-3 text-base border-b border-gray-200">
+
<div class="pb-2 mb-3 text-base border-b border-gray-200 dark:border-gray-700">
<div class="flex flex-col md:flex-row md:justify-between gap-2">
<div id="breadcrumbs" class="overflow-x-auto whitespace-nowrap">
{{ range $idx, $value := .BreadCrumbs }}
{{ if ne $idx (sub (len $.BreadCrumbs) 1) }}
<a
href="{{ index . 1 }}"
-
class="text-bold text-gray-500 {{ $linkstyle }}"
+
class="text-bold text-gray-500 dark:text-gray-400 {{ $linkstyle }}"
>{{ index . 0 }}</a
>
/
{{ else }}
-
<span class="text-bold text-gray-500"
+
<span class="text-bold text-gray-500 dark:text-gray-400"
>{{ index . 0 }}</span
>
{{ end }}
{{ end }}
</div>
-
<div id="file-info" class="text-gray-500 text-xs md:text-sm flex flex-wrap items-center gap-1 md:gap-0">
+
<div id="file-info" class="text-gray-500 dark:text-gray-400 text-xs md:text-sm flex flex-wrap items-center gap-1 md:gap-0">
<span>at <a href="/{{ .RepoInfo.FullName }}/tree/{{ .Ref }}">{{ .Ref }}</a></span>
<span class="select-none px-1 md:px-2 [&:before]:content-['·']"></span>
<span>{{ .Lines }} lines</span>
···
</div>
</div>
{{ if .IsBinary }}
-
<p class="text-center text-gray-400">
+
<p class="text-center text-gray-400 dark:text-gray-500">
This is a binary file and will not be displayed.
</p>
{{ else }}
···
{{ $linenr }}
</span>
</a>
-
<div class="whitespace-pre peer-target:bg-yellow-200">{{ $line | escapeHtml }}</div>
+
<div class="whitespace-pre peer-target:bg-yellow-200 dark:peer-target:bg-yellow-900">{{ $line | escapeHtml }}</div>
</div>
{{ end }}
</div>
+12 -12
appview/pages/templates/repo/commit.html
···
{{ $stat := .Diff.Stat }}
{{ $diff := .Diff.Diff }}
-
<section class="commit">
+
<section class="commit dark:text-white">
<div id="commit-message">
{{ $messageParts := splitN $commit.Message "\n\n" 2 }}
<div>
···
</div>
<div class="flex items-center">
-
<p class="text-sm text-gray-500">
+
<p class="text-sm text-gray-500 dark:text-gray-300">
{{ $didOrHandle := index $.EmailToDidOrHandle $commit.Author.Email }}
{{ if $didOrHandle }}
-
<a href="/{{ $didOrHandle }}" class="no-underline hover:underline text-gray-500">{{ $didOrHandle }}</a>
+
<a href="/{{ $didOrHandle }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ $didOrHandle }}</a>
{{ else }}
-
<a href="mailto:{{ $commit.Author.Email }}" class="no-underline hover:underline text-gray-500">{{ $commit.Author.Name }}</a>
+
<a href="mailto:{{ $commit.Author.Email }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ $commit.Author.Name }}</a>
{{ end }}
<span class="px-1 select-none before:content-['\00B7']"></span>
{{ timeFmt $commit.Author.When }}
···
<span class="px-1 select-none before:content-['\00B7']"></span>
</p>
-
<p class="flex items-center text-sm text-gray-500">
-
<a href="/{{ $repo }}/commit/{{ $commit.This }}" class="no-underline hover:underline text-gray-500">{{ slice $commit.This 0 8 }}</a>
+
<p class="flex items-center text-sm text-gray-500 dark:text-gray-300">
+
<a href="/{{ $repo }}/commit/{{ $commit.This }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ slice $commit.This 0 8 }}</a>
{{ if $commit.Parent }}
{{ i "arrow-left" "w-3 h-3 mx-1" }}
-
<a href="/{{ $repo }}/commit/{{ $commit.Parent }}" class="no-underline hover:underline text-gray-500">{{ slice $commit.Parent 0 8 }}</a>
+
<a href="/{{ $repo }}/commit/{{ $commit.Parent }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ slice $commit.Parent 0 8 }}</a>
{{ end }}
</p>
</div>
-
+
<div class="diff-stat">
<br>
-
<strong class="text-sm uppercase mb-4">Changed files</strong>
+
<strong class="text-sm uppercase mb-4 dark:text-gray-200">Changed files</strong>
{{ range $diff }}
-
<ul>
+
<ul class="dark:text-gray-200">
{{ if .IsDelete }}
-
<li><a href="#file-{{ .Name.Old }}">{{ .Name.Old }}</a></li>
+
<li><a href="#file-{{ .Name.Old }}" class="dark:hover:text-gray-300">{{ .Name.Old }}</a></li>
{{ else }}
-
<li><a href="#file-{{ .Name.New }}">{{ .Name.New }}</a></li>
+
<li><a href="#file-{{ .Name.New }}" class="dark:hover:text-gray-300">{{ .Name.New }}</a></li>
{{ end }}
</ul>
{{ end }}
+8 -8
appview/pages/templates/repo/empty.html
···
{{ define "repoContent" }}
<main>
-
<p class="text-center pt-5 text-gray-400">
+
<p class="text-center pt-5 text-gray-400 dark:text-gray-500">
This is an empty repository. Push some commits here.
</p>
</main>
{{ end }}
{{ define "repoAfter" }}
-
<section class="mt-4 p-6 rounded bg-white w-full mx-auto overflow-auto">
+
<section class="mt-4 p-6 rounded bg-white dark:bg-gray-800 dark:text-white w-full mx-auto overflow-auto">
<strong>push</strong>
<div class="py-2">
-
<code>git remote add origin git@{{.RepoInfo.Knot}}:{{ .RepoInfo.OwnerHandle }}/{{ .RepoInfo.Name }}</code>
+
<code class="dark:text-gray-300">git remote add origin git@{{.RepoInfo.Knot}}:{{ .RepoInfo.OwnerHandle }}/{{ .RepoInfo.Name }}</code>
</div>
<strong>clone</strong>
-
+
<div class="flex flex-col gap-2">
<div class="pt-2 flex flex-row gap-2">
-
<span class="bg-gray-100 p-1 mr-1 font-mono text-sm rounded select-none">HTTP</span>
-
<code>git clone https://tangled.sh/{{ .RepoInfo.OwnerWithAt }}/{{ .RepoInfo.Name }}</code>
+
<span class="bg-gray-100 dark:bg-gray-700 p-1 mr-1 font-mono text-sm rounded select-none dark:text-gray-300">HTTP</span>
+
<code class="dark:text-gray-300">git clone https://tangled.sh/{{ .RepoInfo.OwnerWithAt }}/{{ .RepoInfo.Name }}</code>
</div>
<div class="pt-2 flex flex-row gap-2">
-
<span class="bg-gray-100 p-1 mr-1 font-mono text-sm rounded select-none">SSH</span><code>git clone git@{{.RepoInfo.Knot}}:{{ .RepoInfo.OwnerHandle }}/{{ .RepoInfo.Name }}</code>
+
<span class="bg-gray-100 dark:bg-gray-700 p-1 mr-1 font-mono text-sm rounded select-none dark:text-gray-300">SSH</span><code class="dark:text-gray-300">git clone git@{{.RepoInfo.Knot}}:{{ .RepoInfo.OwnerHandle }}/{{ .RepoInfo.Name }}</code>
</div>
</div>
-
<p class="py-2 text-gray-500">Note that for self-hosted knots, clone URLs may be different based on your setup.</p>
+
<p class="py-2 text-gray-500 dark:text-gray-400">Note that for self-hosted knots, clone URLs may be different based on your setup.</p>
</section>
{{ end }}
+29 -29
appview/pages/templates/repo/index.html
···
<div class="flex justify-between pb-5">
<select
onchange="window.location.href = '/{{ .RepoInfo.FullName }}/tree/' + encodeURIComponent(this.value)"
-
class="p-1 border border-gray-200 bg-white"
+
class="p-1 border border-gray-200 bg-white dark:bg-gray-800 dark:text-white dark:border-gray-700"
>
<optgroup label="branches" class="bold text-sm">
{{ range .Branches }}
···
</select>
<a
href="/{{ .RepoInfo.FullName }}/commits/{{ .Ref | urlquery }}"
-
class="ml-2 no-underline flex items-center gap-2 text-sm uppercase font-bold"
+
class="ml-2 no-underline flex items-center gap-2 text-sm uppercase font-bold dark:text-white"
>
{{ i "logs" "w-4 h-4" }}
{{ .TotalCommits }}
···
{{ end }}
{{ define "fileTree" }}
-
<div id="file-tree" class="col-span-1 pr-2 md:border-r md:border-gray-200">
+
<div id="file-tree" class="col-span-1 pr-2 md:border-r md:border-gray-200 dark:md:border-gray-700">
{{ $containerstyle := "py-1" }}
-
{{ $linkstyle := "no-underline hover:underline" }}
+
{{ $linkstyle := "no-underline hover:underline dark:text-white" }}
{{ range .Files }}
{{ if not .IsFile }}
···
</div>
</a>
-
<time class="text-xs text-gray-500"
+
<time class="text-xs text-gray-500 dark:text-gray-400"
>{{ timeFmt .LastCommit.When }}</time
>
</div>
···
</div>
</a>
-
<time class="text-xs text-gray-500"
+
<time class="text-xs text-gray-500 dark:text-gray-400"
>{{ timeFmt .LastCommit.When }}</time
>
</div>
···
<div>
<a
href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}"
-
class="inline no-underline hover:underline"
+
class="inline no-underline hover:underline dark:text-white"
>{{ index $messageParts 0 }}</a
>
{{ if gt (len $messageParts) 1 }}
<button
-
class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded"
+
class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600"
hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')"
>
{{ i "ellipsis" "w-3 h-3" }}
···
</div>
{{ if gt (len $messageParts) 1 }}
<p
-
class="hidden mt-1 text-sm cursor-text pb-2"
+
class="hidden mt-1 text-sm cursor-text pb-2 dark:text-gray-300"
>
{{ nl2br (unwrapText (index $messageParts 1)) }}
</p>
···
</div>
</div>
-
<div class="text-xs text-gray-500">
+
<div class="text-xs text-gray-500 dark:text-gray-400">
<span class="font-mono">
<a
href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}"
-
class="text-gray-500 no-underline hover:underline"
+
class="text-gray-500 dark:text-gray-400 no-underline hover:underline"
>{{ slice .Hash.String 0 8 }}</a
>
</span>
···
{{ $didOrHandle := index $.EmailToDidOrHandle .Author.Email }}
<a
href="{{ if $didOrHandle }}/{{ $didOrHandle }}{{ else }}mailto:{{ .Author.Email }}{{ end }}"
-
class="text-gray-500 no-underline hover:underline"
+
class="text-gray-500 dark:text-gray-400 no-underline hover:underline"
>{{ if $didOrHandle }}{{ $didOrHandle }}{{ else }}{{ .Author.Name }}{{ end }}</a
>
</span>
···
></div>
{{ end }}
{{ range $tagsForCommit }}
-
<span class="text-xs rounded bg-gray-100 text-black font-mono px-2 mx-1/2 inline-flex items-center">
+
<span class="text-xs rounded bg-gray-100 dark:bg-gray-700 text-black dark:text-white font-mono px-2 mx-1/2 inline-flex items-center">
{{ . }}
</span>
{{ end }}
···
{{ define "repoAfter" }}
{{- if .HTMLReadme }}
-
<section class="mt-4 p-6 rounded bg-white w-full mx-auto overflow-auto {{ if not .Raw }} prose {{ end }}">
-
<article class="{{ if .Raw }}whitespace-pre{{end}}">
-
{{ if .Raw }}
-
<pre>{{ .HTMLReadme }}</pre>
-
{{ else }}
-
{{ .HTMLReadme }}
-
{{ end }}
-
</article>
-
</section>
+
<section class="mt-4 p-6 rounded bg-white dark:bg-gray-800 dark:text-white w-full mx-auto overflow-auto {{ if not .Raw }} prose dark:prose-invert dark:[&_pre]:bg-gray-900 dark:[&_code]:text-gray-300 dark:[&_pre_code]:bg-gray-900 dark:[&_pre]:border dark:[&_pre]:border-gray-700 {{ end }}">
+
<article class="{{ if .Raw }}whitespace-pre{{end}}">
+
{{ if .Raw }}
+
<pre class="dark:bg-gray-900 dark:text-gray-200 dark:border dark:border-gray-700 dark:p-4 dark:rounded">{{ .HTMLReadme }}</pre>
+
{{ else }}
+
{{ .HTMLReadme }}
+
{{ end }}
+
</article>
+
</section>
{{- end -}}
-
<section class="mt-4 p-6 rounded bg-white w-full mx-auto overflow-auto flex flex-col gap-4">
+
<section class="mt-4 p-6 rounded bg-white dark:bg-gray-800 dark:text-white w-full mx-auto overflow-auto flex flex-col gap-4">
<div class="flex flex-col gap-2">
<strong>push</strong>
<div class="md:pl-4 overflow-x-auto whitespace-nowrap">
-
<code>git remote add origin git@{{.RepoInfo.Knot}}:{{ .RepoInfo.OwnerHandle }}/{{ .RepoInfo.Name }}</code>
+
<code class="dark:text-gray-100">git remote add origin git@{{.RepoInfo.Knot}}:{{ .RepoInfo.OwnerHandle }}/{{ .RepoInfo.Name }}</code>
</div>
</div>
···
<div class="md:pl-4 flex flex-col gap-2">
<div class="flex items-center gap-3">
-
<span class="bg-gray-100 p-1 mr-1 font-mono text-sm rounded select-none">HTTP</span>
+
<span class="bg-gray-100 dark:bg-gray-700 p-1 mr-1 font-mono text-sm rounded select-none dark:text-white">HTTP</span>
<div class="overflow-x-auto whitespace-nowrap flex-1">
-
<code>git clone https://tangled.sh/{{ .RepoInfo.OwnerWithAt }}/{{ .RepoInfo.Name }}</code>
+
<code class="dark:text-gray-100">git clone https://tangled.sh/{{ .RepoInfo.OwnerWithAt }}/{{ .RepoInfo.Name }}</code>
</div>
</div>
<div class="flex items-center gap-3">
-
<span class="bg-gray-100 p-1 mr-1 font-mono text-sm rounded select-none">SSH</span>
+
<span class="bg-gray-100 dark:bg-gray-700 p-1 mr-1 font-mono text-sm rounded select-none dark:text-white">SSH</span>
<div class="overflow-x-auto whitespace-nowrap flex-1">
-
<code>git clone git@{{.RepoInfo.Knot}}:{{ .RepoInfo.OwnerHandle }}/{{ .RepoInfo.Name }}</code>
+
<code class="dark:text-gray-100">git clone git@{{.RepoInfo.Knot}}:{{ .RepoInfo.OwnerHandle }}/{{ .RepoInfo.Name }}</code>
</div>
</div>
</div>
</div>
-
<p class="py-2 text-gray-500">Note that for self-hosted knots, clone URLs may be different based on your setup.</p>
+
<p class="py-2 text-gray-500 dark:text-gray-400">Note that for self-hosted knots, clone URLs may be different based on your setup.</p>
</section>
{{ end }}
+18 -18
appview/pages/templates/repo/issues/issue.html
···
<header class="pb-4">
<h1 class="text-2xl">
{{ .Issue.Title }}
-
<span class="text-gray-500">#{{ .Issue.IssueId }}</span>
+
<span class="text-gray-500 dark:text-gray-400">#{{ .Issue.IssueId }}</span>
</h1>
</header>
-
{{ $bgColor := "bg-gray-800" }}
+
{{ $bgColor := "bg-gray-800 dark:bg-gray-700" }}
{{ $icon := "ban" }}
{{ if eq .State "open" }}
-
{{ $bgColor = "bg-green-600" }}
+
{{ $bgColor = "bg-green-600 dark:bg-green-700" }}
{{ $icon = "circle-dot" }}
{{ end }}
<section class="mt-2">
<div class="inline-flex items-center gap-2">
<div id="state"
-
class="inline-flex items-center rounded px-3 py-1 {{ $bgColor }} text-sm">
+
class="inline-flex items-center rounded px-3 py-1 {{ $bgColor }}">
{{ i $icon "w-4 h-4 mr-1.5 text-white" }}
<span class="text-white">{{ .State }}</span>
</div>
-
<span class="text-gray-500 text-sm">
+
<span class="text-gray-500 dark:text-gray-400 text-sm">
opened by
{{ $owner := didOrHandle .Issue.OwnerDid .IssueOwnerHandle }}
<a href="/{{ $owner }}" class="no-underline hover:underline"
···
</div>
{{ if .Issue.Body }}
-
<article id="body" class="mt-4 prose">
+
<article id="body" class="mt-8 prose dark:text-white">
{{ .Issue.Body | markdown }}
</article>
{{ end }}
···
{{ range $index, $comment := .Comments }}
<div
id="comment-{{ .CommentId }}"
-
class="rounded bg-white px-6 py-4 relative"
+
class="rounded bg-white px-6 py-4 relative dark:bg-gray-800"
>
{{ if eq $index 0 }}
-
<div class="absolute left-8 -top-8 w-px h-8 bg-gray-300" ></div>
+
<div class="absolute left-8 -top-8 w-px h-8 bg-gray-300 dark:bg-gray-700" ></div>
{{ else }}
-
<div class="absolute left-8 -top-4 w-px h-4 bg-gray-300" ></div>
+
<div class="absolute left-8 -top-4 w-px h-4 bg-gray-300 dark:bg-gray-700" ></div>
{{ end }}
-
<div class="flex items-center gap-2 mb-2 text-gray-500">
+
<div class="flex items-center gap-2 mb-2 text-gray-500 dark:text-gray-400">
{{ $owner := index $.DidHandleMap .OwnerDid }}
<span class="text-sm">
<a
···
<span class="before:content-['·']"></span>
<a
href="#{{ .CommentId }}"
-
class="text-gray-500 text-sm hover:text-gray-500 hover:underline no-underline"
+
class="text-gray-500 text-sm hover:text-gray-500 hover:underline no-underline dark:text-gray-400 dark:hover:text-gray-300 dark:hover:bg-gray-800"
id="{{ .CommentId }}"
>
{{ .Created | timeFmt }}
</a>
</div>
-
<div class="prose">
+
<div class="prose dark:text-white">
{{ .Body | markdown }}
</div>
</div>
···
>
<button type="submit" class="btn hover:bg-{{ $hoverColor }}-300">
{{ i $icon "w-4 h-4 mr-2" }}
-
<span class="text-black">{{ $action }}</span>
+
<span class="text-black dark:text-gray-400">{{ $action }}</span>
</button>
<div id="issue-action" class="error"></div>
</form>
···
{{ define "newComment" }}
{{ if .LoggedInUser }}
-
<div class="bg-white rounded drop-shadow-sm py-4 px-6 relative w-full flex flex-col gap-2 mt-8">
-
<div class="absolute left-8 -top-8 w-px h-8 bg-gray-300" ></div>
-
<div class="text-sm text-gray-500">
+
<div class="bg-white rounded drop-shadow-sm py-4 px-6 relative w-full flex flex-col gap-2 mt-8 dark:bg-gray-800 dark:text-gray-400">
+
<div class="absolute left-8 -top-8 w-px h-8 bg-gray-300 dark:bg-gray-700" ></div>
+
<div class="text-sm text-gray-500 dark:text-gray-400">
{{ didOrHandle .LoggedInUser.Did .LoggedInUser.Handle }}
</div>
<form hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment">
<textarea
name="body"
-
class="w-full p-2 rounded border border-gray-200"
+
class="w-full p-2 rounded border border-gray-200 dark:border-gray-700"
placeholder="Add to the discussion..."
></textarea>
<button type="submit" class="btn mt-2">comment</button>
···
</div>
{{ else }}
<div class="bg-white rounded drop-shadow-sm px-6 py-4 mt-8">
-
<div class="absolute left-8 -top-8 w-px h-8 bg-gray-300" ></div>
+
<div class="absolute left-8 -top-8 w-px h-8 bg-gray-300 dark:bg-gray-700" ></div>
<a href="/login" class="underline">login</a> to join the discussion
</div>
{{ end }}
+8 -8
appview/pages/templates/repo/issues/issues.html
···
<div class="flex justify-between items-center">
<p>
filtering
-
<select class="border px-1 bg-white border-gray-200" onchange="window.location.href = '/{{ .RepoInfo.FullName }}/issues?state=' + this.value">
+
<select class="border px-1 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700" onchange="window.location.href = '/{{ .RepoInfo.FullName }}/issues?state=' + this.value">
<option value="open" {{ if .FilteringByOpen }}selected{{ end }}>open ({{ .RepoInfo.Stats.IssueCount.Open }})</option>
<option value="closed" {{ if not .FilteringByOpen }}selected{{ end }}>closed ({{ .RepoInfo.Stats.IssueCount.Closed }})</option>
</select>
···
{{ define "repoAfter" }}
<div class="flex flex-col gap-2 mt-2">
{{ range .Issues }}
-
<div class="rounded drop-shadow-sm bg-white px-6 py-4">
+
<div class="rounded drop-shadow-sm bg-white px-6 py-4 dark:bg-gray-800 dark:border-gray-700">
<div class="pb-2">
<a
href="/{{ $.RepoInfo.FullName }}/issues/{{ .IssueId }}"
···
<span class="text-gray-500">#{{ .IssueId }}</span>
</a>
</div>
-
<p class="text-sm text-gray-500">
-
{{ $bgColor := "bg-gray-800" }}
+
<p class="text-sm text-gray-500 dark:text-gray-400">
+
{{ $bgColor := "bg-gray-800 dark:bg-gray-700" }}
{{ $icon := "ban" }}
{{ $state := "closed" }}
{{ if .Open }}
-
{{ $bgColor = "bg-green-600" }}
+
{{ $bgColor = "bg-green-600 dark:bg-green-700" }}
{{ $icon = "circle-dot" }}
{{ $state = "open" }}
{{ end }}
<span class="inline-flex items-center rounded px-2 py-[5px] {{ $bgColor }} text-sm">
-
{{ i $icon "w-3 h-3 mr-1.5 text-white" }}
-
<span class="text-white">{{ $state }}</span>
+
{{ i $icon "w-3 h-3 mr-1.5 text-white dark:text-white" }}
+
<span class="text-white dark:text-white">{{ $state }}</span>
</span>
<span>
···
{{ if eq .Metadata.CommentCount 1 }}
{{ $s = "" }}
{{ end }}
-
<a href="/{{ $.RepoInfo.FullName }}/issues/{{ .IssueId }}" class="text-gray-500">{{ .Metadata.CommentCount }} comment{{$s}}</a>
+
<a href="/{{ $.RepoInfo.FullName }}/issues/{{ .IssueId }}" class="text-gray-500 dark:text-gray-400">{{ .Metadata.CommentCount }} comment{{$s}}</a>
</span>
</p>
</div>
+16 -16
appview/pages/templates/repo/log.html
···
{{ $commit := index .Commits 0 }}
{{ $messageParts := splitN $commit.Message "\n\n" 2 }}
<div>
-
<a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}">
+
<a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}" class="dark:text-white">
<p class="pb-5">{{ index $messageParts 0 }}</p>
{{ if gt (len $messageParts) 1 }}
<p class="mt-1 text-sm cursor-text pb-5">
···
</a>
</div>
-
<div class="text-sm text-gray-500">
+
<div class="text-sm text-gray-500 dark:text-gray-400">
<span class="font-mono">
<a
href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}"
-
class="text-gray-500 no-underline hover:underline"
+
class="text-gray-500 dark:text-gray-400 no-underline hover:underline"
>{{ slice $commit.Hash.String }}</a
>
</span>
···
{{ if $didOrHandle }}
<a
href="/{{ $didOrHandle }}"
-
class="text-gray-500 no-underline hover:underline"
+
class="text-gray-500 dark:text-gray-400 no-underline hover:underline"
>{{ $didOrHandle }}</a
>
{{ else }}
<a
href="mailto:{{ $commit.Author.Email }}"
-
class="text-gray-500 no-underline hover:underline"
+
class="text-gray-500 dark:text-gray-400 no-underline hover:underline"
>{{ $commit.Author.Name }}</a
>
{{ end }}
···
{{ define "repoAfter" }}
<main>
<div id="commit-log" class="flex-1 relative">
-
<div class="absolute left-8 top-0 bottom-0 w-px bg-gray-300"></div>
+
<div class="absolute left-8 top-0 bottom-0 w-px bg-gray-300 dark:bg-gray-600"></div>
{{ $end := length .Commits }}
{{ $commits := subslice .Commits 1 $end }}
{{ range $commits }}
<div class="flex flex-row justify-between items-center">
<div
-
class="relative w-full px-4 py-4 mt-4 rounded-sm bg-white"
+
class="relative w-full px-4 py-4 mt-4 rounded-sm bg-white dark:bg-gray-800"
>
<div id="commit-message">
{{ $messageParts := splitN .Message "\n\n" 2 }}
···
<div>
<a
href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}"
-
class="inline no-underline hover:underline"
+
class="inline no-underline hover:underline dark:text-white"
>{{ index $messageParts 0 }}</a
>
{{ if gt (len $messageParts) 1 }}
<button
-
class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded"
+
class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 dark:bg-gray-700 dark:hover:bg-gray-600 rounded"
hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')"
>
{{ i "ellipsis" "w-3 h-3" }}
···
</div>
{{ if gt (len $messageParts) 1 }}
<p
-
class="hidden mt-1 text-sm cursor-text pb-2"
+
class="hidden mt-1 text-sm cursor-text pb-2 dark:text-gray-300"
>
{{ nl2br (unwrapText (index $messageParts 1)) }}
</p>
···
</div>
</div>
-
<div class="text-sm text-gray-500 mt-3">
+
<div class="text-sm text-gray-500 dark:text-gray-400 mt-3">
<span class="font-mono">
<a
href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}"
-
class="text-gray-500 no-underline hover:underline"
+
class="text-gray-500 dark:text-gray-400 no-underline hover:underline"
>{{ slice .Hash.String 0 8 }}</a
>
</span>
···
{{ if $didOrHandle }}
<a
href="/{{ $didOrHandle }}"
-
class="text-gray-500 no-underline hover:underline"
+
class="text-gray-500 dark:text-gray-400 no-underline hover:underline"
>{{ $didOrHandle }}</a
>
{{ else }}
<a
href="mailto:{{ .Author.Email }}"
-
class="text-gray-500 no-underline hover:underline"
+
class="text-gray-500 dark:text-gray-400 no-underline hover:underline"
>{{ .Author.Name }}</a
>
{{ end }}
···
<div class="flex justify-end mt-4 gap-2">
{{ if gt .Page 1 }}
<a
-
class="btn flex items-center gap-2 no-underline hover:no-underline"
+
class="btn flex items-center gap-2 no-underline hover:no-underline dark:text-white dark:hover:bg-gray-700"
hx-boost="true"
onclick="window.location.href = window.location.pathname + '?page={{ sub .Page 1 }}'"
>
···
{{ if eq $commits_len 30 }}
<a
-
class="btn flex items-center gap-2 no-underline hover:no-underline"
+
class="btn flex items-center gap-2 no-underline hover:no-underline dark:text-white dark:hover:bg-gray-700"
hx-boost="true"
onclick="window.location.href = window.location.pathname + '?page={{ add .Page 1 }}'"
>
+13 -13
appview/pages/templates/repo/new.html
···
{{ define "content" }}
<div class="p-6">
-
<p class="text-xl font-bold">Create a new repository</p>
+
<p class="text-xl font-bold dark:text-white">Create a new repository</p>
</div>
-
<div class="p-6 bg-white drop-shadow-sm rounded">
+
<div class="p-6 bg-white dark:bg-gray-800 drop-shadow-sm rounded">
<form hx-post="/repo/new" class="space-y-12" hx-swap="none">
<div class="space-y-2">
-
<label for="name" class="-mb-1">Repository name</label>
+
<label for="name" class="-mb-1 dark:text-white">Repository name</label>
<input
type="text"
id="name"
name="name"
required
-
class="w-full max-w-md"
+
class="w-full max-w-md dark:bg-gray-700 dark:text-white dark:border-gray-600"
/>
-
<p class="text-sm text-gray-500">All repositories are publicly visible.</p>
+
<p class="text-sm text-gray-500 dark:text-gray-400">All repositories are publicly visible.</p>
-
<label for="branch">Default branch</label>
+
<label for="branch" class="dark:text-white">Default branch</label>
<input
type="text"
id="branch"
name="branch"
value="main"
required
-
class="w-full max-w-md"
+
class="w-full max-w-md dark:bg-gray-700 dark:text-white dark:border-gray-600"
/>
-
<label for="description">Description</label>
+
<label for="description" class="dark:text-white">Description</label>
<input
type="text"
id="description"
name="description"
-
class="w-full max-w-md"
+
class="w-full max-w-md dark:bg-gray-700 dark:text-white dark:border-gray-600"
/>
</div>
<fieldset class="space-y-3">
-
<legend>Select a knot</legend>
+
<legend class="dark:text-white">Select a knot</legend>
<div class="space-y-2">
<div class="flex flex-col">
{{ range .Knots }}
···
class="mr-2"
id="domain-{{ . }}"
/>
-
<span>{{ . }}</span>
+
<span class="dark:text-white">{{ . }}</span>
</div>
{{ else }}
-
<p>No knots available.</p>
+
<p class="dark:text-white">No knots available.</p>
{{ end }}
</div>
</div>
-
<p class="text-sm text-gray-500">A knot hosts repository data. <a href="/knots" class="underline">Learn how to register your own knot.</a></p>
+
<p class="text-sm text-gray-500 dark:text-gray-400">A knot hosts repository data. <a href="/knots" class="underline">Learn how to register your own knot.</a></p>
</fieldset>
<div class="space-y-2">
+14 -14
appview/pages/templates/repo/pulls/new.html
···
{{ define "title" }}new pull | {{ .RepoInfo.FullName }}{{ end }}
{{ define "repoContent" }}
-
<section class="prose">
+
<section class="prose dark:prose-invert">
<p>
This is v1 of the pull request flow. Paste your patch in the form below.
Here are the steps to get you started:
-
<ul class="list-decimal pl-10 space-y-2 text-gray-700">
+
<ul class="list-decimal pl-10 space-y-2 text-gray-700 dark:text-gray-300">
<li class="leading-relaxed">Clone this repository.</li>
<li class="leading-relaxed">Make your changes in your local repository.</li>
-
<li class="leading-relaxed">Grab the diff using <code class="bg-gray-100 px-1 py-0.5 rounded text-gray-800 font-mono text-sm">git diff</code>.</li>
+
<li class="leading-relaxed">Grab the diff using <code class="bg-gray-100 dark:bg-gray-700 px-1 py-0.5 rounded text-gray-800 dark:text-gray-200 font-mono text-sm">git diff</code>.</li>
<li class="leading-relaxed">Paste the diff output in the form below.</li>
</ul>
</p>
···
>
<div class="flex flex-col gap-4">
<div>
-
<label for="title">write a title</label>
-
<input type="text" name="title" id="title" class="w-full" />
+
<label for="title" class="dark:text-white">write a title</label>
+
<input type="text" name="title" id="title" class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600" />
-
<label for="targetBranch">select a target branch</label>
-
<p class="text-gray-500">
+
<label for="targetBranch" class="dark:text-white">select a target branch</label>
+
<p class="text-gray-500 dark:text-gray-400">
The branch you want to make your change against.
</p>
<select
name="targetBranch"
-
class="p-1 mb-2 border border-gray-200 bg-white"
+
class="p-1 mb-2 border border-gray-200 bg-white dark:bg-gray-700 dark:text-white dark:border-gray-600"
>
<option disabled selected>select a branch</option>
{{ range .Branches }}
···
</option>
{{ end }}
</select>
-
<label for="body">add a description</label>
+
<label for="body" class="dark:text-white">add a description</label>
<textarea
name="body"
id="body"
rows="6"
-
class="w-full resize-y"
+
class="w-full resize-y dark:bg-gray-700 dark:text-white dark:border-gray-600"
placeholder="Describe your change. Markdown is supported."
></textarea>
<div class="mt-4">
-
<label for="patch">paste your patch here</label>
+
<label for="patch" class="dark:text-white">paste your patch here</label>
<textarea
name="patch"
id="patch"
rows="10"
-
class="w-full resize-y font-mono"
+
class="w-full resize-y font-mono dark:bg-gray-700 dark:text-white dark:border-gray-600"
placeholder="Paste your git diff output here."
></textarea>
</div>
</div>
<div>
-
<button type="submit" class="btn">create</button>
+
<button type="submit" class="btn dark:bg-gray-600 dark:hover:bg-gray-500 dark:text-white">create</button>
</div>
</div>
-
<div id="pull" class="error"></div>
+
<div id="pull" class="error dark:text-red-300"></div>
</form>
{{ end }}
+6 -6
appview/pages/templates/repo/pulls/patch.html
···
{{ define "content" }}
{{ $stat := .Diff.Stat }}
-
<div class="rounded drop-shadow-sm bg-white py-4 px-6">
+
<div class="rounded drop-shadow-sm bg-white dark:bg-gray-800 py-4 px-6 dark:text-white">
<header class="pb-2">
<div class="flex gap-3 items-center mb-3">
<a href="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/" class="flex items-center gap-2 font-medium">
···
view raw
</a>
</div>
-
<div class="border-t border-gray-200 my-2"></div>
+
<div class="border-t border-gray-200 dark:border-gray-700 my-2"></div>
<h1 class="text-2xl mt-3">
{{ .Pull.Title }}
-
<span class="text-gray-500">#{{ .Pull.PullId }}</span>
+
<span class="text-gray-500 dark:text-gray-400">#{{ .Pull.PullId }}</span>
</h1>
</header>
···
{{ i $icon "w-4 h-4 mr-1.5 text-white" }}
<span class="text-white">{{ .Pull.State.String }}</span>
</div>
-
<span class="text-gray-500 text-sm">
+
<span class="text-gray-500 dark:text-gray-400 text-sm">
opened by
{{ $owner := index $.DidHandleMap .Pull.OwnerDid }}
<a href="/{{ $owner }}" class="no-underline hover:underline"
···
<time>{{ .Pull.Created | timeFmt }}</time>
<span class="select-none before:content-['\00B7']"></span>
<span>targeting branch
-
<span class="text-xs rounded bg-gray-100 text-black font-mono px-2 mx-1/2 inline-flex items-center">
+
<span class="text-xs rounded bg-gray-100 dark:bg-gray-700 text-black dark:text-white font-mono px-2 mx-1/2 inline-flex items-center">
{{ .Pull.TargetBranch }}
</span>
</span>
···
</div>
{{ if .Pull.Body }}
-
<article id="body" class="mt-2 prose">
+
<article id="body" class="mt-2 prose dark:prose-invert">
{{ .Pull.Body | markdown }}
</article>
{{ end }}
+34 -34
appview/pages/templates/repo/pulls/pull.html
···
{{ define "repoContent" }}
<header class="pb-4">
-
<h1 class="text-2xl">
+
<h1 class="text-2xl dark:text-white">
{{ .Pull.Title }}
-
<span class="text-gray-500">#{{ .Pull.PullId }}</span>
+
<span class="text-gray-500 dark:text-gray-400">#{{ .Pull.PullId }}</span>
</h1>
</header>
-
{{ $bgColor := "bg-gray-800" }}
+
{{ $bgColor := "bg-gray-800 dark:bg-gray-700" }}
{{ $icon := "ban" }}
{{ if .Pull.State.IsOpen }}
-
{{ $bgColor = "bg-green-600" }}
+
{{ $bgColor = "bg-green-600 dark:bg-green-700" }}
{{ $icon = "git-pull-request" }}
{{ else if .Pull.State.IsMerged }}
-
{{ $bgColor = "bg-purple-600" }}
+
{{ $bgColor = "bg-purple-600 dark:bg-purple-700" }}
{{ $icon = "git-merge" }}
{{ end }}
···
{{ i $icon "w-4 h-4 mr-1.5 text-white" }}
<span class="text-white">{{ .Pull.State.String }}</span>
</div>
-
<span class="text-gray-500 text-sm">
+
<span class="text-gray-500 dark:text-gray-400 text-sm">
opened by
{{ $owner := index $.DidHandleMap .Pull.OwnerDid }}
<a href="/{{ $owner }}" class="no-underline hover:underline"
···
<time>{{ .Pull.Created | timeFmt }}</time>
<span class="select-none before:content-['\00B7']"></span>
<span>targeting branch
-
<span class="text-xs rounded bg-gray-100 text-black font-mono px-2 mx-1/2 inline-flex items-center">
+
<span class="text-xs rounded bg-gray-100 dark:bg-gray-700 text-black dark:text-white font-mono px-2 mx-1/2 inline-flex items-center">
{{ .Pull.TargetBranch }}
</span>
</span>
···
</div>
{{ if .Pull.Body }}
-
<article id="body" class="mt-2 prose">
+
<article id="body" class="mt-2 prose dark:prose-invert">
{{ .Pull.Body | markdown }}
</article>
{{ end }}
···
<summary id="round-#{{ .RoundNumber }}" class="list-none cursor-pointer">
<div class="flex flex-wrap gap-2 items-center">
<!-- round number -->
-
<div class="rounded bg-white drop-shadow-sm px-3 py-2">
+
<div class="rounded bg-white dark:bg-gray-800 drop-shadow-sm px-3 py-2 dark:text-white">
#{{ .RoundNumber }}
</div>
<!-- round summary -->
-
<div class="rounded drop-shadow-sm bg-white p-2 text-gray-500">
+
<div class="rounded drop-shadow-sm bg-white dark:bg-gray-800 p-2 text-gray-500 dark:text-gray-400">
<span>
{{ $owner := index $.DidHandleMap $.Pull.OwnerDid }}
{{ $re := "re" }}
···
<span class="hidden md:inline">{{$re}}submitted</span>
by <a href="/{{ $owner }}">{{ $owner }}</a>
<span class="select-none before:content-['\00B7']"></span>
-
<a class="text-gray-500 hover:text-gray-500" href="#round-#{{ .RoundNumber }}"><time>{{ .Created | shortTimeFmt }}</time></a>
+
<a class="text-gray-500 dark:text-gray-400 hover:text-gray-500" href="#round-#{{ .RoundNumber }}"><time>{{ .Created | shortTimeFmt }}</time></a>
<span class="select-none before:content-['·']"></span>
{{ $s := "s" }}
{{ if eq (len .Comments) 1 }}
···
</summary>
<div class="md:pl-12 flex flex-col gap-2 mt-2 relative">
{{ range .Comments }}
-
<div id="comment-{{.ID}}" class="bg-white rounded drop-shadow-sm py-2 px-4 relative w-fit">
-
<div class="absolute left-8 -top-2 w-px h-2 bg-gray-300"></div>
-
<div class="text-sm text-gray-500">
+
<div id="comment-{{.ID}}" class="bg-white dark:bg-gray-800 rounded drop-shadow-sm py-2 px-4 relative w-fit">
+
<div class="absolute left-8 -top-2 w-px h-2 bg-gray-300 dark:bg-gray-600"></div>
+
<div class="text-sm text-gray-500 dark:text-gray-400">
{{ $owner := index $.DidHandleMap .OwnerDid }}
<a href="/{{$owner}}">{{$owner}}</a>
<span class="before:content-['·']"></span>
-
<a class="text-gray-500 hover:text-gray-500" href="#comment-{{.ID}}"><time>{{ .Created | shortTimeFmt }}</time></a>
+
<a class="text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-300" href="#comment-{{.ID}}"><time>{{ .Created | shortTimeFmt }}</time></a>
</div>
-
<div class="prose">
+
<div class="prose dark:prose-invert">
{{ .Body | markdown }}
</div>
</div>
···
{{ if $.LoggedInUser }}
{{ template "fragments/pullActions" (dict "LoggedInUser" $.LoggedInUser "Pull" $.Pull "RepoInfo" $.RepoInfo "RoundNumber" .RoundNumber "MergeCheck" $.MergeCheck) }}
{{ else }}
-
<div class="bg-white rounded drop-shadow-sm px-6 py-4 w-fit">
-
<div class="absolute left-8 -top-2 w-px h-2 bg-gray-300"></div>
+
<div class="bg-white dark:bg-gray-800 rounded drop-shadow-sm px-6 py-4 w-fit dark:text-white">
+
<div class="absolute left-8 -top-2 w-px h-2 bg-gray-300 dark:bg-gray-600"></div>
<a href="/login" class="underline">login</a> to join the discussion
</div>
{{ end }}
···
{{ define "mergeStatus" }}
{{ if .Pull.State.IsClosed }}
-
<div class="bg-gray-50 border border-black rounded drop-shadow-sm px-6 py-2 relative w-fit">
-
<div class="absolute left-8 -top-2 w-px h-2 bg-gray-300"></div>
-
<div class="flex items-center gap-2 text-black">
+
<div class="bg-gray-50 dark:bg-gray-700 border border-black dark:border-gray-500 rounded drop-shadow-sm px-6 py-2 relative w-fit">
+
<div class="absolute left-8 -top-2 w-px h-2 bg-gray-300 dark:bg-gray-600"></div>
+
<div class="flex items-center gap-2 text-black dark:text-white">
{{ i "ban" "w-4 h-4" }}
<span class="font-medium">closed without merging</span
>
</div>
</div>
{{ else if .Pull.State.IsMerged }}
-
<div class="bg-purple-50 border border-purple-500 rounded drop-shadow-sm px-6 py-2 relative w-fit">
-
<div class="absolute left-8 -top-2 w-px h-2 bg-gray-300"></div>
-
<div class="flex items-center gap-2 text-purple-500">
+
<div class="bg-purple-50 dark:bg-purple-900 border border-purple-500 rounded drop-shadow-sm px-6 py-2 relative w-fit">
+
<div class="absolute left-8 -top-2 w-px h-2 bg-gray-300 dark:bg-gray-600"></div>
+
<div class="flex items-center gap-2 text-purple-500 dark:text-purple-300">
{{ i "git-merge" "w-4 h-4" }}
<span class="font-medium">pull request successfully merged</span
>
</div>
</div>
{{ else if and .MergeCheck .MergeCheck.Error }}
-
<div class="bg-red-50 border border-red-500 rounded drop-shadow-sm px-6 py-2 relative w-fit">
-
<div class="absolute left-8 -top-2 w-px h-2 bg-gray-300"></div>
-
<div class="flex items-center gap-2 text-red-500">
+
<div class="bg-red-50 dark:bg-red-900 border border-red-500 rounded drop-shadow-sm px-6 py-2 relative w-fit">
+
<div class="absolute left-8 -top-2 w-px h-2 bg-gray-300 dark:bg-gray-600"></div>
+
<div class="flex items-center gap-2 text-red-500 dark:text-red-300">
{{ i "triangle-alert" "w-4 h-4" }}
<span class="font-medium">{{ .MergeCheck.Error }}</span>
</div>
</div>
{{ else if and .MergeCheck .MergeCheck.IsConflicted }}
-
<div class="bg-red-50 border border-red-500 rounded drop-shadow-sm px-6 py-2 relative w-fit">
-
<div class="absolute left-8 -top-2 w-px h-2 bg-gray-300"></div>
-
<div class="flex items-center gap-2 text-red-500">
+
<div class="bg-red-50 dark:bg-red-900 border border-red-500 rounded drop-shadow-sm px-6 py-2 relative w-fit">
+
<div class="absolute left-8 -top-2 w-px h-2 bg-gray-300 dark:bg-gray-600"></div>
+
<div class="flex items-center gap-2 text-red-500 dark:text-red-300">
{{ i "triangle-alert" "w-4 h-4" }}
<span class="font-medium">merge conflicts detected</span>
<ul class="text-sm space-y-1">
{{ range .MergeCheck.Conflicts }}
{{ if .Filename }}
<li class="flex items-center">
-
{{ i "file-warning" "w-3 h-3 mr-1.5 text-red-500" }}
+
{{ i "file-warning" "w-3 h-3 mr-1.5 text-red-500 dark:text-red-300" }}
<span class="font-mono">{{ slice .Filename 0 (sub (len .Filename) 2) }}</span>
</li>
{{ end }}
···
</div>
</div>
{{ else if .MergeCheck }}
-
<div class="bg-green-50 border border-green-500 rounded drop-shadow-sm px-6 py-2 relative w-fit">
-
<div class="absolute left-8 -top-2 w-px h-2 bg-gray-300"></div>
-
<div class="flex items-center gap-2 text-green-500">
+
<div class="bg-green-50 dark:bg-green-900 border border-green-500 rounded drop-shadow-sm px-6 py-2 relative w-fit">
+
<div class="absolute left-8 -top-2 w-px h-2 bg-gray-300 dark:bg-gray-600"></div>
+
<div class="flex items-center gap-2 text-green-500 dark:text-green-300">
{{ i "circle-check-big" "w-4 h-4" }}
<span class="font-medium">no conflicts, ready to merge</span>
</div>
+12 -12
appview/pages/templates/repo/pulls/pulls.html
···
{{ define "repoContent" }}
<div class="flex justify-between items-center">
-
<p>
+
<p class="dark:text-white">
filtering
<select
-
class="border px-1 bg-white border-gray-200"
+
class="border px-1 bg-white dark:bg-gray-700 border-gray-200 dark:border-gray-600 dark:text-white"
onchange="window.location.href = '/{{ .RepoInfo.FullName }}/pulls?state=' + this.value"
>
<option value="open" {{ if .FilteringBy.IsOpen }}selected{{ end }}>
···
</p>
<a
href="/{{ .RepoInfo.FullName }}/pulls/new"
-
class="btn text-sm flex items-center gap-2 no-underline hover:no-underline"
+
class="btn text-sm flex items-center gap-2 no-underline hover:no-underline dark:text-white dark:bg-gray-700 dark:hover:bg-gray-600"
>
{{ i "git-pull-request" "w-4 h-4" }}
<span>new pull request</span>
···
{{ define "repoAfter" }}
<div class="flex flex-col gap-2 mt-2">
{{ range .Pulls }}
-
<div class="rounded drop-shadow-sm bg-white px-6 py-4">
+
<div class="rounded drop-shadow-sm bg-white dark:bg-gray-800 px-6 py-4">
<div class="pb-2">
-
<a href="/{{ $.RepoInfo.FullName }}/pulls/{{ .PullId }}">
+
<a href="/{{ $.RepoInfo.FullName }}/pulls/{{ .PullId }}" class="dark:text-white">
{{ .Title }}
-
<span class="text-gray-500">#{{ .PullId }}</span>
+
<span class="text-gray-500 dark:text-gray-400">#{{ .PullId }}</span>
</a>
</div>
-
<p class="text-sm text-gray-500">
-
{{ $bgColor := "bg-gray-800" }}
+
<p class="text-sm text-gray-500 dark:text-gray-400">
+
{{ $bgColor := "bg-gray-800 dark:bg-gray-700" }}
{{ $icon := "ban" }}
{{ if .State.IsOpen }}
-
{{ $bgColor = "bg-green-600" }}
+
{{ $bgColor = "bg-green-600 dark:bg-green-700" }}
{{ $icon = "git-pull-request" }}
{{ else if .State.IsMerged }}
-
{{ $bgColor = "bg-purple-600" }}
+
{{ $bgColor = "bg-purple-600 dark:bg-purple-700" }}
{{ $icon = "git-merge" }}
{{ end }}
···
<span>
{{ $owner := index $.DidHandleMap .OwnerDid }}
-
<a href="/{{ $owner }}">{{ $owner }}</a>
+
<a href="/{{ $owner }}" class="dark:text-gray-300">{{ $owner }}</a>
</span>
<span class="before:content-['·']">
···
<span class="before:content-['·']">
targeting branch
-
<span class="text-xs rounded bg-gray-100 text-black font-mono px-2 mx-1/2 inline-flex items-center">
+
<span class="text-xs rounded bg-gray-100 dark:bg-gray-600 text-black dark:text-white font-mono px-2 mx-1/2 inline-flex items-center">
{{ .TargetBranch }}
</span>
</span>
+7 -7
appview/pages/templates/repo/settings.html
···
{{ define "title" }}settings &middot; {{ .RepoInfo.FullName }}{{ end }}
{{ define "repoContent" }}
-
<header class="font-bold text-sm mb-4 uppercase">Collaborators</header>
+
<header class="font-bold text-sm mb-4 uppercase dark:text-white">Collaborators</header>
<div id="collaborator-list" class="flex flex-col gap-2 mb-2">
{{ range .Collaborators }}
<div id="collaborator" class="mb-2">
<a
href="/{{ didOrHandle .Did .Handle }}"
-
class="no-underline hover:underline text-black"
+
class="no-underline hover:underline text-black dark:text-white"
>
{{ didOrHandle .Did .Handle }}
</a>
<div>
-
<span class="text-sm text-gray-500">
+
<span class="text-sm text-gray-500 dark:text-gray-400">
{{ .Role }}
</span>
</div>
···
</div>
{{ if .IsCollaboratorInviteAllowed }}
-
<h3>add collaborator</h3>
+
<h3 class="dark:text-white">add collaborator</h3>
<form hx-put="/{{ $.RepoInfo.FullName }}/settings/collaborator">
-
<label for="collaborator">did or handle:</label>
-
<input type="text" id="collaborator" name="collaborator" required />
-
<button class="btn my-2" type="text">add collaborator</button>
+
<label for="collaborator" class="dark:text-white">did or handle:</label>
+
<input type="text" id="collaborator" name="collaborator" required class="dark:bg-gray-700 dark:text-white" />
+
<button class="btn my-2 dark:text-white dark:hover:bg-gray-700" type="text">add collaborator</button>
</form>
{{ end }}
{{ end }}
+5 -5
appview/pages/templates/repo/tree.html
···
{{ $containerstyle := "py-1" }}
{{ $linkstyle := "no-underline hover:underline" }}
-
<div class="pb-2 mb-3 text-base border-b border-gray-200">
+
<div class="pb-2 mb-3 text-base border-b border-gray-200 dark:border-gray-500">
<div class="flex flex-col md:flex-row md:justify-between gap-2">
<div id="breadcrumbs" class="overflow-x-auto whitespace-nowrap">
{{ range .BreadCrumbs }}
-
<a href="{{ index . 1}}" class="text-bold text-gray-500 {{ $linkstyle }}">{{ index . 0 }}</a> /
+
<a href="{{ index . 1}}" class="text-bold text-gray-500 dark:text-gray-400 {{ $linkstyle }}">{{ index . 0 }}</a> /
{{ end }}
</div>
-
<div id="dir-info" class="text-gray-500 text-xs md:text-sm flex flex-wrap items-center gap-1 md:gap-0">
+
<div id="dir-info" class="text-gray-500 dark:text-gray-400 text-xs md:text-sm flex flex-wrap items-center gap-1 md:gap-0">
{{ $stats := .TreeStats }}
<span>at <a href="/{{ $.RepoInfo.FullName }}/tree/{{ $.Ref }}">{{ $.Ref }}</a></span>
···
{{ i "folder" "w-3 h-3 fill-current" }}{{ .Name }}
</div>
</a>
-
<time class="text-xs text-gray-500">{{ timeFmt .LastCommit.When }}</time>
+
<time class="text-xs text-gray-500 dark:text-gray-400">{{ timeFmt .LastCommit.When }}</time>
</div>
</div>
{{ end }}
···
{{ i "file" "w-3 h-3" }}{{ .Name }}
</div>
</a>
-
<time class="text-xs text-gray-500">{{ timeFmt .LastCommit.When }}</time>
+
<time class="text-xs text-gray-500 dark:text-gray-400">{{ timeFmt .LastCommit.When }}</time>
</div>
</div>
{{ end }}
+33 -33
appview/pages/templates/settings.html
···
{{ define "content" }}
<div class="p-6">
-
<p class="text-xl font-bold">Settings</p>
+
<p class="text-xl font-bold dark:text-white">Settings</p>
</div>
<div class="flex flex-col">
{{ block "profile" . }} {{ end }}
···
{{ end }}
{{ define "profile" }}
-
<h2 class="text-sm font-bold py-2 px-6 uppercase">profile</h2>
-
<section class="rounded bg-white drop-shadow-sm px-6 py-4 mb-6 w-full lg:w-fit">
-
<dl class="grid grid-cols-[auto_1fr] gap-x-4">
+
<h2 class="text-sm font-bold py-2 px-6 uppercase dark:text-gray-300">profile</h2>
+
<section class="rounded bg-white dark:bg-gray-800 drop-shadow-sm px-6 py-4 mb-6 w-full lg:w-fit">
+
<dl class="grid grid-cols-[auto_1fr] gap-x-4 dark:text-gray-200">
{{ if .LoggedInUser.Handle }}
<dt class="font-bold">handle</dt>
<dd>@{{ .LoggedInUser.Handle }}</dd>
···
{{ end }}
{{ define "keys" }}
-
<h2 class="text-sm font-bold py-2 px-6 uppercase">ssh keys</h2>
-
<section class="rounded bg-white drop-shadow-sm px-6 py-4 mb-6 w-full lg:w-fit">
-
<p class="mb-8">SSH public keys added here will be broadcasted to knots that you are a member of, <br> allowing you to push to repositories there.</p>
+
<h2 class="text-sm font-bold py-2 px-6 uppercase dark:text-gray-300">ssh keys</h2>
+
<section class="rounded bg-white dark:bg-gray-800 drop-shadow-sm px-6 py-4 mb-6 w-full lg:w-fit">
+
<p class="mb-8 dark:text-gray-300">SSH public keys added here will be broadcasted to knots that you are a member of, <br> allowing you to push to repositories there.</p>
<div id="key-list" class="flex flex-col gap-6 mb-8">
{{ range $index, $key := .PubKeys }}
<div class="grid grid-cols-[minmax(0,1fr)_auto] items-center gap-4">
<div class="flex flex-col gap-1">
<div class="inline-flex items-center gap-4">
-
{{ i "key" "w-3 h-3" }}
-
<p class="font-bold">{{ .Name }}</p>
+
{{ i "key" "w-3 h-3 dark:text-gray-300" }}
+
<p class="font-bold dark:text-white">{{ .Name }}</p>
</div>
-
<p class="text-sm text-gray-500">added {{ .Created | timeFmt }}</p>
+
<p class="text-sm text-gray-500 dark:text-gray-400">added {{ .Created | timeFmt }}</p>
<div class="overflow-x-auto whitespace-nowrap flex-1 max-w-full">
-
<code class="text-sm text-gray-500">{{ .Key }}</code>
+
<code class="text-sm text-gray-500 dark:text-gray-400">{{ .Key }}</code>
</div>
</div>
<button
-
class="btn text-red-500 hover:text-red-700"
+
class="btn text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 gap-2"
title="Delete key"
hx-delete="/settings/keys?name={{urlquery .Name}}&rkey={{urlquery .Rkey}}&key={{urlquery .Key}}"
hx-confirm="Are you sure you want to delete the key '{{ .Name }}'?">
···
name="name"
placeholder="key name"
required
-
class="w-full"/>
+
class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:placeholder-gray-400"/>
<input
id="key"
name="key"
placeholder="ssh-rsa AAAAAA..."
required
-
class="w-full"/>
+
class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:placeholder-gray-400"/>
-
<button class="btn" type="submit">add key</button>
+
<button class="btn dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600" type="submit">add key</button>
-
<div id="settings-keys" class="error"></div>
+
<div id="settings-keys" class="error dark:text-red-400"></div>
</form>
</section>
{{ end }}
{{ define "emails" }}
-
<h2 class="text-sm font-bold py-2 px-6 uppercase">email addresses</h2>
-
<section class="rounded bg-white drop-shadow-sm px-6 py-4 mb-6 w-full lg:w-fit">
-
<p class="mb-8">Commits authored using emails listed here will be associated with your Tangled profile.</p>
+
<h2 class="text-sm font-bold py-2 px-6 uppercase dark:text-gray-300">email addresses</h2>
+
<section class="rounded bg-white dark:bg-gray-800 drop-shadow-sm px-6 py-4 mb-6 w-full lg:w-fit">
+
<p class="mb-8 dark:text-gray-300">Commits authored using emails listed here will be associated with your Tangled profile.</p>
<div id="email-list" class="flex flex-col gap-6 mb-8">
{{ range $index, $email := .Emails }}
<div class="grid grid-cols-[minmax(0,1fr)_auto] items-center gap-4">
<div class="flex flex-col gap-2">
<div class="inline-flex items-center gap-4">
-
{{ i "mail" "w-3 h-3" }}
-
<p class="font-bold">{{ .Address }}</p>
+
{{ i "mail" "w-3 h-3 dark:text-gray-300" }}
+
<p class="font-bold dark:text-white">{{ .Address }}</p>
<div class="inline-flex items-center gap-1">
{{ if .Verified }}
-
<span class="text-xs bg-green-100 text-green-800 px-2 py-1 rounded">verified</span>
+
<span class="text-xs bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200 px-2 py-1 rounded">verified</span>
{{ else }}
-
<span class="text-xs bg-yellow-100 text-yellow-800 px-2 py-1 rounded">unverified</span>
+
<span class="text-xs bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200 px-2 py-1 rounded">unverified</span>
{{ end }}
{{ if .Primary }}
-
<span class="text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded">primary</span>
+
<span class="text-xs bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200 px-2 py-1 rounded">primary</span>
{{ end }}
</div>
</div>
-
<p class="text-sm text-gray-500">added {{ .CreatedAt | timeFmt }}</p>
+
<p class="text-sm text-gray-500 dark:text-gray-400">added {{ .CreatedAt | timeFmt }}</p>
</div>
<div class="flex gap-2 items-center">
{{ if not .Verified }}
<button
-
class="btn flex gap-2"
+
class="btn flex gap-2 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600"
hx-post="/settings/emails/verify/resend"
hx-swap="none"
href="#"
···
{{ end }}
{{ if and (not .Primary) .Verified }}
<a
-
class="text-sm"
+
class="text-sm dark:text-blue-400 dark:hover:text-blue-300"
hx-post="/settings/emails/primary"
hx-swap="none"
href="#"
···
<form hx-delete="/settings/emails" hx-confirm="Are you sure you wish to delete the email '{{ .Address }}'?">
<input type="hidden" name="email" value="{{ .Address }}">
<button
-
class="btn text-red-500 hover:text-red-700"
+
class="btn text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300"
title="Delete email"
type="submit">
{{ i "trash-2" "w-5 h-5" }}
···
name="email"
placeholder="your@email.com"
required
-
class="w-full"/>
+
class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:placeholder-gray-400"/>
-
<button class="btn" type="submit">add email</button>
+
<button class="btn dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600" type="submit">add email</button>
-
<div id="settings-emails-error" class="error"></div>
-
<div id="settings-emails-success" class="success"></div>
+
<div id="settings-emails-error" class="error dark:text-red-400"></div>
+
<div id="settings-emails-success" class="success dark:text-green-400"></div>
</form>
</section>
-
{{ end }}
+
{{ end }}
+11 -12
appview/pages/templates/timeline.html
···
{{ end }}
{{ define "hero" }}
-
<div class="flex flex-col items-center justify-center text-center rounded drop-shadow bg-white text-black py-4 px-10">
+
<div class="flex flex-col items-center justify-center text-center rounded drop-shadow bg-white dark:bg-gray-800 text-black dark:text-white py-4 px-10">
<div class="font-bold italic text-4xl mb-4">
tangled
</div>
<div class="italic text-lg">
tightly-knit social coding, <a href="/login" class="underline inline-flex gap-1 items-center">join now {{ i "arrow-right" "w-4 h-4" }}</a>
-
<p class="pt-5 px-10 text-sm text-gray-500">Join our IRC channel: <a href="https://web.libera.chat/#tangled"><code>#tangled</code> on Libera Chat</a>.
+
<p class="pt-5 px-10 text-sm text-gray-500 dark:text-gray-400">Join our IRC channel: <a href="https://web.libera.chat/#tangled"><code>#tangled</code> on Libera Chat</a>.
Read an introduction to Tangled <a href="https://blog.tangled.sh/intro">here</a>.</p>
</div>
</div>
···
{{ define "timeline" }}
<div>
<div class="p-6">
-
<p class="text-xl font-bold">Timeline</p>
+
<p class="text-xl font-bold dark:text-white">Timeline</p>
</div>
<div class="flex flex-col gap-3 relative">
-
<div class="absolute left-8 top-0 bottom-0 w-px bg-gray-300"></div>
+
<div class="absolute left-8 top-0 bottom-0 w-px bg-gray-300 dark:bg-gray-600"></div>
{{ range .Timeline }}
-
<div class="px-6 py-2 bg-white rounded drop-shadow-sm w-fit">
+
<div class="px-6 py-2 bg-white dark:bg-gray-800 rounded drop-shadow-sm w-fit">
{{ if .Repo }}
{{ $userHandle := index $.DidHandleMap .Repo.Did }}
<div class="flex items-center">
-
<p class="text-gray-600">
+
<p class="text-gray-600 dark:text-gray-300">
<a href="/{{ $userHandle }}" class="no-underline hover:underline">{{ $userHandle | truncateAt30 }}</a>
created
<a href="/{{ $userHandle }}/{{ .Repo.Name }}" class="no-underline hover:underline">{{ .Repo.Name }}</a>
-
<time class="text-gray-700 text-xs">{{ .Repo.Created | timeFmt }}</time>
+
<time class="text-gray-700 dark:text-gray-400 text-xs">{{ .Repo.Created | timeFmt }}</time>
</p>
</div>
{{ else if .Follow }}
{{ $userHandle := index $.DidHandleMap .Follow.UserDid }}
{{ $subjectHandle := index $.DidHandleMap .Follow.SubjectDid }}
<div class="flex items-center">
-
<p class="text-gray-600">
+
<p class="text-gray-600 dark:text-gray-300">
<a href="/{{ $userHandle }}" class="no-underline hover:underline">{{ $userHandle | truncateAt30 }}</a>
followed
<a href="/{{ $subjectHandle }}" class="no-underline hover:underline">{{ $subjectHandle | truncateAt30 }}</a>
-
<time class="text-gray-700 text-xs">{{ .Follow.FollowedAt | timeFmt }}</time>
+
<time class="text-gray-700 dark:text-gray-400 text-xs">{{ .Follow.FollowedAt | timeFmt }}</time>
</p>
</div>
{{ else if .Star }}
{{ $starrerHandle := index $.DidHandleMap .Star.StarredByDid }}
{{ $repoOwnerHandle := index $.DidHandleMap .Star.Repo.Did }}
<div class="flex items-center">
-
<p class="text-gray-600">
+
<p class="text-gray-600 dark:text-gray-300">
<a href="/{{ $starrerHandle }}" class="no-underline hover:underline">{{ $starrerHandle | truncateAt30 }}</a>
starred
<a href="/{{ $repoOwnerHandle }}/{{ .Star.Repo.Name }}" class="no-underline hover:underline">{{ $repoOwnerHandle | truncateAt30 }}/{{ .Star.Repo.Name }}</a>
-
<time class="text-gray-700 text-xs">{{ .Star.Created | timeFmt }}</time>
+
<time class="text-gray-700 dark:text-gray-400 text-xs">{{ .Star.Created | timeFmt }}</time>
</p>
</div>
{{ end }}
···
</div>
</div>
{{ end }}
-
+3 -3
appview/pages/templates/user/login.html
···
{{ define "user/login" }}
<!doctype html>
-
<html lang="en">
+
<html lang="en" class="dark:bg-gray-900">
<head>
<meta charset="UTF-8" />
<meta
···
</head>
<body class="flex items-center justify-center min-h-screen">
<main class="max-w-64">
-
<h1 class="text-center text-2xl font-semibold italic">
+
<h1 class="text-center text-2xl font-semibold italic dark:text-white">
tangled
</h1>
-
<h2 class="text-center text-xl italic">
+
<h2 class="text-center text-xl italic dark:text-white">
tightly-knit social coding.
</h2>
<form
+13 -13
appview/pages/templates/user/profile.html
···
{{ end }}
{{ define "profileCard" }}
-
<div class="bg-white px-6 py-4 rounded drop-shadow-sm max-h-fit">
+
<div class="bg-white dark:bg-gray-800 px-6 py-4 rounded drop-shadow-sm max-h-fit">
<div class="flex justify-center items-center">
{{ if .AvatarUri }}
<img class="w-1/2 rounded-full p-2" src="{{ .AvatarUri }}" />
{{ end }}
</div>
-
<p class="text-xl font-bold text-center">
+
<p class="text-xl font-bold text-center dark:text-white">
{{ truncateAt30 (didOrHandle .UserDid .UserHandle) }}
</p>
-
<div class="text-sm text-center">
+
<div class="text-sm text-center dark:text-gray-300">
<span>{{ .ProfileStats.Followers }} followers</span>
<div
class="inline-block px-1 select-none after:content-['·']"
···
{{ end }}
{{ define "ownRepos" }}
-
<p class="text-sm font-bold py-2 px-6">REPOS</p>
+
<p class="text-sm font-bold py-2 px-6 dark:text-white">REPOS</p>
<div id="repos" class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">
{{ range .Repos }}
<div
id="repo-card"
-
class="py-4 px-6 drop-shadow-sm rounded bg-white"
+
class="py-4 px-6 drop-shadow-sm rounded bg-white dark:bg-gray-800"
>
-
<div id="repo-card-name" class="font-medium">
+
<div id="repo-card-name" class="font-medium dark:text-white">
<a href="/@{{ or $.UserHandle $.UserDid }}/{{ .Name }}"
>{{ .Name }}</a
>
</div>
{{ if .Description }}
-
<div class="text-gray-600 text-sm">
+
<div class="text-gray-600 dark:text-gray-300 text-sm">
{{ .Description }}
</div>
{{ end }}
···
</div>
</div>
{{ else }}
-
<p class="px-6">This user does not have any repos yet.</p>
+
<p class="px-6 dark:text-white">This user does not have any repos yet.</p>
{{ end }}
</div>
{{ end }}
{{ define "collaboratingRepos" }}
-
<p class="text-sm font-bold py-2 px-6">COLLABORATING ON</p>
+
<p class="text-sm font-bold py-2 px-6 dark:text-white">COLLABORATING ON</p>
<div id="collaborating" class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">
{{ range .CollaboratingRepos }}
<div
id="repo-card"
-
class="py-4 px-6 drop-shadow-sm rounded bg-white flex flex-col"
+
class="py-4 px-6 drop-shadow-sm rounded bg-white dark:bg-gray-800 flex flex-col"
>
-
<div id="repo-card-name" class="font-medium">
+
<div id="repo-card-name" class="font-medium dark:text-white">
<a href="/{{ index $.DidHandleMap .Did }}/{{ .Name }}">
{{ index $.DidHandleMap .Did }}/{{ .Name }}
</a>
</div>
{{ if .Description }}
-
<div class="text-gray-600 text-sm">
+
<div class="text-gray-600 dark:text-gray-300 text-sm">
{{ .Description }}
</div>
{{ end }}
···
</div>
</div>
{{ else }}
-
<p class="px-6">This user is not collaborating.</p>
+
<p class="px-6 dark:text-white">This user is not collaborating.</p>
{{ end }}
</div>
{{ end }}
+14 -11
input.css
···
"calt" 1,
"kern" 1;
}
-
::selection {
-
@apply bg-yellow-400;
-
@apply text-black;
-
@apply bg-opacity-30;
+
@apply bg-yellow-400 text-black bg-opacity-30 dark:bg-yellow-600 dark:bg-opacity-50 dark:text-white;
}
@layer base {
···
font-size: 14px;
}
a {
-
@apply no-underline text-black hover:underline hover:text-gray-800;
+
@apply no-underline text-black hover:underline hover:text-gray-800 dark:text-white dark:hover:text-gray-300;
}
label {
-
@apply block mb-2 text-gray-900 text-sm font-bold py-2 uppercase;
+
@apply block mb-2 text-gray-900 text-sm font-bold py-2 uppercase dark:text-gray-100;
}
input {
-
@apply bg-white border border-gray-400 rounded-sm focus:ring-black p-3;
+
@apply bg-white border border-gray-400 rounded-sm focus:ring-black p-3 dark:bg-gray-800 dark:border-gray-600 dark:text-white dark:focus:ring-gray-400;
}
textarea {
-
@apply bg-white border border-gray-400 rounded-sm focus:ring-black p-3;
+
@apply bg-white border border-gray-400 rounded-sm focus:ring-black p-3 dark:bg-gray-800 dark:border-gray-600 dark:text-white dark:focus:ring-gray-400;
}
details summary::-webkit-details-marker {
display: none;
···
focus-visible:before:outline-4 focus-visible:before:outline-gray-500
active:before:shadow-[inset_0_2px_2px_0_rgba(20,20,96,0.1)]
disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:before:border-gray-200
-
disabled:hover:before:bg-white disabled:hover:before:shadow-none;
+
disabled:hover:before:bg-white disabled:hover:before:shadow-none
+
dark:text-gray-100 dark:before:bg-gray-800 dark:before:border-gray-700
+
dark:hover:before:border-gray-600 dark:hover:before:bg-gray-700
+
dark:hover:before:shadow-[0_2px_2px_0_rgba(0,0,0,0.2),inset_0_-2px_0_0_#2d3748]
+
dark:focus-visible:before:outline-gray-400
+
dark:active:before:shadow-[inset_0_2px_2px_0_rgba(0,0,0,0.3)]
+
dark:disabled:hover:before:bg-gray-800 dark:disabled:hover:before:border-gray-700;
}
}
@layer utilities {
.error {
-
@apply py-1 text-red-400;
+
@apply py-1 text-red-400 dark:text-red-300;
}
.success {
-
@apply py-1 text-gray-900;
+
@apply py-1 text-gray-900 dark:text-gray-100;
}
}
}