diff options
author | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-04-06 14:54:28 +0800 |
---|---|---|
committer | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-04-06 14:54:28 +0800 |
commit | 3ede496383bc0e5ad2cb9c5f034890bb6d626b3c (patch) | |
tree | 489687b5d9fdad3bf613951466168c1b1dee972f | |
parent | 75db79b4b6bcb8f61dd957c9bd21b32d4746f866 (diff) | |
download | gitea-3ede496383bc0e5ad2cb9c5f034890bb6d626b3c.tar.gz gitea-3ede496383bc0e5ad2cb9c5f034890bb6d626b3c.zip |
add release-new route
-rw-r--r-- | routers/repo/release.go | 8 | ||||
-rw-r--r-- | templates/release/new.tmpl | 15 | ||||
-rw-r--r-- | templates/repo/toolbar.tmpl | 2 | ||||
-rw-r--r-- | web.go | 1 |
4 files changed, 25 insertions, 1 deletions
diff --git a/routers/repo/release.go b/routers/repo/release.go index 8e8b93c9ea..279fc169f8 100644 --- a/routers/repo/release.go +++ b/routers/repo/release.go @@ -12,6 +12,7 @@ import ( func Releases(ctx *middleware.Context) { ctx.Data["Title"] = "Releases" ctx.Data["IsRepoToolbarReleases"] = true + ctx.Data["IsRepoReleaseNew"] = false tags, err := models.GetTags(ctx.Repo.Owner.Name, ctx.Repo.Repository.Name) if err != nil { ctx.Handle(404, "repo.Releases(GetTags)", err) @@ -20,3 +21,10 @@ func Releases(ctx *middleware.Context) { ctx.Data["Releases"] = tags ctx.HTML(200, "release/list") } + +func ReleasesNew(ctx *middleware.Context) { + ctx.Data["Title"] = "New Release" + ctx.Data["IsRepoToolbarReleases"] = true + ctx.Data["IsRepoReleaseNew"] = true + ctx.HTML(200, "release/new") +} diff --git a/templates/release/new.tmpl b/templates/release/new.tmpl new file mode 100644 index 0000000000..a7dc905a0e --- /dev/null +++ b/templates/release/new.tmpl @@ -0,0 +1,15 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +{{template "repo/nav" .}} +{{template "repo/toolbar" .}} +<div id="body" class="container"> + <div id="release"> + <h4 id="release-head">New Release</h4> + <form id="release-new-form" action="" class="form form-inline"> + <div class="form-group"> + <input id="release-tag-name" type="text" class="form-control" placeholder="tag name"/> + </div> + </form> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/repo/toolbar.tmpl b/templates/repo/toolbar.tmpl index 5484204832..d8ab26214c 100644 --- a/templates/repo/toolbar.tmpl +++ b/templates/repo/toolbar.tmpl @@ -15,7 +15,7 @@ {{end}} <li class="{{if .IsRepoToolbarReleases}}active{{end}}"><a href="{{.RepoLink}}/releases">{{if .Repository.NumReleases}}<span class="badge">{{.Repository.NumReleases}}</span> {{end}}Releases</a></li> {{if .IsRepoToolbarReleases}} - <li class="tmp"><a href="{{.RepoLink}}/releases/new"><button class="btn btn-primary btn-sm">New Release</button></a></li> + <li class="tmp">{{if not .IsRepoReleaseNew}}<a href="{{.RepoLink}}/releases/new"><button class="btn btn-primary btn-sm">New Release</button></a>{{end}}</li> {{end}} <!-- <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">More <b class="caret"></b></a> @@ -148,6 +148,7 @@ func runWeb(*cli.Context) { r.Get("/issues", repo.Issues) r.Get("/issues/:index", repo.ViewIssue) r.Get("/releases", repo.Releases) + r.Any("/releases/new",repo.ReleasesNew) r.Get("/pulls", repo.Pulls) r.Get("/branches", repo.Branches) }, ignSignIn, middleware.RepoAssignment(true)) |