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