summaryrefslogtreecommitdiffstats
path: root/templates/user/dashboard
diff options
context:
space:
mode:
Diffstat (limited to 'templates/user/dashboard')
-rw-r--r--templates/user/dashboard/dashboard.tmpl13
-rw-r--r--templates/user/dashboard/feeds.tmpl127
-rw-r--r--templates/user/dashboard/issues.tmpl91
-rw-r--r--templates/user/dashboard/milestones.tmpl154
-rw-r--r--templates/user/dashboard/navbar.tmpl102
-rw-r--r--templates/user/dashboard/repolist.tmpl55
6 files changed, 542 insertions, 0 deletions
diff --git a/templates/user/dashboard/dashboard.tmpl b/templates/user/dashboard/dashboard.tmpl
new file mode 100644
index 00000000..5dc46dc0
--- /dev/null
+++ b/templates/user/dashboard/dashboard.tmpl
@@ -0,0 +1,13 @@
+{{template "base/head" .}}
+<div role="main" aria-label="{{.Title}}" class="page-content dashboard feeds">
+ {{template "user/dashboard/navbar" .}}
+ <div class="ui container flex-container">
+ <div class="flex-container-main">
+ {{template "base/alert" .}}
+ {{template "user/heatmap" .}}
+ {{template "user/dashboard/feeds" .}}
+ </div>
+ {{template "user/dashboard/repolist" .}}
+ </div>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl
new file mode 100644
index 00000000..60aa1945
--- /dev/null
+++ b/templates/user/dashboard/feeds.tmpl
@@ -0,0 +1,127 @@
+<div id="activity-feed" class="flex-list">
+ {{range .Feeds}}
+ <div class="flex-item">
+ <div class="flex-item-leading">
+ {{ctx.AvatarUtils.AvatarByAction .}}
+ </div>
+ <div class="flex-item-main tw-gap-2">
+ <div>
+ {{if gt .ActUser.ID 0}}
+ <a href="{{AppSubUrl}}/{{(.GetActUserName ctx) | PathEscape}}" title="{{.GetActDisplayNameTitle ctx}}">{{.GetActDisplayName ctx}}</a>
+ {{else}}
+ {{.ShortActUserName ctx}}
+ {{end}}
+ {{if .GetOpType.InActions "create_repo"}}
+ {{ctx.Locale.Tr "action.create_repo" (.GetRepoLink ctx) (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "rename_repo"}}
+ {{ctx.Locale.Tr "action.rename_repo" .GetContent (.GetRepoLink ctx) (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "commit_repo"}}
+ {{if .Content}}
+ {{ctx.Locale.Tr "action.commit_repo" (.GetRepoLink ctx) (.GetRefLink ctx) .GetBranch (.ShortRepoPath ctx)}}
+ {{else}}
+ {{ctx.Locale.Tr "action.create_branch" (.GetRepoLink ctx) (.GetRefLink ctx) .GetBranch (.ShortRepoPath ctx)}}
+ {{end}}
+ {{else if .GetOpType.InActions "create_issue"}}
+ {{$index := index .GetIssueInfos 0}}
+ {{ctx.Locale.Tr "action.create_issue" (printf "%s/issues/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "create_pull_request"}}
+ {{$index := index .GetIssueInfos 0}}
+ {{ctx.Locale.Tr "action.create_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "transfer_repo"}}
+ {{ctx.Locale.Tr "action.transfer_repo" .GetContent (.GetRepoLink ctx) (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "push_tag"}}
+ {{ctx.Locale.Tr "action.push_tag" (.GetRepoLink ctx) (.GetRefLink ctx) .GetTag (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "comment_issue"}}
+ {{$index := index .GetIssueInfos 0}}
+ {{ctx.Locale.Tr "action.comment_issue" (printf "%s/issues/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "merge_pull_request"}}
+ {{$index := index .GetIssueInfos 0}}
+ {{ctx.Locale.Tr "action.merge_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "close_issue"}}
+ {{$index := index .GetIssueInfos 0}}
+ {{ctx.Locale.Tr "action.close_issue" (printf "%s/issues/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "reopen_issue"}}
+ {{$index := index .GetIssueInfos 0}}
+ {{ctx.Locale.Tr "action.reopen_issue" (printf "%s/issues/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "close_pull_request"}}
+ {{$index := index .GetIssueInfos 0}}
+ {{ctx.Locale.Tr "action.close_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "reopen_pull_request"}}
+ {{$index := index .GetIssueInfos 0}}
+ {{ctx.Locale.Tr "action.reopen_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "delete_tag"}}
+ {{$index := index .GetIssueInfos 0}}
+ {{ctx.Locale.Tr "action.delete_tag" (.GetRepoLink ctx) .GetTag (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "delete_branch"}}
+ {{$index := index .GetIssueInfos 0}}
+ {{ctx.Locale.Tr "action.delete_branch" (.GetRepoLink ctx) .GetBranch (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "mirror_sync_push"}}
+ {{ctx.Locale.Tr "action.mirror_sync_push" (.GetRepoLink ctx) (.GetRefLink ctx) .GetBranch (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "mirror_sync_create"}}
+ {{ctx.Locale.Tr "action.mirror_sync_create" (.GetRepoLink ctx) (.GetRefLink ctx) .GetBranch (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "mirror_sync_delete"}}
+ {{ctx.Locale.Tr "action.mirror_sync_delete" (.GetRepoLink ctx) .GetBranch (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "approve_pull_request"}}
+ {{$index := index .GetIssueInfos 0}}
+ {{ctx.Locale.Tr "action.approve_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "reject_pull_request"}}
+ {{$index := index .GetIssueInfos 0}}
+ {{ctx.Locale.Tr "action.reject_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "comment_pull"}}
+ {{$index := index .GetIssueInfos 0}}
+ {{ctx.Locale.Tr "action.comment_pull" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
+ {{else if .GetOpType.InActions "publish_release"}}
+ {{$linkText := .Content | RenderEmoji $.Context}}
+ {{ctx.Locale.Tr "action.publish_release" (.GetRepoLink ctx) (printf "%s/releases/tag/%s" (.GetRepoLink ctx) .GetTag) (.ShortRepoPath ctx) $linkText}}
+ {{else if .GetOpType.InActions "review_dismissed"}}
+ {{$index := index .GetIssueInfos 0}}
+ {{$reviewer := index .GetIssueInfos 1}}
+ {{ctx.Locale.Tr "action.review_dismissed" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx) $reviewer}}
+ {{end}}
+ {{TimeSince .GetCreate ctx.Locale}}
+ </div>
+ {{if .GetOpType.InActions "commit_repo" "mirror_sync_push"}}
+ {{$push := ActionContent2Commits .}}
+ {{$repoLink := (.GetRepoLink ctx)}}
+ {{$repo := .Repo}}
+ <div class="tw-flex tw-flex-col tw-gap-1">
+ {{range $push.Commits}}
+ {{$commitLink := printf "%s/commit/%s" $repoLink .Sha1}}
+ <div class="flex-text-block">
+ <img class="ui avatar" src="{{$push.AvatarLink $.Context .AuthorEmail}}" title="{{.AuthorName}}" width="16" height="16">
+ <a class="ui sha label" href="{{$commitLink}}">{{ShortSha .Sha1}}</a>
+ <span class="text truncate">
+ {{RenderCommitMessage $.Context .Message ($repo.ComposeMetas ctx)}}
+ </span>
+ </div>
+ {{end}}
+ </div>
+ {{if and (gt $push.Len 1) $push.CompareURL}}
+ <a href="{{AppSubUrl}}/{{$push.CompareURL}}">{{ctx.Locale.Tr "action.compare_commits" $push.Len}} ยป</a>
+ {{end}}
+ {{else if .GetOpType.InActions "create_issue"}}
+ <span class="text truncate issue title">{{index .GetIssueInfos 1 | RenderEmoji $.Context | RenderCodeBlock}}</span>
+ {{else if .GetOpType.InActions "create_pull_request"}}
+ <span class="text truncate issue title">{{index .GetIssueInfos 1 | RenderEmoji $.Context | RenderCodeBlock}}</span>
+ {{else if .GetOpType.InActions "comment_issue" "approve_pull_request" "reject_pull_request" "comment_pull"}}
+ <a href="{{.GetCommentLink ctx}}" class="text truncate issue title">{{(.GetIssueTitle ctx) | RenderEmoji $.Context | RenderCodeBlock}}</a>
+ {{$comment := index .GetIssueInfos 1}}
+ {{if $comment}}
+ <div class="markup tw-text-14">{{RenderMarkdownToHtml ctx $comment}}</div>
+ {{end}}
+ {{else if .GetOpType.InActions "merge_pull_request"}}
+ <div class="flex-item-body text black">{{index .GetIssueInfos 1}}</div>
+ {{else if .GetOpType.InActions "close_issue" "reopen_issue" "close_pull_request" "reopen_pull_request"}}
+ <span class="text truncate issue title">{{(.GetIssueTitle ctx) | RenderEmoji $.Context | RenderCodeBlock}}</span>
+ {{else if .GetOpType.InActions "pull_review_dismissed"}}
+ <div class="flex-item-body text black">{{ctx.Locale.Tr "action.review_dismissed_reason"}}</div>
+ <div class="flex-item-body text black">{{index .GetIssueInfos 2 | RenderEmoji $.Context}}</div>
+ {{end}}
+ </div>
+ <div class="flex-item-trailing">
+ {{svg (printf "octicon-%s" (ActionIcon .GetOpType)) 32 "text grey tw-mr-1"}}
+ </div>
+ </div>
+ {{end}}
+ {{template "base/paginate" .}}
+</div>
diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl
new file mode 100644
index 00000000..05253629
--- /dev/null
+++ b/templates/user/dashboard/issues.tmpl
@@ -0,0 +1,91 @@
+{{template "base/head" .}}
+<div role="main" aria-label="{{.Title}}" class="page-content dashboard issues">
+ {{template "user/dashboard/navbar" .}}
+ <div class="ui container">
+ {{template "base/alert" .}}
+ <div class="list-header">
+ <div class="small-menu-items ui compact tiny menu list-header-toggle">
+ <a class="item{{if not .IsShowClosed}} active{{end}}" href="?type={{$.ViewType}}&sort={{$.SortType}}&state=open&labels={{.SelectLabels}}&q={{$.Keyword}}&fuzzy={{.IsFuzzy}}">
+ {{svg "octicon-issue-opened" 16 "tw-mr-2"}}
+ {{ctx.Locale.PrettyNumber .IssueStats.OpenCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
+ </a>
+ <a class="item{{if .IsShowClosed}} active{{end}}" href="?type={{$.ViewType}}&sort={{$.SortType}}&state=closed&labels={{.SelectLabels}}&q={{$.Keyword}}&fuzzy={{.IsFuzzy}}">
+ {{svg "octicon-issue-closed" 16 "tw-mr-2"}}
+ {{ctx.Locale.PrettyNumber .IssueStats.ClosedCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
+ </a>
+ </div>
+ <form class="list-header-search ui form ignore-dirty">
+ <div class="ui small search fluid action input">
+ <input type="hidden" name="type" value="{{$.ViewType}}">
+ <input type="hidden" name="sort" value="{{$.SortType}}">
+ <input type="hidden" name="state" value="{{$.State}}">
+ {{if .PageIsPulls}}
+ {{template "shared/search/combo_fuzzy" dict "Value" $.Keyword "IsFuzzy" $.IsFuzzy "Placeholder" (ctx.Locale.Tr "search.pull_kind") "Tooltip" (ctx.Locale.Tr "explore.go_to")}}
+ {{else}}
+ {{template "shared/search/combo_fuzzy" dict "Value" $.Keyword "IsFuzzy" $.IsFuzzy "Placeholder" (ctx.Locale.Tr "search.issue_kind") "Tooltip" (ctx.Locale.Tr "explore.go_to")}}
+ {{end}}
+ </div>
+ </form>
+ <div class="ui secondary menu tw-mt-0">
+ <!-- Label -->
+ {{if .PageIsOrgIssues}}
+ {{template "shared/label_filter" .}}
+ {{end}}
+ <!-- Type -->
+ <div class="list-header ui dropdown type jump item">
+ <span class="text tw-whitespace-nowrap">
+ {{ctx.Locale.Tr "repo.issues.filter_type"}}
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ </span>
+ <div class="ui menu">
+ <a class="{{if eq .ViewType "your_repositories"}}active{{end}} item" href="?type=your_repositories&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}&fuzzy={{.IsFuzzy}}">
+ <div class="ui circular mini label tw-ml-0">{{CountFmt .IssueStats.YourRepositoriesCount}}</div>
+ {{ctx.Locale.Tr "home.issues.in_your_repos"}}
+ </a>
+ <a class="{{if eq .ViewType "assigned"}}active{{end}} item" href="?type=assigned&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}&fuzzy={{.IsFuzzy}}">
+ <div class="ui circular mini label tw-ml-0">{{CountFmt .IssueStats.AssignCount}}</div>
+ {{ctx.Locale.Tr "repo.issues.filter_type.assigned_to_you"}}
+ </a>
+ <a class="{{if eq .ViewType "created_by"}}active{{end}} item" href="?type=created_by&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}&fuzzy={{.IsFuzzy}}">
+ <div class="ui circular mini label tw-ml-0">{{CountFmt .IssueStats.CreateCount}}</div>
+ {{ctx.Locale.Tr "repo.issues.filter_type.created_by_you"}}
+ </a>
+ {{if .PageIsPulls}}
+ <a class="{{if eq .ViewType "review_requested"}}active{{end}} item" href="?type=review_requested&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}&fuzzy={{.IsFuzzy}}">
+ <div class="ui circular mini label tw-ml-0">{{CountFmt .IssueStats.ReviewRequestedCount}}</div>
+ {{ctx.Locale.Tr "repo.issues.filter_type.review_requested"}}
+ </a>
+ <a class="{{if eq .ViewType "reviewed_by"}}active{{end}} item" href="?type=reviewed_by&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}&fuzzy={{.IsFuzzy}}">
+ <div class="ui circular mini label tw-ml-0">{{CountFmt .IssueStats.ReviewedCount}}</div>
+ {{ctx.Locale.Tr "repo.issues.filter_type.reviewed_by_you"}}
+ </a>
+ {{end}}
+ <a class="{{if eq .ViewType "mentioned"}}active{{end}} item" href="?type=mentioned&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}&fuzzy={{.IsFuzzy}}">
+ <div class="ui circular mini label tw-ml-0">{{CountFmt .IssueStats.MentionCount}}</div>
+ {{ctx.Locale.Tr "repo.issues.filter_type.mentioning_you"}}
+ </a>
+ </div>
+ </div>
+ <!-- Sort -->
+ <div class="list-header-sort ui dropdown type jump item">
+ <span class="text tw-whitespace-nowrap">
+ {{ctx.Locale.Tr "repo.issues.filter_sort"}}
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ </span>
+ <div class="menu">
+ <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="?type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&q={{$.Keyword}}&fuzzy={{.IsFuzzy}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
+ <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="?type={{$.ViewType}}&sort=leastupdate&state={{$.State}}&labels={{.SelectLabels}}&q={{$.Keyword}}&fuzzy={{.IsFuzzy}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
+ <a class="{{if or (eq .SortType "latest") (not .SortType)}}active {{end}}item" href="?type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&q={{$.Keyword}}&fuzzy={{.IsFuzzy}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a>
+ <a class="{{if eq .SortType "oldest"}}active {{end}}item" href="?type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&q={{$.Keyword}}&fuzzy={{.IsFuzzy}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
+ <a class="{{if eq .SortType "mostcomment"}}active {{end}}item" href="?type={{$.ViewType}}&sort=mostcomment&state={{$.State}}&labels={{.SelectLabels}}&q={{$.Keyword}}&fuzzy={{.IsFuzzy}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostcomment"}}</a>
+ <a class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="?type={{$.ViewType}}&sort=leastcomment&state={{$.State}}&labels={{.SelectLabels}}&q={{$.Keyword}}&fuzzy={{.IsFuzzy}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastcomment"}}</a>
+ <a class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="?type={{$.ViewType}}&sort=nearduedate&state={{$.State}}&labels={{.SelectLabels}}&q={{$.Keyword}}&fuzzy={{.IsFuzzy}}">{{ctx.Locale.Tr "repo.issues.filter_sort.nearduedate"}}</a>
+ <a class="{{if eq .SortType "farduedate"}}active {{end}}item" href="?type={{$.ViewType}}&sort=farduedate&state={{$.State}}&labels={{.SelectLabels}}&q={{$.Keyword}}&fuzzy={{.IsFuzzy}}">{{ctx.Locale.Tr "repo.issues.filter_sort.farduedate"}}</a>
+ </div>
+ </div>
+ </div>
+ </div>
+ {{template "shared/issuelist" dict "." . "listType" "dashboard"}}
+ </div>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/user/dashboard/milestones.tmpl b/templates/user/dashboard/milestones.tmpl
new file mode 100644
index 00000000..0f1e866a
--- /dev/null
+++ b/templates/user/dashboard/milestones.tmpl
@@ -0,0 +1,154 @@
+{{template "base/head" .}}
+<div role="main" aria-label="{{.Title}}" class="page-content dashboard issues repository milestones">
+ {{template "user/dashboard/navbar" .}}
+ <div class="ui container">
+ <div class="flex-container">
+ <div class="flex-container-nav">
+ <div class="ui secondary vertical filter menu tw-bg-transparent">
+ <div class="item">
+ {{ctx.Locale.Tr "home.issues.in_your_repos"}}
+ <strong>{{.Total}}</strong>
+ </div>
+ <div class="divider"></div>
+ {{range .Repos}}
+ {{with $Repo := .}}
+ <a class="{{range $.RepoIDs}}{{if eq . $Repo.ID}}active{{end}}{{end}} repo name item" href="?repos=[
+ {{- with $include := true -}}
+ {{- range $.RepoIDs -}}
+ {{- if eq . $Repo.ID -}}
+ {{$include = false}}
+ {{- else -}}
+ {{.}}%2C
+ {{- end -}}
+ {{- end -}}
+ {{- if eq $include true -}}
+ {{$Repo.ID}}%2C
+ {{- end -}}
+ {{- end -}}
+ ]&sort={{$.SortType}}&state={{$.State}}&q={{$.Keyword}}" title="{{.FullName}}">
+ <span class="text truncate">{{$Repo.FullName}}</span>
+ <div class="ui {{if $.IsShowClosed}}red{{else}}green{{end}} label">{{index $.Counts $Repo.ID}}</div>
+ </a>
+ {{end}}
+ {{end}}
+ </div>
+ </div>
+ <div class="flex-container-main content">
+ <div class="list-header">
+ <div class="small-menu-items ui compact tiny menu list-header-toggle">
+ <a class="item{{if not .IsShowClosed}} active{{end}}" href="?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=open&q={{$.Keyword}}">
+ {{svg "octicon-milestone" 16 "tw-mr-2"}}
+ {{ctx.Locale.PrettyNumber .MilestoneStats.OpenCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
+ </a>
+ <a class="item{{if .IsShowClosed}} active{{end}}" href="?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=closed&q={{$.Keyword}}">
+ {{svg "octicon-check" 16 "tw-mr-2"}}
+ {{ctx.Locale.PrettyNumber .MilestoneStats.ClosedCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
+ </a>
+ </div>
+ <form class="list-header-search ui form ignore-dirty">
+ <input type="hidden" name="type" value="{{$.ViewType}}">
+ <input type="hidden" name="repos" value="[{{range $.RepoIDs}}{{.}},{{end}}]">
+ <input type="hidden" name="sort" value="{{$.SortType}}">
+ <input type="hidden" name="state" value="{{$.State}}">
+ {{template "shared/search/combo" dict "Value" $.Keyword}}
+ </form>
+ <!-- Sort -->
+ <div class="list-header-sort ui dropdown type jump item">
+ <span class="text">
+ {{ctx.Locale.Tr "repo.issues.filter_sort"}}
+ </span>
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ <div class="menu">
+ <a class="{{if or (eq .SortType "closestduedate") (not .SortType)}}active {{end}}item" href="?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=closestduedate&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.earliest_due_data"}}</a>
+ <a class="{{if eq .SortType "furthestduedate"}}active {{end}}item" href="?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=furthestduedate&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.latest_due_date"}}</a>
+ <a class="{{if eq .SortType "leastcomplete"}}active {{end}}item" href="?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=leastcomplete&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.least_complete"}}</a>
+ <a class="{{if eq .SortType "mostcomplete"}}active {{end}}item" href="?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=mostcomplete&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.most_complete"}}</a>
+ <a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=mostissues&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.most_issues"}}</a>
+ <a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=leastissues&state={{$.State}}&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.least_issues"}}</a>
+ </div>
+ </div>
+ </div>
+ <div class="milestone-list">
+ {{range .Milestones}}
+ <li class="milestone-card">
+ <div class="milestone-header">
+ <h3 class="flex-text-block tw-m-0">
+ <span class="ui large label">
+ {{.Repo.FullName}}
+ </span>
+ {{svg "octicon-milestone" 16}}
+ <a class="muted" href="{{.Repo.Link}}/milestone/{{.ID}}">{{.Name}}</a>
+ </h3>
+ <div class="tw-flex tw-items-center">
+ <span class="tw-mr-2">{{.Completeness}}%</span>
+ <progress value="{{.Completeness}}" max="100"></progress>
+ </div>
+ </div>
+ <div class="milestone-toolbar">
+ <div class="group">
+ <div class="flex-text-block">
+ {{svg "octicon-issue-opened" 14}}
+ {{ctx.Locale.PrettyNumber .NumOpenIssues}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
+ </div>
+ <div class="flex-text-block">
+ {{svg "octicon-check" 14}}
+ {{ctx.Locale.PrettyNumber .NumClosedIssues}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
+ </div>
+ {{if .TotalTrackedTime}}
+ <div class="flex-text-block">
+ {{svg "octicon-clock"}}
+ {{.TotalTrackedTime|Sec2Time}}
+ </div>
+ {{end}}
+ {{if .UpdatedUnix}}
+ <div class="flex-text-block">
+ {{svg "octicon-clock"}}
+ {{ctx.Locale.Tr "repo.milestones.update_ago" (TimeSinceUnix .UpdatedUnix ctx.Locale)}}
+ </div>
+ {{end}}
+ <div class="flex-text-block">
+ {{if .IsClosed}}
+ {{$closedDate:= TimeSinceUnix .ClosedDateUnix ctx.Locale}}
+ {{svg "octicon-clock" 14}}
+ {{ctx.Locale.Tr "repo.milestones.closed" $closedDate}}
+ {{else}}
+ {{if .DeadlineString}}
+ <span{{if .IsOverdue}} class="text red"{{end}}>
+ {{svg "octicon-calendar" 14}}
+ {{DateTime "short" .DeadlineString}}
+ </span>
+ {{else}}
+ {{svg "octicon-calendar" 14}}
+ {{ctx.Locale.Tr "repo.milestones.no_due_date"}}
+ {{end}}
+ {{end}}
+ </div>
+ </div>
+ {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
+ <div class="group">
+ <a class="flex-text-inline" href="{{$.Link}}/{{.ID}}/edit">{{svg "octicon-pencil" 14}}{{ctx.Locale.Tr "repo.issues.label_edit"}}</a>
+ {{if .IsClosed}}
+ <a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/open">{{svg "octicon-check" 14}}{{ctx.Locale.Tr "repo.milestones.open"}}</a>
+ {{else}}
+ <a class="link-action flex-text-inline" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-x" 14}}{{ctx.Locale.Tr "repo.milestones.close"}}</a>
+ {{end}}
+ <a class="delete-button flex-text-inline" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}">{{svg "octicon-trash" 14}}{{ctx.Locale.Tr "repo.issues.label_delete"}}</a>
+ </div>
+ {{end}}
+ </div>
+ {{if .Content}}
+ <div class="markup content">
+ {{.RenderedContent}}
+ </div>
+ {{end}}
+ </li>
+ {{end}}
+
+ {{template "base/paginate" .}}
+ </div>
+
+ </div>
+ </div>
+ </div>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/user/dashboard/navbar.tmpl b/templates/user/dashboard/navbar.tmpl
new file mode 100644
index 00000000..1fa356f9
--- /dev/null
+++ b/templates/user/dashboard/navbar.tmpl
@@ -0,0 +1,102 @@
+<div class="secondary-nav tw-border-b tw-border-b-secondary">
+ <div class="ui secondary stackable menu">
+ <div class="item">
+ <div class="ui floating dropdown jump">
+ <span class="text truncated-item-container">
+ {{ctx.AvatarUtils.Avatar .ContextUser}}
+ <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
+ <span class="org-visibility">
+ {{if .ContextUser.Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
+ {{if .ContextUser.Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
+ </span>
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ </span>
+ <div class="context user overflow menu">
+ <div class="ui header">
+ {{ctx.Locale.Tr "home.switch_dashboard_context"}}
+ </div>
+ <div class="scrolling menu items">
+ <a class="{{if eq .ContextUser.ID .SignedUser.ID}}active selected{{end}} item truncated-item-container" href="{{AppSubUrl}}/{{if .PageIsIssues}}issues{{else if .PageIsPulls}}pulls{{else if .PageIsMilestonesDashboard}}milestones{{end}}">
+ {{ctx.AvatarUtils.Avatar .SignedUser}}
+ <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
+ <span class="org-visibility">
+ {{if .SignedUser.Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
+ {{if .SignedUser.Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
+ </span>
+ </a>
+ {{range .Orgs}}
+ <a class="{{if eq $.ContextUser.ID .ID}}active selected{{end}} item truncated-item-container" title="{{.Name}}" href="{{.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}">
+ {{ctx.AvatarUtils.Avatar .}}
+ <span class="truncated-item-name">{{.ShortName 40}}</span>
+ <span class="org-visibility">
+ {{if .Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
+ {{if .Visibility.IsPrivate}}<div class="ui basic tiny horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
+ </span>
+ </a>
+ {{end}}
+ </div>
+ </div>
+ </div>
+ </div>
+ {{if .ContextUser.IsOrganization}}
+ <div class="item">
+ <div class="ui floating dropdown jump">
+ <span class="text">
+ {{svg "octicon-people" 18}}
+ {{if .Team}}
+ {{.Team.Name}}
+ {{else}}
+ {{ctx.Locale.Tr "org.teams"}}
+ {{end}}
+ </span>
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ <div class="context user overflow menu">
+ <div class="ui header">
+ {{ctx.Locale.Tr "home.filter_by_team_repositories"}}
+ </div>
+ <div class="scrolling menu items">
+ <a class="{{if not $.Team}}active selected{{end}} item" title="{{ctx.Locale.Tr "all"}}" href="{{$.Org.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}">
+ {{ctx.Locale.Tr "all"}}
+ </a>
+ {{range .Teams}}
+ {{if not .IncludesAllRepositories}}
+ <a class="{{if $.Team}}{{if eq $.Team.ID .ID}}active selected{{end}}{{end}} item" title="{{.Name}}" href="{{$.Org.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}/{{.Name}}">
+ {{.Name}}
+ </a>
+ {{end}}
+ {{end}}
+ </div>
+ </div>
+ </div>
+ </div>
+ {{end}}
+
+ {{if .ContextUser.IsOrganization}}
+ <div class="right menu">
+ <a class="{{if .PageIsNews}}active {{end}}item tw-ml-auto" href="{{.ContextUser.DashboardLink}}{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
+ {{svg "octicon-rss"}}&nbsp;{{ctx.Locale.Tr "activities"}}
+ </a>
+ {{if not .UnitIssuesGlobalDisabled}}
+ <a class="{{if .PageIsIssues}}active {{end}}item" href="{{.ContextUser.OrganisationLink}}/issues{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
+ {{svg "octicon-issue-opened"}}&nbsp;{{ctx.Locale.Tr "issues"}}
+ </a>
+ {{end}}
+ {{if not .UnitPullsGlobalDisabled}}
+ <a class="{{if .PageIsPulls}}active {{end}}item" href="{{.ContextUser.OrganisationLink}}/pulls{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
+ {{svg "octicon-git-pull-request"}}&nbsp;{{ctx.Locale.Tr "pull_requests"}}
+ </a>
+ {{end}}
+ {{if and .ShowMilestonesDashboardPage (not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled))}}
+ <a class="{{if .PageIsMilestonesDashboard}}active {{end}}item" href="{{.ContextUser.OrganisationLink}}/milestones{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
+ {{svg "octicon-milestone"}}&nbsp;{{ctx.Locale.Tr "milestones"}}
+ </a>
+ {{end}}
+ <div class="item">
+ <a class="ui basic button" href="{{.ContextUser.HomeLink}}" title="{{ctx.Locale.Tr "home.view_home" .ContextUser.Name}}">
+ {{ctx.Locale.Tr "home.view_home" (.ContextUser.ShortName 40)}}
+ </a>
+ </div>
+ </div>
+ {{end}}
+ </div>
+</div>
diff --git a/templates/user/dashboard/repolist.tmpl b/templates/user/dashboard/repolist.tmpl
new file mode 100644
index 00000000..2781f710
--- /dev/null
+++ b/templates/user/dashboard/repolist.tmpl
@@ -0,0 +1,55 @@
+<script type="module">
+const data = {
+ ...window.config.pageData.dashboardRepoList, // it only contains searchLimit and uid
+
+ isMirrorsEnabled: {{.MirrorsEnabled}},
+ isStarsEnabled: {{not .IsDisableStars}},
+
+ textMyRepos: {{ctx.Locale.Tr "home.my_repos"}},
+ textSearchRepos: {{ctx.Locale.Tr "search.repo_kind"}},
+ textFilter: {{ctx.Locale.Tr "home.filter"}},
+ textShowArchived: {{ctx.Locale.Tr "home.show_archived"}},
+ textShowPrivate: {{ctx.Locale.Tr "home.show_private"}},
+
+ textShowBothArchivedUnarchived: {{ctx.Locale.Tr "home.show_both_archived_unarchived"}},
+ textShowOnlyUnarchived: {{ctx.Locale.Tr "home.show_only_unarchived"}},
+ textShowOnlyArchived: {{ctx.Locale.Tr "home.show_only_archived"}},
+
+ textShowBothPrivatePublic: {{ctx.Locale.Tr "home.show_both_private_public"}},
+ textShowOnlyPublic: {{ctx.Locale.Tr "home.show_only_public"}},
+ textShowOnlyPrivate: {{ctx.Locale.Tr "home.show_only_private"}},
+
+ textAll: {{ctx.Locale.Tr "all"}},
+ textSources: {{ctx.Locale.Tr "sources"}},
+ textForks: {{ctx.Locale.Tr "forks"}},
+ textMirrors: {{ctx.Locale.Tr "mirrors"}},
+ textCollaborative: {{ctx.Locale.Tr "collaborative"}},
+
+ textFirstPage: {{ctx.Locale.Tr "admin.first_page"}},
+ textPreviousPage: {{ctx.Locale.Tr "repo.issues.previous"}},
+ textNextPage: {{ctx.Locale.Tr "repo.issues.next"}},
+ textLastPage: {{ctx.Locale.Tr "admin.last_page"}},
+
+ textMyOrgs: {{ctx.Locale.Tr "home.my_orgs"}},
+
+ textOrgVisibilityLimited: {{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}},
+ textOrgVisibilityPrivate: {{ctx.Locale.Tr "org.settings.visibility.private_shortname"}},
+};
+
+{{if .Team}}
+data.teamId = {{.Team.ID}};
+{{end}}
+
+{{if not .ContextUser.IsOrganization}}
+data.organizations = [{{range .Orgs}}{'name': {{.Name}}, 'num_repos': {{.NumRepos}}, 'org_visibility': {{.Visibility}}},{{end}}];
+data.isOrganization = false;
+data.organizationsTotalCount = {{.UserOrgsCount}};
+data.canCreateOrganization = {{.SignedUser.CanCreateOrganization}};
+{{else}}
+data.organizationId = {{.ContextUser.ID}};
+{{end}}
+
+window.config.pageData.dashboardRepoList = data;
+</script>
+
+<div id="dashboard-repo-list" class="flex-container-sidebar"></div>