From f6b29012e09d5f7770a0b1ea8659da5172e155b3 Mon Sep 17 00:00:00 2001 From: Brad Albright <32200834+bhalbright@users.noreply.github.com> Date: Sun, 15 Dec 2019 08:20:08 -0600 Subject: Add /milestones endpoint (#8733) Create a /milestones endpoint which basically serves as a dashboard view for milestones, very similar to the /issues or /pulls page. Closes #8232 --- templates/base/head_navbar.tmpl | 1 + templates/user/dashboard/milestones.tmpl | 119 +++++++++++++++++++++++++++++++ templates/user/dashboard/navbar.tmpl | 9 ++- 3 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 templates/user/dashboard/milestones.tmpl (limited to 'templates') diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index fdba57d5bf..a09b4b832e 100644 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -12,6 +12,7 @@ {{.i18n.Tr "dashboard"}} {{.i18n.Tr "issues"}} {{.i18n.Tr "pull_requests"}} + {{if .ShowMilestonesDashboardPage}}{{.i18n.Tr "milestones"}}{{end}} {{.i18n.Tr "explore"}} {{else if .IsLandingPageHome}} {{.i18n.Tr "home"}} diff --git a/templates/user/dashboard/milestones.tmpl b/templates/user/dashboard/milestones.tmpl new file mode 100644 index 0000000000..495119f442 --- /dev/null +++ b/templates/user/dashboard/milestones.tmpl @@ -0,0 +1,119 @@ +{{template "base/head" .}} +
+ {{template "user/dashboard/navbar" .}} +
+
+ +
+ + + +
+ {{range .Milestones}} +
  • +
    {{if not $.RepoIDs}}{{.Repo.FullName}}{{end}}
    + {{.Name}} +
    +
    +
    +
    +
    +
    + {{ $closedDate:= TimeSinceUnix .ClosedDateUnix $.Lang }} + {{if .IsClosed}} + {{$.i18n.Tr "repo.milestones.closed" $closedDate|Str2html}} + {{else}} + + {{if .DeadlineString}} + {{.DeadlineString}} + {{else}} + {{$.i18n.Tr "repo.milestones.no_due_date"}} + {{end}} + {{end}} + + {{$.i18n.Tr "repo.milestones.open_tab" .NumOpenIssues}} + {{$.i18n.Tr "repo.milestones.close_tab" .NumClosedIssues}} + {{if .TotalTrackedTime}} {{.TotalTrackedTime|Sec2Time}}{{end}} + +
    + {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}} + + {{end}} + {{if .Content}} +
    + {{.RenderedContent|Str2html}} +
    + {{end}} +
  • + {{end}} + + {{template "base/paginate" .}} +
    + +
    +
    +
    +
    +{{template "base/footer" .}} diff --git a/templates/user/dashboard/navbar.tmpl b/templates/user/dashboard/navbar.tmpl index 25c45325a6..ed44c35377 100644 --- a/templates/user/dashboard/navbar.tmpl +++ b/templates/user/dashboard/navbar.tmpl @@ -12,12 +12,12 @@ {{.i18n.Tr "home.switch_dashboard_context"}}