2
0
Files
gitcaddy-server/templates/user/profile.tmpl
logikonline 9e6d1d63de
All checks were successful
Build and Release / Create Release (push) Successful in 0s
Build and Release / Unit Tests (push) Successful in 3m10s
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 5m5s
Build and Release / Lint (push) Successful in 5m20s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Successful in 2m54s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Successful in 9h4m29s
Build and Release / Build Binaries (amd64, darwin, macos) (push) Successful in 8m14s
Build and Release / Build Binaries (arm64, darwin, macos) (push) Successful in 8m19s
Build and Release / Build Binary (linux/arm64) (push) Successful in 8m27s
feat(blog): add comments, reactions, and guest verification
Implements threaded comment system with support for authenticated users and verified guests. Adds email verification flow for guest commenters with token-based sessions and 6-digit codes. Includes reaction system (like/love/laugh/etc) for posts and comments. Adds comment count to blog posts, user profile blog tab, and email notifications for comment verification. Implements nested reply support with parent-child relationships.
2026-02-01 22:22:18 -05:00

161 lines
5.8 KiB
Handlebars

{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content user profile">
<div class="ui container">
<div class="ui stackable grid">
<div class="ui four wide column">
{{template "shared/user/profile_big_avatar" .}}
</div>
<div class="ui twelve wide column tw-mb-4">
{{template "user/overview/header" .}}
{{if eq .TabName "activity"}}
{{if .ContextUser.KeepActivityPrivate}}
<div class="ui info message">
<p>{{ctx.Locale.Tr "user.disabled_public_activity"}}</p>
</div>
{{end}}
{{template "user/heatmap" .}}
{{template "user/dashboard/feeds" .}}
{{else if eq .TabName "stars"}}
<div class="stars">
{{template "shared/repo/search" .}}
{{template "shared/repo/list" .}}
{{template "base/paginate" .}}
</div>
{{else if eq .TabName "following"}}
{{template "repo/user_cards" .}}
{{else if eq .TabName "followers"}}
{{template "repo/user_cards" .}}
{{else if eq .TabName "overview"}}
{{/* Activity Heatmap on Overview */}}
{{if and .ContextUser.ShowHeatmapOnProfile .HeatmapData}}
<div class="ui segment tw-mb-4">
<h4 class="ui header tw-flex tw-items-center">
{{svg "octicon-graph" 16}} {{ctx.Locale.Tr "user.activity_heatmap"}}
</h4>
{{template "user/heatmap" .}}
</div>
{{end}}
{{/* Pinned Repositories Section */}}
{{if or .UserPinnedRepos .IsContextUserProfile}}
<div class="ui segment pinned-repos-section tw-mb-4">
<h4 class="ui header tw-flex tw-items-center">
{{svg "octicon-pin" 16}} {{ctx.Locale.Tr "user.pinned_repos"}}
{{if .IsContextUserProfile}}
<span class="tw-ml-auto text grey tw-text-sm">{{ctx.Locale.Tr "user.pinned_repos_hint"}}</span>
{{end}}
</h4>
{{if .UserPinnedRepos}}
<div class="ui three stackable cards pinned-repos">
{{range .UserPinnedRepos}}
{{if .Repo}}
<a class="ui card" href="{{.Repo.Link}}">
<div class="content tw-text-center">
{{if .Repo.Avatar}}
<img class="tw-inline-block tw-rounded" style="max-width: 80px; max-height: 80px; object-fit: contain;" src="{{.Repo.RelAvatarLink ctx}}" alt="">
{{else}}
<div class="tw-inline-block tw-p-4">
{{if .Repo.IsPrivate}}{{svg "octicon-lock" 48}}{{else if .Repo.IsFork}}{{svg "octicon-repo-forked" 48}}{{else if .Repo.IsMirror}}{{svg "octicon-mirror" 48}}{{else}}{{svg "octicon-repo" 48}}{{end}}
</div>
{{end}}
<div class="header tw-mt-2">
{{if and .Repo.Owner (ne .Repo.OwnerID $.ContextUser.ID)}}
<span class="text grey">{{.Repo.Owner.Name}}/</span>
{{end}}
{{if .Repo.DisplayTitle}}{{.Repo.DisplayTitle}}{{else}}{{.Repo.Name}}{{end}}
</div>
{{if .Repo.Description}}
<div class="description text grey tw-text-sm tw-mt-1">{{.Repo.Description}}</div>
{{end}}
</div>
<div class="extra content">
{{if .Repo.PrimaryLanguage}}
<span class="tw-mr-2">
<span class="repo-language-color" style="background-color: {{.Repo.PrimaryLanguage.Color}}"></span>
{{.Repo.PrimaryLanguage.Language}}
</span>
{{end}}
{{if .Repo.NumStars}}
<span class="tw-mr-2">{{svg "octicon-star" 14}} {{.Repo.NumStars}}</span>
{{end}}
{{if .Repo.NumForks}}
<span>{{svg "octicon-repo-forked" 14}} {{.Repo.NumForks}}</span>
{{end}}
</div>
</a>
{{end}}
{{end}}
</div>
{{else if .IsContextUserProfile}}
<div class="ui placeholder segment tw-text-center">
<div class="ui icon header">
{{svg "octicon-pin" 32}}
<div class="content">
{{ctx.Locale.Tr "user.pinned_repos_empty_title"}}
<div class="sub header">
{{ctx.Locale.Tr "user.pinned_repos_empty_desc"}}
</div>
</div>
</div>
</div>
{{end}}
</div>
{{end}}
{{/* Profile README */}}
{{if .ProfileReadmeContent}}
<div id="readme_profile" class="render-content markup">{{.ProfileReadmeContent}}</div>
{{end}}
{{else if eq .TabName "blogs"}}
<div class="user-profile-blog-list">
{{range .BlogPosts}}
<div class="ui segment tw-flex tw-gap-4 tw-items-start">
{{if .FeaturedImage}}
<a href="{{.Repo.Link}}/blog/{{.ID}}" class="tw-shrink-0">
<img src="{{.FeaturedImage.DownloadURL}}" alt="{{.Title}}" loading="lazy" style="width: 120px; height: 80px; object-fit: cover; border-radius: 4px;">
</a>
{{end}}
<div class="tw-flex-1">
<a href="{{.Repo.Link}}/blog/{{.ID}}" class="tw-font-semibold tw-text-lg">{{.Title}}</a>
{{if .Subtitle}}
<p class="text grey tw-text-sm tw-mt-1">{{.Subtitle}}</p>
{{end}}
<div class="text grey tw-text-sm tw-mt-2 tw-flex tw-items-center tw-gap-2">
{{if .Repo}}
<a href="{{.Repo.Link}}" class="text grey">{{svg "octicon-repo" 14}} {{.Repo.FullName}}</a>
<span>&middot;</span>
{{end}}
{{if .PublishedUnix}}
<span>{{DateUtils.TimeSince .PublishedUnix}}</span>
{{else}}
<span>{{DateUtils.TimeSince .CreatedUnix}}</span>
{{end}}
</div>
{{if .Tags}}
<div class="tw-mt-2">
{{range (StringUtils.Split .Tags ",")}}
{{if .}}
<span class="ui small label">{{.}}</span>
{{end}}
{{end}}
</div>
{{end}}
</div>
</div>
{{end}}
{{template "base/paginate" .}}
</div>
{{else if eq .TabName "organizations"}}
{{template "repo/user_cards" .}}
{{else}}
{{template "shared/repo/search" .}}
{{template "shared/repo/list" .}}
{{template "base/paginate" .}}
{{end}}
</div>
</div>
</div>
</div>
{{template "base/footer" .}}