From 3ede496383bc0e5ad2cb9c5f034890bb6d626b3c Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Sun, 6 Apr 2014 14:54:28 +0800 Subject: [PATCH] add release-new route --- routers/repo/release.go | 8 ++++++++ templates/release/new.tmpl | 15 +++++++++++++++ templates/repo/toolbar.tmpl | 2 +- web.go | 1 + 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 templates/release/new.tmpl diff --git a/routers/repo/release.go b/routers/repo/release.go index 8e8b93c9eab..279fc169f81 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 00000000000..a7dc905a0e3 --- /dev/null +++ b/templates/release/new.tmpl @@ -0,0 +1,15 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +{{template "repo/nav" .}} +{{template "repo/toolbar" .}} +
+
+

New Release

+
+
+ +
+
+
+
+{{template "base/footer" .}} \ No newline at end of file diff --git a/templates/repo/toolbar.tmpl b/templates/repo/toolbar.tmpl index 54842048324..d8ab26214c2 100644 --- a/templates/repo/toolbar.tmpl +++ b/templates/repo/toolbar.tmpl @@ -15,7 +15,7 @@ {{end}}
  • {{if .Repository.NumReleases}}{{.Repository.NumReleases}} {{end}}Releases
  • {{if .IsRepoToolbarReleases}} -
  • +
  • {{if not .IsRepoReleaseNew}}{{end}}
  • {{end}}