forked from tangled.org/core
tangled monorepo

appview: ui: signify forks with icon, adjust layout

non-forked repos show a book icon, forked repos show a fork icon

Signed-off-by: Samuel Newman <mozzius@protonmail.com>

Changed files
+11 -14
appview
pages
templates
layouts
user
fragments
+1 -1
appview/pages/templates/layouts/repobase.html
···
{{ if .RepoInfo.Source }}
<p class="text-sm">
<div class="flex items-center">
-
{{ i "git-fork" "w-3 h-3 mr-1"}}
forked from
{{ $sourceOwner := didOrHandle .RepoInfo.Source.Did .RepoInfo.SourceHandle }}
<a class="ml-1 underline" href="/{{ $sourceOwner }}/{{ .RepoInfo.Source.Name }}">{{ $sourceOwner }}/{{ .RepoInfo.Source.Name }}</a>
···
{{ if .RepoInfo.Source }}
<p class="text-sm">
<div class="flex items-center">
+
{{ i "git-fork" "w-3 h-3 mr-1 shrink-0" }}
forked from
{{ $sourceOwner := didOrHandle .RepoInfo.Source.Did .RepoInfo.SourceHandle }}
<a class="ml-1 underline" href="/{{ $sourceOwner }}/{{ .RepoInfo.Source.Name }}">{{ $sourceOwner }}/{{ .RepoInfo.Source.Name }}</a>
+10 -13
appview/pages/templates/user/fragments/repoCard.html
···
{{ $fullName := index . 2 }}
{{ with $repo }}
-
<div class="py-4 px-6 drop-shadow-sm rounded bg-white dark:bg-gray-800">
-
<div class="font-medium dark:text-white flex gap-2 items-center">
{{- if $fullName -}}
<a href="/{{ index $root.DidHandleMap .Did }}/{{ .Name }}"
>{{ index $root.DidHandleMap .Did }}/{{ .Name }}</a
···
>
{{- end -}}
</div>
-
{{ if .Source }}
-
<div class="flex items-center my-0.5 text-sm">
-
{{ i "git-fork" "w-3 h-3 mr-1" }}
-
fork
-
</div>
-
{{ end }}
{{ with .Description }}
<div class="text-gray-600 dark:text-gray-300 text-sm">
{{ . }}
···
{{ end }}
{{ define "repoStats" }}
-
<div class="text-gray-400 pt-4 text-sm font-mono inline-flex gap-4 mt-auto">
{{ with .Language }}
<div class="flex gap-2 items-center text-sm">
-
<div
-
class="size-2 rounded-full"
-
style="background: radial-gradient(circle at 35% 35%, color-mix(in srgb, {{ langColor . }} 70%, white), {{ langColor . }} 30%, color-mix(in srgb, {{ langColor . }} 85%, black));"
-
></div>
<span>{{ . }}</span>
</div>
{{ end }}
···
{{ $fullName := index . 2 }}
{{ with $repo }}
+
<div class="py-4 px-6 gap-2 flex flex-col drop-shadow-sm rounded bg-white dark:bg-gray-800">
+
<div class="font-medium dark:text-white flex items-center">
+
{{ if .Source }}
+
{{ i "git-fork" "w-4 h-4 mr-1.5 shrink-0" }}
+
{{ else }}
+
{{ i "book-marked" "w-4 h-4 mr-1.5 shrink-0" }}
+
{{ end }}
{{- if $fullName -}}
<a href="/{{ index $root.DidHandleMap .Did }}/{{ .Name }}"
>{{ index $root.DidHandleMap .Did }}/{{ .Name }}</a
···
>
{{- end -}}
</div>
{{ with .Description }}
<div class="text-gray-600 dark:text-gray-300 text-sm">
{{ . }}
···
{{ end }}
{{ define "repoStats" }}
+
<div class="text-gray-400 text-sm font-mono inline-flex gap-4 mt-auto">
{{ with .Language }}
<div class="flex gap-2 items-center text-sm">
+
<div class="size-2 rounded-full"
+
style="background: radial-gradient(circle at 35% 35%, color-mix(in srgb, {{ langColor . }} 70%, white), {{ langColor . }} 30%, color-mix(in srgb, {{ langColor . }} 85%, black));"></div>
<span>{{ . }}</span>
</div>
{{ end }}