forked from tangled.org/core
this repo has no description
at master 2.1 kB view raw
1{{ define "title" }}strings by {{ or .Card.UserHandle .Card.UserDid }}{{ end }} 2 3{{ define "extrameta" }} 4 <meta property="og:title" content="{{ or .Card.UserHandle .Card.UserDid }}" /> 5 <meta property="og:type" content="profile" /> 6 <meta property="og:url" content="https://tangled.sh/{{ or .Card.UserHandle .Card.UserDid }}" /> 7 <meta property="og:description" content="{{ or .Card.Profile.Description .Card.UserHandle .Card.UserDid }}" /> 8{{ end }} 9 10 11{{ define "content" }} 12<div class="grid grid-cols-1 md:grid-cols-11 gap-4"> 13 <div class="md:col-span-3 order-1 md:order-1"> 14 {{ template "user/fragments/profileCard" .Card }} 15 </div> 16 <div id="all-strings" class="md:col-span-8 order-2 md:order-2"> 17 {{ block "allStrings" . }}{{ end }} 18 </div> 19</div> 20{{ end }} 21 22{{ define "allStrings" }} 23 <p class="text-sm font-bold p-2 dark:text-white">ALL STRINGS</p> 24 <div id="strings" class="grid grid-cols-1 gap-4 mb-6"> 25 {{ range .Strings }} 26 {{ template "singleString" (list $ .) }} 27 {{ else }} 28 <p class="px-6 dark:text-white">This user does not have any strings yet.</p> 29 {{ end }} 30 </div> 31{{ end }} 32 33{{ define "singleString" }} 34 {{ $root := index . 0 }} 35 {{ $s := index . 1 }} 36 <div class="py-4 px-6 drop-shadow-sm rounded bg-white dark:bg-gray-800"> 37 <div class="font-medium dark:text-white flex gap-2 items-center"> 38 <a href="/strings/{{ or $root.Card.UserHandle $root.Card.UserDid }}/{{ $s.Rkey }}">{{ $s.Filename }}</a> 39 </div> 40 {{ with $s.Description }} 41 <div class="text-gray-600 dark:text-gray-300 text-sm"> 42 {{ . }} 43 </div> 44 {{ end }} 45 46 {{ $stat := $s.Stats }} 47 <div class="text-gray-400 pt-4 text-sm font-mono inline-flex gap-2 mt-auto"> 48 <span>{{ $stat.LineCount }} line{{if ne $stat.LineCount 1}}s{{end}}</span> 49 <span class="select-none [&:before]:content-['·']"></span> 50 {{ with $s.Edited }} 51 <span>edited {{ template "repo/fragments/shortTimeAgo" . }}</span> 52 {{ else }} 53 {{ template "repo/fragments/shortTimeAgo" $s.Created }} 54 {{ end }} 55 </div> 56 </div> 57{{ end }}