From d76772adb9206961a4b47569dfd86366329972b0 Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Wed, 7 May 2014 21:01:00 +0800 Subject: [PATCH] add milestone list page --- cmd/web.go | 1 + public/css/gogs.css | 36 +++++++++++++++++++++-- routers/repo/issue.go | 8 +++++ templates/issue/milestone.tmpl | 54 ++++++++++++++++++++++++++++++++++ templates/repo/toolbar.tmpl | 6 ++-- 5 files changed, 101 insertions(+), 4 deletions(-) create mode 100644 templates/issue/milestone.tmpl diff --git a/cmd/web.go b/cmd/web.go index 7d914ca68f..897f6b955a 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -184,6 +184,7 @@ func runWeb(*cli.Context) { r.Get("/issues/new", repo.CreateIssue) r.Post("/issues/new", bindIgnErr(auth.CreateIssueForm{}), repo.CreateIssuePost) r.Post("/issues/:index", bindIgnErr(auth.CreateIssueForm{}), repo.UpdateIssue) + r.Get("/issues/milestones", repo.Milestones) r.Post("/comment/:action", repo.Comment) r.Get("/releases/new", repo.ReleasesNew) }, reqSignIn, middleware.RepoAssignment(true)) diff --git a/public/css/gogs.css b/public/css/gogs.css index 881860987d..e4dfda4c64 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -706,6 +706,16 @@ html, body { height: 39px; } +#repo-toolbar .nav .tmp { + padding: 0 6px; +} + +#repo-toolbar .nav .tmp a { + display: inline-block; + padding-left: 6px; + padding-right: 6px; +} + #repo-toolbar .nav .tmp a:hover { text-decoration: none; } @@ -1251,12 +1261,12 @@ html, body { border-color: #CCC; } -#issue .filter-list a:hover { +#issue .filter-list li a:hover { background-color: #DDD; text-decoration: none; } -#issue .filter-list a.active { +#issue .filter-list li a.active { background-color: #4183c4; color: #FFF; } @@ -1409,6 +1419,28 @@ html, body { margin: 0 .8em; } +#issue .milestone-item .actions { + margin-top: 10px; +} + +#issue .milestone-item .actions a { + margin-left: 8px; +} + +#issue .milestone-item hr { + width: 100%; + padding-top: 8px; + margin-top: 48px; + margin-bottom: 8px; +} + +#issue .milestone-item .label{ + margin-top: 8px; + float: left; + padding: .5em; + margin-left: .8em; +} + /* wrapper and footer */ #wrapper { diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 2bd2f33a1b..b726bea9e1 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -331,3 +331,11 @@ func Comment(ctx *middleware.Context, params martini.Params) { ctx.Redirect(fmt.Sprintf("%s/issues/%d", ctx.Repo.RepoLink, index)) } + +func Milestones(ctx *middleware.Context) { + ctx.Data["Title"] = "Milestones" + ctx.Data["IsRepoToolbarIssues"] = true + ctx.Data["IsRepoToolbarIssuesList"] = true + + ctx.HTML(200, "issue/milestone") +} diff --git a/templates/issue/milestone.tmpl b/templates/issue/milestone.tmpl new file mode 100644 index 0000000000..a688fb4cc5 --- /dev/null +++ b/templates/issue/milestone.tmpl @@ -0,0 +1,54 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +{{template "repo/nav" .}} +{{template "repo/toolbar" .}} +
+
+ +
+
+
+

Milestone Title

+ 12 + 2 +

+ Edit + Open + Close + Delete + Issues +

+
+

In this version of release, users are able to register and log in/out on Gogs, setting up SSH keys and do most of Git operations through SSH with public repositories. And Web UI only for view of Git data, no extra features are supported.

+
+
+

Milestone Title

+ 12 + 2 +

+ Edit + Open + Close + Delete + Issues +

+
+

In this version of release, users are able to register and log in/out on Gogs, setting up SSH keys and do most of Git operations through SSH with public repositories. And Web UI only for view of Git data, no extra features are supported.

+
+
+
+
+
+ +{{template "base/footer" .}} diff --git a/templates/repo/toolbar.tmpl b/templates/repo/toolbar.tmpl index a14aae9ca9..e2652ee829 100644 --- a/templates/repo/toolbar.tmpl +++ b/templates/repo/toolbar.tmpl @@ -10,8 +10,10 @@
  • {{if .Repository.NumOpenIssues}}{{.Repository.NumOpenIssues}} {{end}}Issues
  • {{if .IsRepoToolbarIssues}} -
  • {{if .IsRepoToolbarIssuesList}} - {{end}}
  • +
  • {{if .IsRepoToolbarIssuesList}} + + + {{end}}
  • {{end}}
  • {{if .Repository.NumTags}}{{.Repository.NumTags}} {{end}}Releases
  • {{if .IsRepoToolbarReleases}}{{if .IsRepositoryOwner}}{{if not .IsRepoReleaseNew}}