this repo has no description
1{{ define "user/fragments/profileCard" }} 2 {{ $userIdent := didOrHandle .UserDid .UserHandle }} 3 <div class="grid grid-cols-3 md:grid-cols-1 gap-1 items-center"> 4 <div id="avatar" class="col-span-1 flex justify-center items-center"> 5 <div class="w-3/4 aspect-square relative"> 6 <img class="absolute inset-0 w-full h-full object-cover rounded-full p-2" src="{{ fullAvatar .UserDid }}" /> 7 </div> 8 </div> 9 <div class="col-span-2"> 10 <div class="flex items-center flex-row flex-nowrap gap-2"> 11 <p title="{{ $userIdent }}" 12 class="text-lg font-bold dark:text-white overflow-hidden text-ellipsis whitespace-nowrap"> 13 {{ $userIdent }} 14 </p> 15 {{ with .Profile }} 16 {{ if .Pronouns }} 17 <p class="text-gray-500 dark:text-gray-400">{{ .Pronouns }}</p> 18 {{ end }} 19 {{ end }} 20 <a href="/{{ $userIdent }}/feed.atom">{{ i "rss" "size-4" }}</a> 21 </div> 22 23 <div class="md:hidden"> 24 {{ block "followerFollowing" (list . $userIdent) }} {{ end }} 25 </div> 26 </div> 27 <div class="col-span-3 md:col-span-full"> 28 <div id="profile-bio" class="text-sm"> 29 {{ $profile := .Profile }} 30 {{ with .Profile }} 31 32 {{ if .Description }} 33 <p class="text-base pb-4 md:pb-2">{{ .Description }}</p> 34 {{ end }} 35 36 <div class="hidden md:block"> 37 {{ block "followerFollowing" (list $ $userIdent) }} {{ end }} 38 </div> 39 40 <div class="flex flex-col gap-2 mb-2 overflow-hidden text-ellipsis whitespace-nowrap max-w-full"> 41 {{ if .Location }} 42 <div class="flex items-center gap-2"> 43 <span class="flex-shrink-0">{{ i "map-pin" "size-4" }}</span> 44 <span>{{ .Location }}</span> 45 </div> 46 {{ end }} 47 {{ if .IncludeBluesky }} 48 <div class="flex items-center gap-2"> 49 <span class="flex-shrink-0">{{ template "user/fragments/bluesky" "w-4 h-4 text-black dark:text-white" }}</span> 50 <a id="bluesky-link" href="https://bsky.app/profile/{{ $.UserDid }}">{{ $userIdent }}</a> 51 </div> 52 {{ end }} 53 {{ range $link := .Links }} 54 {{ if $link }} 55 <div class="flex items-center gap-2"> 56 <span class="flex-shrink-0">{{ i "link" "size-4" }}</span> 57 <a href="{{ $link }}">{{ $link }}</a> 58 </div> 59 {{ end }} 60 {{ end }} 61 {{ if not $profile.IsStatsEmpty }} 62 <div class="flex items-center justify-evenly gap-2 py-2"> 63 {{ range $stat := .Stats }} 64 {{ if $stat.Kind }} 65 <div class="flex flex-col items-center gap-2"> 66 <span class="text-xl font-bold">{{ $stat.Value }}</span> 67 <span>{{ $stat.Kind.String }}</span> 68 </div> 69 {{ end }} 70 {{ end }} 71 </div> 72 {{ end }} 73 </div> 74 {{ end }} 75 {{ if ne .FollowStatus.String "IsSelf" }} 76 {{ template "user/fragments/follow" . }} 77 {{ else }} 78 <button id="editBtn" 79 class="btn mt-2 w-full flex items-center gap-2 group" 80 hx-target="#profile-bio" 81 hx-get="/profile/edit-bio" 82 hx-swap="innerHTML"> 83 {{ i "pencil" "w-4 h-4" }} 84 edit 85 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 86 </button> 87 {{ end }} 88 </div> 89 <div id="update-profile" class="text-red-400 dark:text-red-500"></div> 90 </div> 91 </div> 92{{ end }} 93 94{{ define "followerFollowing" }} 95 {{ $root := index . 0 }} 96 {{ $userIdent := index . 1 }} 97 {{ with $root }} 98 <div class="flex items-center gap-2 my-2 overflow-hidden text-ellipsis whitespace-nowrap max-w-full text-sm"> 99 <span class="flex-shrink-0">{{ i "users" "size-4" }}</span> 100 <span id="followers"><a href="/{{ $userIdent }}?tab=followers">{{ .Stats.FollowersCount }} followers</a></span> 101 <span class="select-none after:content-['·']"></span> 102 <span id="following"><a href="/{{ $userIdent }}?tab=following">{{ .Stats.FollowingCount }} following</a></span> 103 </div> 104 {{ end }} 105{{ end }} 106