diff options
-rw-r--r-- | cmd/web.go | 1 | ||||
-rwxr-xr-x | public/css/gogs.css | 36 | ||||
-rw-r--r-- | routers/repo/issue.go | 8 | ||||
-rw-r--r-- | templates/issue/milestone.tmpl | 54 | ||||
-rw-r--r-- | templates/repo/toolbar.tmpl | 6 |
5 files changed, 101 insertions, 4 deletions
@@ -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 88186098..e4dfda4c 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 2bd2f33a..b726bea9 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 00000000..a688fb4c --- /dev/null +++ b/templates/issue/milestone.tmpl @@ -0,0 +1,54 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +{{template "repo/nav" .}} +{{template "repo/toolbar" .}} +<div id="body" class="container"> + <div id="issue"> + <div class="col-md-3 filter-list"> + <ul class="list-unstyled"> + <li><a href="{{.RepoLink}}/issues/milestones" class="active">Open Milestones <strong class="pull-right">1</strong></a></li> + <!-- <li><a href="#">Assigned to you</a></li> --> + <li><a href="{{.RepoLink}}/issues/milestones">Close Milestones <strong class="pull-right">0</strong></a></li> + <!-- <li><a href="#">Mentioned</a></li> --> + </ul> + <hr/> + <a href="{{.RepoLink}}/issues/milestones/new" class="text-center"> + <button class="btn btn-default btn-block">Create new milestone</button> + </a> + </div> + <div class="col-md-9"> + <div class="milestones list-group"> + <div class="list-group-item milestone-item"> + <h4 class="title pull-left"><a href="#">Milestone Title</a></h4> + <span class="issue-open label label-success">12</span> + <span class="issue-close label label-warning">2</span> + <p class="actions pull-right"> + <a href="#">Edit</a> + <a href="#">Open</a> + <a href="#">Close</a> + <a class="text-danger" href="#">Delete</a> + <a href="#">Issues</a> + </p> + <hr/> + <p class="description">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.</p> + </div> + <div class="list-group-item milestone-item"> + <h4 class="title pull-left"><a href="#">Milestone Title</a></h4> + <span class="issue-open label label-success">12</span> + <span class="issue-close label label-warning">2</span> + <p class="actions pull-right"> + <a href="#">Edit</a> + <a href="#">Open</a> + <a href="#">Close</a> + <a class="text-danger" href="#">Delete</a> + <a href="#">Issues</a> + </p> + <hr/> + <p class="description">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.</p> + </div> + </div> + </div> + </div> +</div> +</div> +{{template "base/footer" .}} diff --git a/templates/repo/toolbar.tmpl b/templates/repo/toolbar.tmpl index a14aae9c..e2652ee8 100644 --- a/templates/repo/toolbar.tmpl +++ b/templates/repo/toolbar.tmpl @@ -10,8 +10,10 @@ <!-- <li class="{{if .IsRepoToolbarPulls}}active{{end}}"><a href="{{.RepoLink}}/pulls">Pull Requests</a></li> --> <li class="{{if .IsRepoToolbarIssues}}active{{end}}"><a href="{{.RepoLink}}/issues">{{if .Repository.NumOpenIssues}}<span class="badge">{{.Repository.NumOpenIssues}}</span> {{end}}Issues <!--<span class="badge">42</span>--></a></li> {{if .IsRepoToolbarIssues}} - <li class="tmp">{{if .IsRepoToolbarIssuesList}}<a href="{{.RepoLink}}/issues/new"><button class="btn btn-primary btn-sm">New Issue</button> - </a>{{end}}</li> + <li class="tmp">{{if .IsRepoToolbarIssuesList}} + <a href="{{.RepoLink}}/issues/new"><button class="btn btn-primary btn-sm">New Issue</button></a> + <a href="{{.RepoLink}}/issues/milestones"><button class="btn btn-success btn-sm">Milestones</button></a> + {{end}}</li> {{end}} <li class="{{if .IsRepoToolbarReleases}}active{{end}}"><a href="{{.RepoLink}}/releases">{{if .Repository.NumTags}}<span class="badge">{{.Repository.NumTags}}</span> {{end}}Releases</a></li> {{if .IsRepoToolbarReleases}}{{if .IsRepositoryOwner}}{{if not .IsRepoReleaseNew}} |