aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/update.go4
-rw-r--r--cmd/web.go5
-rw-r--r--gogs.go2
-rw-r--r--models/update.go26
-rw-r--r--modules/base/base.go1
-rw-r--r--modules/mailer/mail.go19
-rw-r--r--modules/middleware/context.go8
-rwxr-xr-xpublic/css/gogs.css110
-rw-r--r--routers/admin/admin.go27
-rw-r--r--routers/admin/auth.go (renamed from routers/admin/auths.go)23
-rw-r--r--routers/admin/user.go48
-rw-r--r--routers/dashboard.go7
-rw-r--r--routers/dev/template.go3
-rw-r--r--routers/install.go26
-rw-r--r--routers/org/org.go27
-rw-r--r--routers/repo/branch.go11
-rw-r--r--routers/repo/commit.go92
-rw-r--r--routers/repo/http.go5
-rw-r--r--routers/repo/issue.go34
-rw-r--r--routers/repo/pull.go7
-rw-r--r--routers/repo/release.go19
-rw-r--r--routers/repo/repo.go32
-rw-r--r--routers/repo/setting.go67
-rw-r--r--routers/user/home.go30
-rw-r--r--routers/user/setting.go25
-rw-r--r--routers/user/user.go53
-rw-r--r--templates/VERSION2
-rw-r--r--templates/admin/auth/edit.tmpl (renamed from templates/admin/auths/edit.tmpl)0
-rw-r--r--templates/admin/auth/new.tmpl (renamed from templates/admin/auths/new.tmpl)0
-rw-r--r--templates/admin/user/edit.tmpl (renamed from templates/admin/users/edit.tmpl)0
-rw-r--r--templates/admin/user/new.tmpl (renamed from templates/admin/users/new.tmpl)0
-rw-r--r--templates/mail/auth/active.tmpl (renamed from templates/mail/auth/active_email.tmpl)0
-rw-r--r--templates/org/dashboard.tmpl73
-rw-r--r--templates/org/members.tmpl56
-rw-r--r--templates/org/new.tmpl48
-rw-r--r--templates/org/setting.tmpl151
-rw-r--r--templates/org/teams.tmpl65
-rw-r--r--templates/repo/branch.tmpl (renamed from templates/repo/branches.tmpl)0
-rw-r--r--templates/repo/hook_add.tmpl (renamed from templates/repo/hooks_add.tmpl)0
-rw-r--r--templates/repo/hook_edit.tmpl (renamed from templates/repo/hooks_edit.tmpl)0
-rw-r--r--templates/repo/issue/create.tmpl (renamed from templates/issue/create.tmpl)0
-rw-r--r--templates/repo/issue/list.tmpl (renamed from templates/issue/list.tmpl)0
-rw-r--r--templates/repo/issue/milestone.tmpl (renamed from templates/issue/milestone.tmpl)0
-rw-r--r--templates/repo/issue/milestone_edit.tmpl (renamed from templates/issue/milestone_edit.tmpl)0
-rw-r--r--templates/repo/issue/milestone_new.tmpl (renamed from templates/issue/milestone_new.tmpl)0
-rw-r--r--templates/repo/issue/view.tmpl (renamed from templates/issue/view.tmpl)0
-rw-r--r--templates/repo/release/edit.tmpl (renamed from templates/release/edit.tmpl)0
-rw-r--r--templates/repo/release/list.tmpl (renamed from templates/release/list.tmpl)0
-rw-r--r--templates/repo/release/new.tmpl (renamed from templates/release/new.tmpl)0
-rw-r--r--templates/user/dashboard.tmpl4
-rw-r--r--templates/user/issues.tmpl (renamed from templates/user/issue.tmpl)0
51 files changed, 894 insertions, 216 deletions
diff --git a/cmd/update.go b/cmd/update.go
index d0e0acde..c030b6cf 100644
--- a/cmd/update.go
+++ b/cmd/update.go
@@ -42,5 +42,7 @@ func runUpdate(c *cli.Context) {
repoUserName := os.Getenv("repoUserName")
repoName := os.Getenv("repoName")
- models.Update(args[0], args[1], args[2], userName, repoUserName, repoName, userId)
+ if err := models.Update(args[0], args[1], args[2], userName, repoUserName, repoName, userId); err != nil {
+ log.GitLogger.Fatal(err.Error())
+ }
}
diff --git a/cmd/web.go b/cmd/web.go
index f62bc255..d29183a9 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -189,7 +189,12 @@ func runWeb(*cli.Context) {
reqOwner := middleware.RequireOwner()
m.Group("/o", func(r martini.Router) {
+ r.Get("/create", org.New)
r.Get("/:org", org.Organization)
+ r.Get("/:org/dashboard", org.Dashboard)
+ r.Get("/:org/members", org.Members)
+ r.Get("/:org/teams", org.Teams)
+ r.Get("/:org/setting", org.Setting)
})
m.Group("/:username/:reponame", func(r martini.Router) {
diff --git a/gogs.go b/gogs.go
index 7719ee0a..a39d2d43 100644
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)
-const APP_VER = "0.4.5.0621 Alpha"
+const APP_VER = "0.4.5.0623 Alpha"
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
diff --git a/models/update.go b/models/update.go
index 5675a94c..3328f221 100644
--- a/models/update.go
+++ b/models/update.go
@@ -6,6 +6,7 @@ package models
import (
"container/list"
+ "fmt"
"os/exec"
"strings"
@@ -15,11 +16,11 @@ import (
"github.com/gogits/gogs/modules/log"
)
-func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName string, userId int64) {
+func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName string, userId int64) error {
isNew := strings.HasPrefix(oldCommitId, "0000000")
if isNew &&
strings.HasPrefix(newCommitId, "0000000") {
- log.GitLogger.Fatal("old rev and new rev both 000000")
+ return fmt.Errorf("old rev and new rev both 000000")
}
f := RepoPath(repoUserName, repoName)
@@ -31,18 +32,17 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName
isDel := strings.HasPrefix(newCommitId, "0000000")
if isDel {
log.GitLogger.Info("del rev", refName, "from", userName+"/"+repoName+".git", "by", userId)
- return
+ return nil
}
repo, err := git.OpenRepository(f)
if err != nil {
- log.GitLogger.Fatal("runUpdate.Open repoId: %v", err)
+ return fmt.Errorf("runUpdate.Open repoId: %v", err)
}
newCommit, err := repo.GetCommit(newCommitId)
if err != nil {
- log.GitLogger.Fatal("runUpdate GetCommit of newCommitId: %v", err)
- return
+ return fmt.Errorf("runUpdate GetCommit of newCommitId: %v", err)
}
var l *list.List
@@ -50,28 +50,27 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName
if isNew {
l, err = newCommit.CommitsBefore()
if err != nil {
- log.GitLogger.Fatal("Find CommitsBefore erro: %v", err)
+ return fmt.Errorf("Find CommitsBefore erro: %v", err)
}
} else {
l, err = newCommit.CommitsBeforeUntil(oldCommitId)
if err != nil {
- log.GitLogger.Fatal("Find CommitsBeforeUntil erro: %v", err)
- return
+ return fmt.Errorf("Find CommitsBeforeUntil erro: %v", err)
}
}
if err != nil {
- log.GitLogger.Fatal("runUpdate.Commit repoId: %v", err)
+ return fmt.Errorf("runUpdate.Commit repoId: %v", err)
}
ru, err := GetUserByName(repoUserName)
if err != nil {
- log.GitLogger.Fatal("runUpdate.GetUserByName: %v", err)
+ return fmt.Errorf("runUpdate.GetUserByName: %v", err)
}
repos, err := GetRepositoryByName(ru.Id, repoName)
if err != nil {
- log.GitLogger.Fatal("runUpdate.GetRepositoryByName userId: %v", err)
+ return fmt.Errorf("runUpdate.GetRepositoryByName userId: %v", err)
}
commits := make([]*base.PushCommit, 0)
@@ -95,6 +94,7 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName
//commits = append(commits, []string{lastCommit.Id().String(), lastCommit.Message()})
if err = CommitRepoAction(userId, ru.Id, userName, actEmail,
repos.Id, repoUserName, repoName, refName, &base.PushCommits{l.Len(), commits}); err != nil {
- log.GitLogger.Fatal("runUpdate.models.CommitRepoAction: %s/%s:%v", repoUserName, repoName, err)
+ return fmt.Errorf("runUpdate.models.CommitRepoAction: %s/%s:%v", repoUserName, repoName, err)
}
+ return nil
}
diff --git a/modules/base/base.go b/modules/base/base.go
index 145fae6f..570600c3 100644
--- a/modules/base/base.go
+++ b/modules/base/base.go
@@ -7,6 +7,7 @@ package base
type (
// Type TmplData represents data in the templates.
TmplData map[string]interface{}
+ TplName string
ApiJsonErr struct {
Message string `json:"message"`
diff --git a/modules/mailer/mail.go b/modules/mailer/mail.go
index e212d006..62e15cd7 100644
--- a/modules/mailer/mail.go
+++ b/modules/mailer/mail.go
@@ -17,6 +17,15 @@ import (
"github.com/gogits/gogs/modules/setting"
)
+const (
+ AUTH_ACTIVE base.TplName = "mail/auth/active"
+ AUTH_REGISTER_SUCCESS base.TplName = "mail/auth/register_success"
+ AUTH_RESET_PASSWORD base.TplName = "mail/auth/reset_passwd"
+
+ NOTIFY_COLLABORATOR base.TplName = "mail/notify/collaborator"
+ NOTIFY_MENTION base.TplName = "mail/notify/mention"
+)
+
// Create New mail message use MailFrom and MailUser
func NewMailMessageFrom(To []string, from, subject, body string) Message {
msg := NewHtmlMessage(To, from, subject, body)
@@ -61,7 +70,7 @@ func SendRegisterMail(r *middleware.Render, u *models.User) {
data := GetMailTmplData(u)
data["Code"] = code
- body, err := r.HTMLString("mail/auth/register_success", data)
+ body, err := r.HTMLString(string(AUTH_REGISTER_SUCCESS), data)
if err != nil {
log.Error("mail.SendRegisterMail(fail to render): %v", err)
return
@@ -81,7 +90,7 @@ func SendActiveMail(r *middleware.Render, u *models.User) {
data := GetMailTmplData(u)
data["Code"] = code
- body, err := r.HTMLString("mail/auth/active_email", data)
+ body, err := r.HTMLString(string(AUTH_ACTIVE), data)
if err != nil {
log.Error("mail.SendActiveMail(fail to render): %v", err)
return
@@ -101,7 +110,7 @@ func SendResetPasswdMail(r *middleware.Render, u *models.User) {
data := GetMailTmplData(u)
data["Code"] = code
- body, err := r.HTMLString("mail/auth/reset_passwd", data)
+ body, err := r.HTMLString(string(AUTH_RESET_PASSWORD), data)
if err != nil {
log.Error("mail.SendResetPasswdMail(fail to render): %v", err)
return
@@ -161,7 +170,7 @@ func SendIssueMentionMail(r *middleware.Render, u, owner *models.User,
data["IssueLink"] = fmt.Sprintf("%s/%s/issues/%d", owner.Name, repo.Name, issue.Index)
data["Subject"] = subject
- body, err := r.HTMLString("mail/notify/mention", data)
+ body, err := r.HTMLString(string(NOTIFY_MENTION), data)
if err != nil {
return fmt.Errorf("mail.SendIssueMentionMail(fail to render): %v", err)
}
@@ -182,7 +191,7 @@ func SendCollaboratorMail(r *middleware.Render, u, owner *models.User,
data["RepoLink"] = path.Join(owner.Name, repo.Name)
data["Subject"] = subject
- body, err := r.HTMLString("mail/notify/collaborator", data)
+ body, err := r.HTMLString(string(NOTIFY_COLLABORATOR), data)
if err != nil {
return fmt.Errorf("mail.SendCollaboratorMail(fail to render): %v", err)
}
diff --git a/modules/middleware/context.go b/modules/middleware/context.go
index 19556118..45f0140a 100644
--- a/modules/middleware/context.go
+++ b/modules/middleware/context.go
@@ -104,12 +104,12 @@ func (ctx *Context) HasError() bool {
}
// HTML calls render.HTML underlying but reduce one argument.
-func (ctx *Context) HTML(status int, name string, htmlOpt ...HTMLOptions) {
- ctx.Render.HTML(status, name, ctx.Data, htmlOpt...)
+func (ctx *Context) HTML(status int, name base.TplName, htmlOpt ...HTMLOptions) {
+ ctx.Render.HTML(status, string(name), ctx.Data, htmlOpt...)
}
// RenderWithErr used for page has form validation but need to prompt error to users.
-func (ctx *Context) RenderWithErr(msg, tpl string, form auth.Form) {
+func (ctx *Context) RenderWithErr(msg string, tpl base.TplName, form auth.Form) {
if form != nil {
auth.AssignForm(form, ctx.Data)
}
@@ -133,7 +133,7 @@ func (ctx *Context) Handle(status int, title string, err error) {
case 500:
ctx.Data["Title"] = "Internal Server Error"
}
- ctx.HTML(status, fmt.Sprintf("status/%d", status))
+ ctx.HTML(status, base.TplName(fmt.Sprintf("status/%d", status)))
}
func (ctx *Context) Debug(msg string, args ...interface{}) {
diff --git a/public/css/gogs.css b/public/css/gogs.css
index 67d1ebe5..1f465d84 100755
--- a/public/css/gogs.css
+++ b/public/css/gogs.css
@@ -372,7 +372,7 @@ html, body {
/* gogits repo create */
-#repo-create {
+#repo-create, #org-create {
width: 800px;
}
@@ -662,6 +662,14 @@ html, body {
padding: .8em 1.2em;
}
+#dashboard-switch-menu > li > a:hover {
+ text-decoration: none;
+}
+
+#dashboard-switch-menu > li > a img, #dashboard-switch button img {
+ margin-right: 6px;
+}
+
#dashboard-switch-menu > li {
border-bottom: 1px solid #eaeaea;
}
@@ -1864,16 +1872,44 @@ html, body {
padding: 16px 0;
}
+#body-nav.org-nav.org-nav-auto {
+ height: auto;
+}
+
+.org-nav > .container {
+ padding-left: 0;
+ padding-left: 0;
+}
+
.org-nav .org-logo {
margin-right: 16px;
width: 100px;
height: 100px;
}
+.org-nav .org-small-logo {
+ margin-right: 16px;
+ width: 50px;
+ height: 50px;
+}
+
.org-nav .org-name {
margin-top: 0;
}
+.org-nav-auto .org-name {
+ font-size: 1.4em;
+ line-height: 48px;
+}
+
+#body-nav.org-nav-auto .nav {
+ margin-top: 6px;
+}
+
+#body-nav.org-nav-auto .nav a:hover {
+ text-decoration: none;
+}
+
.org-description {
font-size: 16px;
}
@@ -1894,6 +1930,10 @@ html, body {
margin-left: 0;
}
+.org-main {
+ padding-left: 0;
+}
+
.org-sidebar {
margin-top: -100px;
}
@@ -1947,4 +1987,72 @@ html, body {
.org-team a:hover .org-team-name {
color: #0079bc !important;
+}
+
+#org-members {
+ margin-right: 30px;
+}
+
+#org-members .member .avatar img {
+ width: 50px;
+ height: 50px;
+}
+
+#org-members .member {
+ padding-bottom: 20px;
+ margin-bottom: 20px;
+ border-bottom: 1px solid #DDD;
+ height: 70px;
+}
+
+#org-members .member .name {
+ padding-top: 4px;
+}
+
+#org-members .member .nick {
+ display: block;
+ color: #888;
+}
+
+#org-members .member .name a {
+ color: #444;
+}
+
+#org-members .member .name strong {
+ font-size: 1.2em;
+}
+
+#org-members .status, #org-members .role {
+ line-height: 48px;
+ text-align: right;
+}
+
+#org-teams .org-team .panel-heading {
+ margin-top: 0;
+}
+
+#org-teams .org-team .panel-heading a {
+ color: #444;
+}
+
+#org-teams .org-team-members {
+ margin-top: 18px;
+}
+
+#org-teams .org-team-members img {
+ width: 40px;
+ height: 40px;
+ margin-right: 12px;
+}
+
+#org-teams .org-team-members a {
+ display: inline-block;
+}
+
+#org-teams .org-team .panel-footer {
+ height: 60px;
+}
+
+#org-teams .org-team {
+ border-bottom: none;
} \ No newline at end of file
diff --git a/routers/admin/admin.go b/routers/admin/admin.go
index 1567a300..140e1e9f 100644
--- a/routers/admin/admin.go
+++ b/routers/admin/admin.go
@@ -20,6 +20,16 @@ import (
"github.com/gogits/gogs/modules/setting"
)
+const (
+ DASHBOARD base.TplName = "admin/dashboard"
+ USERS base.TplName = "admin/users"
+ REPOS base.TplName = "admin/repos"
+ AUTHS base.TplName = "admin/auths"
+ CONFIG base.TplName = "admin/config"
+ MONITOR_PROCESS base.TplName = "admin/monitor/process"
+ MONITOR_CRON base.TplName = "admin/monitor/cron"
+)
+
var startTime = time.Now()
var sysStatus struct {
@@ -140,7 +150,7 @@ func Dashboard(ctx *middleware.Context) {
ctx.Data["Stats"] = models.GetStatistic()
updateSystemStatus()
ctx.Data["SysStatus"] = sysStatus
- ctx.HTML(200, "admin/dashboard")
+ ctx.HTML(200, DASHBOARD)
}
func Users(ctx *middleware.Context) {
@@ -150,10 +160,10 @@ func Users(ctx *middleware.Context) {
var err error
ctx.Data["Users"], err = models.GetUsers(200, 0)
if err != nil {
- ctx.Handle(500, "admin.Users", err)
+ ctx.Handle(500, "admin.Users(GetUsers)", err)
return
}
- ctx.HTML(200, "admin/users")
+ ctx.HTML(200, USERS)
}
func Repositories(ctx *middleware.Context) {
@@ -166,7 +176,7 @@ func Repositories(ctx *middleware.Context) {
ctx.Handle(500, "admin.Repositories", err)
return
}
- ctx.HTML(200, "admin/repos")
+ ctx.HTML(200, REPOS)
}
func Auths(ctx *middleware.Context) {
@@ -179,7 +189,7 @@ func Auths(ctx *middleware.Context) {
ctx.Handle(500, "admin.Auths", err)
return
}
- ctx.HTML(200, "admin/auths")
+ ctx.HTML(200, AUTHS)
}
func Config(ctx *middleware.Context) {
@@ -235,7 +245,7 @@ func Config(ctx *middleware.Context) {
}
ctx.Data["Loggers"] = loggers
- ctx.HTML(200, "admin/config")
+ ctx.HTML(200, CONFIG)
}
func Monitor(ctx *middleware.Context) {
@@ -247,11 +257,10 @@ func Monitor(ctx *middleware.Context) {
case "process":
ctx.Data["PageIsMonitorProcess"] = true
ctx.Data["Processes"] = process.Processes
- ctx.HTML(200, "admin/monitor/process")
+ ctx.HTML(200, MONITOR_PROCESS)
default:
ctx.Data["PageIsMonitorCron"] = true
ctx.Data["Entries"] = cron.ListEntries()
- ctx.HTML(200, "admin/monitor/cron")
+ ctx.HTML(200, MONITOR_CRON)
}
-
}
diff --git a/routers/admin/auths.go b/routers/admin/auth.go
index e0b99714..ff6c0325 100644
--- a/routers/admin/auths.go
+++ b/routers/admin/auth.go
@@ -18,12 +18,17 @@ import (
"github.com/gogits/gogs/modules/middleware"
)
+const (
+ AUTH_NEW base.TplName = "admin/auth/new"
+ AUTH_EDIT base.TplName = "admin/auth/edit"
+)
+
func NewAuthSource(ctx *middleware.Context) {
ctx.Data["Title"] = "New Authentication"
ctx.Data["PageIsAuths"] = true
ctx.Data["LoginTypes"] = models.LoginTypes
ctx.Data["SMTPAuths"] = models.SMTPAuths
- ctx.HTML(200, "admin/auths/new")
+ ctx.HTML(200, AUTH_NEW)
}
func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
@@ -33,7 +38,7 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
ctx.Data["SMTPAuths"] = models.SMTPAuths
if ctx.HasError() {
- ctx.HTML(200, "admin/auths/new")
+ ctx.HTML(200, AUTH_NEW)
return
}
@@ -74,7 +79,7 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
}
if err := models.CreateSource(source); err != nil {
- ctx.Handle(500, "admin.auths.NewAuth", err)
+ ctx.Handle(500, "admin.auths.NewAuth(CreateSource)", err)
return
}
@@ -97,11 +102,11 @@ func EditAuthSource(ctx *middleware.Context, params martini.Params) {
}
u, err := models.GetLoginSourceById(id)
if err != nil {
- ctx.Handle(500, "admin.user.EditUser", err)
+ ctx.Handle(500, "admin.user.EditUser(GetLoginSourceById)", err)
return
}
ctx.Data["Source"] = u
- ctx.HTML(200, "admin/auths/edit")
+ ctx.HTML(200, AUTH_EDIT)
}
func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
@@ -111,7 +116,7 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
ctx.Data["SMTPAuths"] = models.SMTPAuths
if ctx.HasError() {
- ctx.HTML(200, "admin/auths/edit")
+ ctx.HTML(200, AUTH_EDIT)
return
}
@@ -153,7 +158,7 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
}
if err := models.UpdateSource(&u); err != nil {
- ctx.Handle(500, "admin.auths.EditAuth", err)
+ ctx.Handle(500, "admin.auths.EditAuth(UpdateSource)", err)
return
}
@@ -175,7 +180,7 @@ func DeleteAuthSource(ctx *middleware.Context, params martini.Params) {
a, err := models.GetLoginSourceById(id)
if err != nil {
- ctx.Handle(500, "admin.auths.DeleteAuth", err)
+ ctx.Handle(500, "admin.auths.DeleteAuth(GetLoginSourceById)", err)
return
}
@@ -185,7 +190,7 @@ func DeleteAuthSource(ctx *middleware.Context, params martini.Params) {
ctx.Flash.Error("This authentication still has used by some users, you should move them and then delete again.")
ctx.Redirect("/admin/auths/" + params["authid"])
default:
- ctx.Handle(500, "admin.auths.DeleteAuth", err)
+ ctx.Handle(500, "admin.auths.DeleteAuth(DelLoginSource)", err)
}
return
}
diff --git a/routers/admin/user.go b/routers/admin/user.go
index 596fe7b1..d1bbb480 100644
--- a/routers/admin/user.go
+++ b/routers/admin/user.go
@@ -5,8 +5,6 @@
package admin
import (
- "fmt"
- "strconv"
"strings"
"github.com/go-martini/martini"
@@ -18,16 +16,21 @@ import (
"github.com/gogits/gogs/modules/middleware"
)
+const (
+ USER_NEW base.TplName = "admin/user/new"
+ USER_EDIT base.TplName = "admin/user/edit"
+)
+
func NewUser(ctx *middleware.Context) {
ctx.Data["Title"] = "New Account"
ctx.Data["PageIsUsers"] = true
auths, err := models.GetAuths()
if err != nil {
- ctx.Handle(500, "admin.user.NewUser", err)
+ ctx.Handle(500, "admin.user.NewUser(GetAuths)", err)
return
}
ctx.Data["LoginSources"] = auths
- ctx.HTML(200, "admin/users/new")
+ ctx.HTML(200, USER_NEW)
}
func NewUserPost(ctx *middleware.Context, form auth.RegisterForm) {
@@ -35,7 +38,7 @@ func NewUserPost(ctx *middleware.Context, form auth.RegisterForm) {
ctx.Data["PageIsUsers"] = true
if ctx.HasError() {
- ctx.HTML(200, "admin/users/new")
+ ctx.HTML(200, USER_NEW)
return
}
@@ -55,25 +58,25 @@ func NewUserPost(ctx *middleware.Context, form auth.RegisterForm) {
}
if len(form.LoginType) > 0 {
+ // NOTE: need rewrite.
fields := strings.Split(form.LoginType, "-")
- tp, _ := strconv.Atoi(fields[0])
+ tp, _ := base.StrTo(fields[0]).Int()
u.LoginType = models.LoginType(tp)
- u.LoginSource, _ = strconv.ParseInt(fields[1], 10, 64)
+ u.LoginSource, _ = base.StrTo(fields[1]).Int64()
u.LoginName = form.LoginName
- fmt.Println(u.LoginType, u.LoginSource, u.LoginName)
}
var err error
if u, err = models.RegisterUser(u); err != nil {
switch err {
case models.ErrUserAlreadyExist:
- ctx.RenderWithErr("Username has been already taken", "admin/users/new", &form)
+ ctx.RenderWithErr("Username has been already taken", USER_NEW, &form)
case models.ErrEmailAlreadyUsed:
- ctx.RenderWithErr("E-mail address has been already used", "admin/users/new", &form)
+ ctx.RenderWithErr("E-mail address has been already used", USER_NEW, &form)
case models.ErrUserNameIllegal:
- ctx.RenderWithErr(models.ErrRepoNameIllegal.Error(), "admin/users/new", &form)
+ ctx.RenderWithErr(models.ErrRepoNameIllegal.Error(), USER_NEW, &form)
default:
- ctx.Handle(500, "admin.user.NewUser", err)
+ ctx.Handle(500, "admin.user.NewUser(RegisterUser)", err)
}
return
}
@@ -96,18 +99,18 @@ func EditUser(ctx *middleware.Context, params martini.Params) {
u, err := models.GetUserById(int64(uid))
if err != nil {
- ctx.Handle(500, "admin.user.EditUser", err)
+ ctx.Handle(500, "admin.user.EditUser(GetUserById)", err)
return
}
ctx.Data["User"] = u
auths, err := models.GetAuths()
if err != nil {
- ctx.Handle(500, "admin.user.NewUser", err)
+ ctx.Handle(500, "admin.user.NewUser(GetAuths)", err)
return
}
ctx.Data["LoginSources"] = auths
- ctx.HTML(200, "admin/users/edit")
+ ctx.HTML(200, USER_EDIT)
}
func EditUserPost(ctx *middleware.Context, params martini.Params, form auth.AdminEditUserForm) {
@@ -116,13 +119,18 @@ func EditUserPost(ctx *middleware.Context, params martini.Params, form auth.Admi
uid, err := base.StrTo(params["userid"]).Int()
if err != nil {
- ctx.Handle(404, "admin.user.EditUser", err)
+ ctx.Handle(404, "admin.user.EditUserPost", err)
return
}
u, err := models.GetUserById(int64(uid))
if err != nil {
- ctx.Handle(500, "admin.user.EditUser", err)
+ ctx.Handle(500, "admin.user.EditUserPost(GetUserById)", err)
+ return
+ }
+
+ if ctx.HasError() {
+ ctx.HTML(200, USER_EDIT)
return
}
@@ -134,7 +142,7 @@ func EditUserPost(ctx *middleware.Context, params martini.Params, form auth.Admi
u.IsActive = form.Active
u.IsAdmin = form.Admin
if err := models.UpdateUser(u); err != nil {
- ctx.Handle(500, "admin.user.EditUser", err)
+ ctx.Handle(500, "admin.user.EditUserPost(UpdateUser)", err)
return
}
log.Trace("%s User profile updated by admin(%s): %s", ctx.Req.RequestURI,
@@ -152,13 +160,13 @@ func DeleteUser(ctx *middleware.Context, params martini.Params) {
//log.Info("delete")
uid, err := base.StrTo(params["userid"]).Int()
if err != nil {
- ctx.Handle(404, "admin.user.EditUser", err)
+ ctx.Handle(404, "admin.user.DeleteUser", err)
return
}
u, err := models.GetUserById(int64(uid))
if err != nil {
- ctx.Handle(500, "admin.user.EditUser", err)
+ ctx.Handle(500, "admin.user.DeleteUser(GetUserById)", err)
return
}
diff --git a/routers/dashboard.go b/routers/dashboard.go
index 7daa0e7b..4ef4e54f 100644
--- a/routers/dashboard.go
+++ b/routers/dashboard.go
@@ -6,11 +6,16 @@ package routers
import (
"github.com/gogits/gogs/models"
+ "github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/middleware"
"github.com/gogits/gogs/modules/setting"
"github.com/gogits/gogs/routers/user"
)
+const (
+ HOME base.TplName = "home"
+)
+
func Home(ctx *middleware.Context) {
if ctx.IsSigned {
user.Dashboard(ctx)
@@ -40,7 +45,7 @@ func Home(ctx *middleware.Context) {
}
}
ctx.Data["Repos"] = repos
- ctx.HTML(200, "home")
+ ctx.HTML(200, HOME)
}
func NotFound(ctx *middleware.Context) {
diff --git a/routers/dev/template.go b/routers/dev/template.go
index 5e84d76e..da477c94 100644
--- a/routers/dev/template.go
+++ b/routers/dev/template.go
@@ -8,6 +8,7 @@ import (
"github.com/go-martini/martini"
"github.com/gogits/gogs/models"
+ "github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/middleware"
"github.com/gogits/gogs/modules/setting"
)
@@ -22,5 +23,5 @@ func TemplatePreview(ctx *middleware.Context, params martini.Params) {
ctx.Data["ActiveCodeLives"] = setting.Service.ActiveCodeLives / 60
ctx.Data["ResetPwdCodeLives"] = setting.Service.ResetPwdCodeLives / 60
ctx.Data["CurDbValue"] = ""
- ctx.HTML(200, params["_1"])
+ ctx.HTML(200, base.TplName(params["_1"]))
}
diff --git a/routers/install.go b/routers/install.go
index c2eee88a..6ce7c980 100644
--- a/routers/install.go
+++ b/routers/install.go
@@ -26,6 +26,10 @@ import (
"github.com/gogits/gogs/modules/social"
)
+const (
+ INSTALL base.TplName = "install"
+)
+
func checkRunMode() {
switch setting.Cfg.MustValue("", "RUN_MODE") {
case "prod":
@@ -72,6 +76,7 @@ func renderDbOption(ctx *middleware.Context) {
ctx.Data["DbOptions"] = []string{"MySQL", "PostgreSQL", "SQLite3"}
}
+// @router /install [get]
func Install(ctx *middleware.Context, form auth.InstallForm) {
if setting.InstallLock {
ctx.Handle(404, "install.Install", errors.New("Installation is prohibited"))
@@ -119,12 +124,12 @@ func Install(ctx *middleware.Context, form auth.InstallForm) {
ctx.Data["CurDbOption"] = curDbOp
auth.AssignForm(form, ctx.Data)
- ctx.HTML(200, "install")
+ ctx.HTML(200, INSTALL)
}
func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
if setting.InstallLock {
- ctx.Handle(404, "install.Install", errors.New("Installation is prohibited"))
+ ctx.Handle(404, "install.InstallPost", errors.New("Installation is prohibited"))
return
}
@@ -135,12 +140,12 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
ctx.Data["CurDbOption"] = form.Database
if ctx.HasError() {
- ctx.HTML(200, "install")
+ ctx.HTML(200, INSTALL)
return
}
if _, err := exec.LookPath("git"); err != nil {
- ctx.RenderWithErr("Fail to test 'git' command: "+err.Error(), "install", &form)
+ ctx.RenderWithErr("Fail to test 'git' command: "+err.Error(), INSTALL, &form)
return
}
@@ -158,18 +163,19 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
// Set test engine.
var x *xorm.Engine
if err := models.NewTestEngine(x); err != nil {
+ // NOTE: should use core.QueryDriver (github.com/go-xorm/core)
if strings.Contains(err.Error(), `Unknown database type: sqlite3`) {
ctx.RenderWithErr("Your release version does not support SQLite3, please download the official binary version "+
- "from http://gogs.io/docs/installation/install_from_binary.md, NOT the gobuild version.", "install", &form)
+ "from http://gogs.io/docs/installation/install_from_binary.md, NOT the gobuild version.", INSTALL, &form)
} else {
- ctx.RenderWithErr("Database setting is not correct: "+err.Error(), "install", &form)
+ ctx.RenderWithErr("Database setting is not correct: "+err.Error(), INSTALL, &form)
}
return
}
// Test repository root path.
if err := os.MkdirAll(form.RepoRootPath, os.ModePerm); err != nil {
- ctx.RenderWithErr("Repository root path is invalid: "+err.Error(), "install", &form)
+ ctx.RenderWithErr("Repository root path is invalid: "+err.Error(), INSTALL, &form)
return
}
@@ -180,7 +186,7 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
}
// Does not check run user when the install lock is off.
if form.RunUser != curUser {
- ctx.RenderWithErr("Run user isn't the current user: "+form.RunUser+" -> "+curUser, "install", &form)
+ ctx.RenderWithErr("Run user isn't the current user: "+form.RunUser+" -> "+curUser, INSTALL, &form)
return
}
@@ -214,7 +220,7 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
os.MkdirAll("custom/conf", os.ModePerm)
if err := goconfig.SaveConfigFile(setting.Cfg, path.Join(setting.CustomPath, "conf/app.ini")); err != nil {
- ctx.RenderWithErr("Fail to save configuration: "+err.Error(), "install", &form)
+ ctx.RenderWithErr("Fail to save configuration: "+err.Error(), INSTALL, &form)
return
}
@@ -225,7 +231,7 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
IsAdmin: true, IsActive: true}); err != nil {
if err != models.ErrUserAlreadyExist {
setting.InstallLock = false
- ctx.RenderWithErr("Admin account setting is invalid: "+err.Error(), "install", &form)
+ ctx.RenderWithErr("Admin account setting is invalid: "+err.Error(), INSTALL, &form)
return
}
log.Info("Admin account already exist")
diff --git a/routers/org/org.go b/routers/org/org.go
index 1c02e773..ff97402e 100644
--- a/routers/org/org.go
+++ b/routers/org/org.go
@@ -6,6 +6,31 @@ import (
)
func Organization(ctx *middleware.Context, params martini.Params) {
- ctx.Data["Title"] = "Organization Name" + params["org"]
+ ctx.Data["Title"] = "Organization "+params["org"]
ctx.HTML(200, "org/org")
}
+
+func Members(ctx *middleware.Context, params martini.Params) {
+ ctx.Data["Title"] = "Organization "+params["org"]+" Members"
+ ctx.HTML(200, "org/members")
+}
+
+func Teams(ctx *middleware.Context, params martini.Params) {
+ ctx.Data["Title"] = "Organization "+params["org"]+" Teams"
+ ctx.HTML(200, "org/teams")
+}
+
+func New(ctx *middleware.Context) {
+ ctx.Data["Title"] = "Create an Organization"
+ ctx.HTML(200, "org/new")
+}
+
+func Dashboard(ctx *middleware.Context, params martini.Params) {
+ ctx.Data["Title"] = "Dashboard"
+ ctx.HTML(200, "org/dashboard")
+}
+
+func Setting(ctx *middleware.Context, param martini.Params) {
+ ctx.Data["Title"] = "Setting"
+ ctx.HTML(200, "org/setting")
+}
diff --git a/routers/repo/branch.go b/routers/repo/branch.go
index 2e2ae692..9bad7289 100644
--- a/routers/repo/branch.go
+++ b/routers/repo/branch.go
@@ -7,22 +7,27 @@ package repo
import (
"github.com/go-martini/martini"
+ "github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/middleware"
)
+const (
+ BRANCH base.TplName = "repo/branch"
+)
+
func Branches(ctx *middleware.Context, params martini.Params) {
ctx.Data["Title"] = "Branches"
ctx.Data["IsRepoToolbarBranches"] = true
brs, err := ctx.Repo.GitRepo.GetBranches()
if err != nil {
- ctx.Handle(500, "repo.Branches", err)
+ ctx.Handle(500, "repo.Branches(GetBranches)", err)
return
} else if len(brs) == 0 {
- ctx.Handle(404, "repo.Branches", nil)
+ ctx.Handle(404, "repo.Branches(GetBranches)", nil)
return
}
ctx.Data["Branches"] = brs
- ctx.HTML(200, "repo/branches")
+ ctx.HTML(200, BRANCH)
}
diff --git a/routers/repo/commit.go b/routers/repo/commit.go
index 09dcaf5e..aa5c22e4 100644
--- a/routers/repo/commit.go
+++ b/routers/repo/commit.go
@@ -14,6 +14,11 @@ import (
"github.com/gogits/gogs/modules/middleware"
)
+const (
+ COMMITS base.TplName = "repo/commits"
+ DIFF base.TplName = "repo/diff"
+)
+
func Commits(ctx *middleware.Context, params martini.Params) {
ctx.Data["IsRepoToolbarCommits"] = true
@@ -22,10 +27,10 @@ func Commits(ctx *middleware.Context, params martini.Params) {
brs, err := ctx.Repo.GitRepo.GetBranches()
if err != nil {
- ctx.Handle(500, "repo.Commits", err)
+ ctx.Handle(500, "repo.Commits(GetBranches)", err)
return
} else if len(brs) == 0 {
- ctx.Handle(404, "repo.Commits", nil)
+ ctx.Handle(404, "repo.Commits(GetBranches)", nil)
return
}
@@ -61,7 +66,43 @@ func Commits(ctx *middleware.Context, params martini.Params) {
ctx.Data["CommitCount"] = commitsCount
ctx.Data["LastPageNum"] = lastPage
ctx.Data["NextPageNum"] = nextPage
- ctx.HTML(200, "repo/commits")
+ ctx.HTML(200, COMMITS)
+}
+
+func SearchCommits(ctx *middleware.Context, params martini.Params) {
+ ctx.Data["IsSearchPage"] = true
+ ctx.Data["IsRepoToolbarCommits"] = true
+
+ keyword := ctx.Query("q")
+ if len(keyword) == 0 {
+ ctx.Redirect(ctx.Repo.RepoLink + "/commits/" + ctx.Repo.BranchName)
+ return
+ }
+
+ userName := params["username"]
+ repoName := params["reponame"]
+
+ brs, err := ctx.Repo.GitRepo.GetBranches()
+ if err != nil {
+ ctx.Handle(500, "repo.SearchCommits(GetBranches)", err)
+ return
+ } else if len(brs) == 0 {
+ ctx.Handle(404, "repo.SearchCommits(GetBranches)", nil)
+ return
+ }
+
+ commits, err := ctx.Repo.Commit.SearchCommits(keyword)
+ if err != nil {
+ ctx.Handle(500, "repo.SearchCommits(SearchCommits)", err)
+ return
+ }
+
+ ctx.Data["Keyword"] = keyword
+ ctx.Data["Username"] = userName
+ ctx.Data["Reponame"] = repoName
+ ctx.Data["CommitCount"] = commits.Len()
+ ctx.Data["Commits"] = commits
+ ctx.HTML(200, COMMITS)
}
func Diff(ctx *middleware.Context, params martini.Params) {
@@ -75,7 +116,7 @@ func Diff(ctx *middleware.Context, params martini.Params) {
diff, err := models.GetDiff(models.RepoPath(userName, repoName), commitId)
if err != nil {
- ctx.Handle(404, "repo.Diff", err)
+ ctx.Handle(404, "repo.Diff(GetDiff)", err)
return
}
@@ -119,43 +160,7 @@ func Diff(ctx *middleware.Context, params martini.Params) {
ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0
ctx.Data["SourcePath"] = "/" + path.Join(userName, repoName, "src", commitId)
ctx.Data["RawPath"] = "/" + path.Join(userName, repoName, "raw", commitId)
- ctx.HTML(200, "repo/diff")
-}
-
-func SearchCommits(ctx *middleware.Context, params martini.Params) {
- ctx.Data["IsSearchPage"] = true
- ctx.Data["IsRepoToolbarCommits"] = true
-
- keyword := ctx.Query("q")
- if len(keyword) == 0 {
- ctx.Redirect(ctx.Repo.RepoLink + "/commits/" + ctx.Repo.BranchName)
- return
- }
-
- userName := params["username"]
- repoName := params["reponame"]
-
- brs, err := ctx.Repo.GitRepo.GetBranches()
- if err != nil {
- ctx.Handle(500, "repo.SearchCommits(GetBranches)", err)
- return
- } else if len(brs) == 0 {
- ctx.Handle(404, "repo.SearchCommits(GetBranches)", nil)
- return
- }
-
- commits, err := ctx.Repo.Commit.SearchCommits(keyword)
- if err != nil {
- ctx.Handle(500, "repo.SearchCommits(SearchCommits)", err)
- return
- }
-
- ctx.Data["Keyword"] = keyword
- ctx.Data["Username"] = userName
- ctx.Data["Reponame"] = repoName
- ctx.Data["CommitCount"] = commits.Len()
- ctx.Data["Commits"] = commits
- ctx.HTML(200, "repo/commits")
+ ctx.HTML(200, DIFF)
}
func FileHistory(ctx *middleware.Context, params martini.Params) {
@@ -184,8 +189,7 @@ func FileHistory(ctx *middleware.Context, params martini.Params) {
if err != nil {
ctx.Handle(500, "repo.FileHistory(GetCommitsCount)", err)
return
- }
- if commitsCount == 0 {
+ } else if commitsCount == 0 {
ctx.Handle(404, "repo.FileHistory", nil)
return
}
@@ -217,5 +221,5 @@ func FileHistory(ctx *middleware.Context, params martini.Params) {
ctx.Data["CommitCount"] = commitsCount
ctx.Data["LastPageNum"] = lastPage
ctx.Data["NextPageNum"] = nextPage
- ctx.HTML(200, "repo/commits")
+ ctx.HTML(200, COMMITS)
}
diff --git a/routers/repo/http.go b/routers/repo/http.go
index 5915e876..d2bff299 100644
--- a/routers/repo/http.go
+++ b/routers/repo/http.go
@@ -141,7 +141,10 @@ func Http(ctx *middleware.Context, params martini.Params) {
newCommitId := fields[1]
refName := fields[2]
- models.Update(refName, oldCommitId, newCommitId, authUsername, username, reponame, authUser.Id)
+ if err = models.Update(refName, oldCommitId, newCommitId, authUsername, username, reponame, authUser.Id); err != nil {
+ log.GitLogger.Error(err.Error())
+ return
+ }
}
}
}
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index 11c573f5..cf454bc8 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -22,6 +22,16 @@ import (
"github.com/gogits/gogs/modules/setting"
)
+const (
+ ISSUES base.TplName = "repo/issue/list"
+ ISSUE_CREATE base.TplName = "repo/issue/create"
+ ISSUE_VIEW base.TplName = "repo/issue/view"
+
+ MILESTONE base.TplName = "repo/issue/milestone"
+ MILESTONE_NEW base.TplName = "repo/issue/milestone_new"
+ MILESTONE_EDIT base.TplName = "repo/issue/milestone_edit"
+)
+
func Issues(ctx *middleware.Context) {
ctx.Data["Title"] = "Issues"
ctx.Data["IsRepoToolbarIssues"] = true
@@ -134,7 +144,7 @@ func Issues(ctx *middleware.Context) {
} else {
ctx.Data["ShowCount"] = issueStats.OpenCount
}
- ctx.HTML(200, "issue/list")
+ ctx.HTML(200, ISSUES)
}
func CreateIssue(ctx *middleware.Context, params martini.Params) {
@@ -161,7 +171,7 @@ func CreateIssue(ctx *middleware.Context, params martini.Params) {
return
}
ctx.Data["Collaborators"] = us
- ctx.HTML(200, "issue/create")
+ ctx.HTML(200, ISSUE_CREATE)
}
func CreateIssuePost(ctx *middleware.Context, params martini.Params, form auth.CreateIssueForm) {
@@ -190,7 +200,7 @@ func CreateIssuePost(ctx *middleware.Context, params martini.Params, form auth.C
ctx.Data["Collaborators"] = us
if ctx.HasError() {
- ctx.HTML(200, "issue/create")
+ ctx.HTML(200, ISSUE_CREATE)
return
}
@@ -392,7 +402,7 @@ func ViewIssue(ctx *middleware.Context, params martini.Params) {
ctx.Data["IsIssueOwner"] = ctx.Repo.IsOwner || (ctx.IsSigned && issue.PosterId == ctx.User.Id)
ctx.Data["IsRepoToolbarIssues"] = true
ctx.Data["IsRepoToolbarIssuesList"] = false
- ctx.HTML(200, "issue/view")
+ ctx.HTML(200, ISSUE_VIEW)
}
func UpdateIssue(ctx *middleware.Context, params martini.Params, form auth.CreateIssueForm) {
@@ -794,14 +804,14 @@ func Milestones(ctx *middleware.Context) {
} else {
ctx.Data["State"] = "open"
}
- ctx.HTML(200, "issue/milestone")
+ ctx.HTML(200, MILESTONE)
}
func NewMilestone(ctx *middleware.Context) {
ctx.Data["Title"] = "New Milestone"
ctx.Data["IsRepoToolbarIssues"] = true
ctx.Data["IsRepoToolbarIssuesList"] = true
- ctx.HTML(200, "issue/milestone_new")
+ ctx.HTML(200, MILESTONE_NEW)
}
func NewMilestonePost(ctx *middleware.Context, form auth.CreateMilestoneForm) {
@@ -809,6 +819,11 @@ func NewMilestonePost(ctx *middleware.Context, form auth.CreateMilestoneForm) {
ctx.Data["IsRepoToolbarIssues"] = true
ctx.Data["IsRepoToolbarIssuesList"] = true
+ if ctx.HasError() {
+ ctx.HTML(200, MILESTONE_NEW)
+ return
+ }
+
var deadline time.Time
var err error
if len(form.Deadline) == 0 {
@@ -890,7 +905,7 @@ func UpdateMilestone(ctx *middleware.Context, params martini.Params) {
}
ctx.Data["Milestone"] = mile
- ctx.HTML(200, "issue/milestone_edit")
+ ctx.HTML(200, MILESTONE_EDIT)
}
func UpdateMilestonePost(ctx *middleware.Context, params martini.Params, form auth.CreateMilestoneForm) {
@@ -914,6 +929,11 @@ func UpdateMilestonePost(ctx *middleware.Context, params martini.Params, form au
return
}
+ if ctx.HasError() {
+ ctx.HTML(200, MILESTONE_EDIT)
+ return
+ }
+
var deadline time.Time
if len(form.Deadline) == 0 {
form.Deadline = "12/31/9999"
diff --git a/routers/repo/pull.go b/routers/repo/pull.go
index 430c6a81..db208f9f 100644
--- a/routers/repo/pull.go
+++ b/routers/repo/pull.go
@@ -7,10 +7,15 @@ package repo
import (
"github.com/go-martini/martini"
+ "github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/middleware"
)
+const (
+ PULLS base.TplName = "repo/pulls"
+)
+
func Pulls(ctx *middleware.Context, params martini.Params) {
ctx.Data["IsRepoToolbarPulls"] = true
- ctx.HTML(200, "repo/pulls")
+ ctx.HTML(200, PULLS)
}
diff --git a/routers/repo/release.go b/routers/repo/release.go
index b6149b63..a901436f 100644
--- a/routers/repo/release.go
+++ b/routers/repo/release.go
@@ -14,6 +14,12 @@ import (
"github.com/gogits/gogs/modules/middleware"
)
+const (
+ RELEASES base.TplName = "repo/release/list"
+ RELEASE_NEW base.TplName = "repo/release/new"
+ RELEASE_EDIT base.TplName = "repo/release/edit"
+)
+
func Releases(ctx *middleware.Context) {
ctx.Data["Title"] = "Releases"
ctx.Data["IsRepoToolbarReleases"] = true
@@ -100,7 +106,7 @@ func Releases(ctx *middleware.Context) {
}
models.SortReleases(tags)
ctx.Data["Releases"] = tags
- ctx.HTML(200, "release/list")
+ ctx.HTML(200, RELEASES)
}
func NewRelease(ctx *middleware.Context) {
@@ -112,7 +118,7 @@ func NewRelease(ctx *middleware.Context) {
ctx.Data["Title"] = "New Release"
ctx.Data["IsRepoToolbarReleases"] = true
ctx.Data["IsRepoReleaseNew"] = true
- ctx.HTML(200, "release/new")
+ ctx.HTML(200, RELEASE_NEW)
}
func NewReleasePost(ctx *middleware.Context, form auth.NewReleaseForm) {
@@ -126,7 +132,7 @@ func NewReleasePost(ctx *middleware.Context, form auth.NewReleaseForm) {
ctx.Data["IsRepoReleaseNew"] = true
if ctx.HasError() {
- ctx.HTML(200, "release/new")
+ ctx.HTML(200, RELEASE_NEW)
return
}
@@ -187,7 +193,7 @@ func EditRelease(ctx *middleware.Context, params martini.Params) {
ctx.Data["Title"] = "Edit Release"
ctx.Data["IsRepoToolbarReleases"] = true
- ctx.HTML(200, "release/edit")
+ ctx.HTML(200, RELEASE_EDIT)
}
func EditReleasePost(ctx *middleware.Context, params martini.Params, form auth.EditReleaseForm) {
@@ -208,6 +214,11 @@ func EditReleasePost(ctx *middleware.Context, params martini.Params, form auth.E
}
ctx.Data["Release"] = rel
+ if ctx.HasError() {
+ ctx.HTML(200, RELEASE_EDIT)
+ return
+ }
+
ctx.Data["Title"] = "Edit Release"
ctx.Data["IsRepoToolbarReleases"] = true
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index 6db45300..2ead24df 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -25,12 +25,18 @@ import (
"github.com/gogits/gogs/modules/middleware"
)
+const (
+ CREATE base.TplName = "repo/create"
+ MIGRATE base.TplName = "repo/migrate"
+ SINGLE base.TplName = "repo/single"
+)
+
func Create(ctx *middleware.Context) {
ctx.Data["Title"] = "Create repository"
ctx.Data["PageIsNewRepo"] = true
ctx.Data["LanguageIgns"] = models.LanguageIgns
ctx.Data["Licenses"] = models.Licenses
- ctx.HTML(200, "repo/create")
+ ctx.HTML(200, CREATE)
}
func CreatePost(ctx *middleware.Context, form auth.CreateRepoForm) {
@@ -40,7 +46,7 @@ func CreatePost(ctx *middleware.Context, form auth.CreateRepoForm) {
ctx.Data["Licenses"] = models.Licenses
if ctx.HasError() {
- ctx.HTML(200, "repo/create")
+ ctx.HTML(200, CREATE)
return
}
@@ -51,25 +57,25 @@ func CreatePost(ctx *middleware.Context, form auth.CreateRepoForm) {
ctx.Redirect("/" + ctx.User.Name + "/" + form.RepoName)
return
} else if err == models.ErrRepoAlreadyExist {
- ctx.RenderWithErr("Repository name has already been used", "repo/create", &form)
+ ctx.RenderWithErr("Repository name has already been used", CREATE, &form)
return
} else if err == models.ErrRepoNameIllegal {
- ctx.RenderWithErr(models.ErrRepoNameIllegal.Error(), "repo/create", &form)
+ ctx.RenderWithErr(models.ErrRepoNameIllegal.Error(), CREATE, &form)
return
}
if repo != nil {
if errDelete := models.DeleteRepository(ctx.User.Id, repo.Id, ctx.User.Name); errDelete != nil {
- log.Error("repo.MigratePost(CreatePost): %v", errDelete)
+ log.Error("repo.CreatePost(DeleteRepository): %v", errDelete)
}
}
- ctx.Handle(500, "repo.Create", err)
+ ctx.Handle(500, "repo.CreatePost", err)
}
func Migrate(ctx *middleware.Context) {
ctx.Data["Title"] = "Migrate repository"
ctx.Data["PageIsNewRepo"] = true
- ctx.HTML(200, "repo/migrate")
+ ctx.HTML(200, MIGRATE)
}
func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) {
@@ -77,7 +83,7 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) {
ctx.Data["PageIsNewRepo"] = true
if ctx.HasError() {
- ctx.HTML(200, "repo/migrate")
+ ctx.HTML(200, MIGRATE)
return
}
@@ -91,10 +97,10 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) {
ctx.Redirect("/" + ctx.User.Name + "/" + form.RepoName)
return
} else if err == models.ErrRepoAlreadyExist {
- ctx.RenderWithErr("Repository name has already been used", "repo/migrate", &form)
+ ctx.RenderWithErr("Repository name has already been used", MIGRATE, &form)
return
} else if err == models.ErrRepoNameIllegal {
- ctx.RenderWithErr(models.ErrRepoNameIllegal.Error(), "repo/migrate", &form)
+ ctx.RenderWithErr(models.ErrRepoNameIllegal.Error(), MIGRATE, &form)
return
}
@@ -105,7 +111,7 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) {
}
if strings.Contains(err.Error(), "Authentication failed") {
- ctx.RenderWithErr(err.Error(), "repo/migrate", &form)
+ ctx.RenderWithErr(err.Error(), MIGRATE, &form)
return
}
ctx.Handle(500, "repo.Migrate", err)
@@ -291,7 +297,7 @@ func Single(ctx *middleware.Context, params martini.Params) {
ctx.Data["Treenames"] = treenames
ctx.Data["TreePath"] = treePath
ctx.Data["BranchLink"] = branchLink
- ctx.HTML(200, "repo/single")
+ ctx.HTML(200, SINGLE)
}
func basicEncode(username, password string) string {
@@ -318,7 +324,7 @@ func basicDecode(encoded string) (user string, name string, err error) {
func authRequired(ctx *middleware.Context) {
ctx.ResponseWriter.Header().Set("WWW-Authenticate", "Basic realm=\".\"")
ctx.Data["ErrorMsg"] = "no basic auth and digit auth"
- ctx.HTML(401, fmt.Sprintf("status/401"))
+ ctx.HTML(401, base.TplName("status/401"))
}
func Action(ctx *middleware.Context, params martini.Params) {
diff --git a/routers/repo/setting.go b/routers/repo/setting.go
index 6313971c..6479cb30 100644
--- a/routers/repo/setting.go
+++ b/routers/repo/setting.go
@@ -20,10 +20,19 @@ import (
"github.com/gogits/gogs/modules/setting"
)
+const (
+ SETTING base.TplName = "repo/setting"
+ COLLABORATION base.TplName = "repo/collaboration"
+
+ HOOKS base.TplName = "repo/hooks"
+ HOOK_ADD base.TplName = "repo/hook_add"
+ HOOK_EDIT base.TplName = "repo/hook_edit"
+)
+
func Setting(ctx *middleware.Context) {
ctx.Data["IsRepoToolbarSetting"] = true
ctx.Data["Title"] = strings.TrimPrefix(ctx.Repo.RepoLink, "/") + " - settings"
- ctx.HTML(200, "repo/setting")
+ ctx.HTML(200, SETTING)
}
func SettingPost(ctx *middleware.Context, form auth.RepoSettingForm) {
@@ -32,7 +41,7 @@ func SettingPost(ctx *middleware.Context, form auth.RepoSettingForm) {
switch ctx.Query("action") {
case "update":
if ctx.HasError() {
- ctx.HTML(200, "repo/setting")
+ ctx.HTML(200, SETTING)
return
}
@@ -44,7 +53,7 @@ func SettingPost(ctx *middleware.Context, form auth.RepoSettingForm) {
ctx.Handle(500, "setting.SettingPost(update: check existence)", err)
return
} else if isExist {
- ctx.RenderWithErr("Repository name has been taken in your repositories.", "repo/setting", nil)
+ ctx.RenderWithErr("Repository name has been taken in your repositories.", SETTING, nil)
return
} else if err = models.ChangeRepositoryName(ctx.Repo.Owner.Name, ctx.Repo.Repository.Name, newRepoName); err != nil {
ctx.Handle(500, "setting.SettingPost(change repository name)", err)
@@ -84,7 +93,7 @@ func SettingPost(ctx *middleware.Context, form auth.RepoSettingForm) {
ctx.Redirect(fmt.Sprintf("/%s/%s/settings", ctx.Repo.Owner.Name, ctx.Repo.Repository.Name))
case "transfer":
if len(ctx.Repo.Repository.Name) == 0 || ctx.Repo.Repository.Name != ctx.Query("repository") {
- ctx.RenderWithErr("Please make sure you entered repository name is correct.", "repo/setting", nil)
+ ctx.RenderWithErr("Please make sure you entered repository name is correct.", SETTING, nil)
return
} else if ctx.Repo.Repository.IsMirror {
ctx.Error(404)
@@ -98,7 +107,7 @@ func SettingPost(ctx *middleware.Context, form auth.RepoSettingForm) {
ctx.Handle(500, "setting.SettingPost(transfer: check existence)", err)
return
} else if !isExist {
- ctx.RenderWithErr("Please make sure you entered owner name is correct.", "repo/setting", nil)
+ ctx.RenderWithErr("Please make sure you entered owner name is correct.", SETTING, nil)
return
} else if err = models.TransferOwnership(ctx.User, newOwner, ctx.Repo.Repository); err != nil {
ctx.Handle(500, "setting.SettingPost(transfer repository)", err)
@@ -109,7 +118,7 @@ func SettingPost(ctx *middleware.Context, form auth.RepoSettingForm) {
ctx.Redirect("/")
case "delete":
if len(ctx.Repo.Repository.Name) == 0 || ctx.Repo.Repository.Name != ctx.Query("repository") {
- ctx.RenderWithErr("Please make sure you entered repository name is correct.", "repo/setting", nil)
+ ctx.RenderWithErr("Please make sure you entered repository name is correct.", SETTING, nil)
return
}
@@ -156,7 +165,7 @@ func Collaboration(ctx *middleware.Context) {
}
ctx.Data["Collaborators"] = us
- ctx.HTML(200, "repo/collaboration")
+ ctx.HTML(200, COLLABORATION)
}
func CollaborationPost(ctx *middleware.Context) {
@@ -226,13 +235,13 @@ func WebHooks(ctx *middleware.Context) {
}
ctx.Data["Webhooks"] = ws
- ctx.HTML(200, "repo/hooks")
+ ctx.HTML(200, HOOKS)
}
func WebHooksAdd(ctx *middleware.Context) {
ctx.Data["IsRepoToolbarWebHooks"] = true
ctx.Data["Title"] = strings.TrimPrefix(ctx.Repo.RepoLink, "/") + " - Add Webhook"
- ctx.HTML(200, "repo/hooks_add")
+ ctx.HTML(200, HOOK_ADD)
}
func WebHooksAddPost(ctx *middleware.Context, form auth.NewWebhookForm) {
@@ -240,7 +249,7 @@ func WebHooksAddPost(ctx *middleware.Context, form auth.NewWebhookForm) {
ctx.Data["Title"] = strings.TrimPrefix(ctx.Repo.RepoLink, "/") + " - Add Webhook"
if ctx.HasError() {
- ctx.HTML(200, "repo/hooks_add")
+ ctx.HTML(200, HOOK_ADD)
return
}
@@ -293,40 +302,46 @@ func WebHooksEdit(ctx *middleware.Context, params martini.Params) {
w.GetEvent()
ctx.Data["Webhook"] = w
- ctx.HTML(200, "repo/hooks_edit")
+ ctx.HTML(200, HOOK_EDIT)
}
func WebHooksEditPost(ctx *middleware.Context, params martini.Params, form auth.NewWebhookForm) {
ctx.Data["IsRepoToolbarWebHooks"] = true
ctx.Data["Title"] = strings.TrimPrefix(ctx.Repo.RepoLink, "/") + " - Webhook"
- if ctx.HasError() {
- ctx.HTML(200, "repo/hooks_add")
- return
- }
-
hookId, _ := base.StrTo(params["id"]).Int64()
if hookId == 0 {
ctx.Handle(404, "setting.WebHooksEditPost", nil)
return
}
+ w, err := models.GetWebhookById(hookId)
+ if err != nil {
+ if err == models.ErrWebhookNotExist {
+ ctx.Handle(404, "setting.WebHooksEditPost(GetWebhookById)", nil)
+ } else {
+ ctx.Handle(500, "setting.WebHooksEditPost(GetWebhookById)", err)
+ }
+ return
+ }
+
+ if ctx.HasError() {
+ ctx.HTML(200, HOOK_EDIT)
+ return
+ }
+
ct := models.JSON
if form.ContentType == "2" {
ct = models.FORM
}
- w := &models.Webhook{
- Id: hookId,
- RepoId: ctx.Repo.Repository.Id,
- Url: form.Url,
- ContentType: ct,
- Secret: form.Secret,
- HookEvent: &models.HookEvent{
- PushOnly: form.PushOnly,
- },
- IsActive: form.Active,
+ w.Url = form.Url
+ w.ContentType = ct
+ w.Secret = form.Secret
+ w.HookEvent = &models.HookEvent{
+ PushOnly: form.PushOnly,
}
+ w.IsActive = form.Active
if err := w.UpdateEvent(); err != nil {
ctx.Handle(500, "setting.WebHooksEditPost(UpdateEvent)", err)
return
diff --git a/routers/user/home.go b/routers/user/home.go
index a9674ac2..0f2cee25 100644
--- a/routers/user/home.go
+++ b/routers/user/home.go
@@ -17,6 +17,14 @@ import (
"github.com/gogits/gogs/modules/middleware"
)
+const (
+ DASHBOARD base.TplName = "user/dashboard"
+ PROFILE base.TplName = "user/profile"
+ ISSUES base.TplName = "user/issue"
+ PULLS base.TplName = "user/pulls"
+ STARS base.TplName = "user/stars"
+)
+
func Dashboard(ctx *middleware.Context) {
ctx.Data["Title"] = "Dashboard"
ctx.Data["PageIsUserDashboard"] = true
@@ -52,14 +60,14 @@ func Dashboard(ctx *middleware.Context) {
feeds = append(feeds, act)
}
ctx.Data["Feeds"] = feeds
- ctx.HTML(200, "user/dashboard")
+ ctx.HTML(200, DASHBOARD)
}
func Profile(ctx *middleware.Context, params martini.Params) {
ctx.Data["Title"] = "Profile"
ctx.Data["PageIsUserProfile"] = true
- user, err := models.GetUserByName(params["username"])
+ u, err := models.GetUserByName(params["username"])
if err != nil {
if err == models.ErrUserNotExist {
ctx.Handle(404, "user.Profile(GetUserByName)", err)
@@ -68,26 +76,30 @@ func Profile(ctx *middleware.Context, params martini.Params) {
}
return
}
- ctx.Data["Owner"] = user
+ // For security reason, hide e-mail address for anonymous visitors.
+ if !ctx.IsSigned {
+ u.Email = ""
+ }
+ ctx.Data["Owner"] = u
tab := ctx.Query("tab")
ctx.Data["TabName"] = tab
switch tab {
case "activity":
- ctx.Data["Feeds"], err = models.GetFeeds(user.Id, 0, true)
+ ctx.Data["Feeds"], err = models.GetFeeds(u.Id, 0, true)
if err != nil {
ctx.Handle(500, "user.Profile(GetFeeds)", err)
return
}
default:
- ctx.Data["Repos"], err = models.GetRepositories(user.Id, ctx.IsSigned && ctx.User.Id == user.Id)
+ ctx.Data["Repos"], err = models.GetRepositories(u.Id, ctx.IsSigned && ctx.User.Id == u.Id)
if err != nil {
ctx.Handle(500, "user.Profile(GetRepositories)", err)
return
}
}
- ctx.HTML(200, "user/profile")
+ ctx.HTML(200, PROFILE)
}
func Email2User(ctx *middleware.Context) {
@@ -254,13 +266,13 @@ func Issues(ctx *middleware.Context) {
} else {
ctx.Data["ShowCount"] = issueStats.OpenCount
}
- ctx.HTML(200, "user/issue")
+ ctx.HTML(200, ISSUES)
}
func Pulls(ctx *middleware.Context) {
- ctx.HTML(200, "user/pulls")
+ ctx.HTML(200, PULLS)
}
func Stars(ctx *middleware.Context) {
- ctx.HTML(200, "user/stars")
+ ctx.HTML(200, STARS)
}
diff --git a/routers/user/setting.go b/routers/user/setting.go
index 1fae516a..9075ee0b 100644
--- a/routers/user/setting.go
+++ b/routers/user/setting.go
@@ -14,12 +14,21 @@ import (
"github.com/gogits/gogs/modules/middleware"
)
+const (
+ SETTING base.TplName = "user/setting"
+ SOCIAL base.TplName = "user/social"
+ PASSWORD base.TplName = "user/password"
+ PUBLICKEY base.TplName = "user/publickey"
+ NOTIFICATION base.TplName = "user/notification"
+ SECURITY base.TplName = "user/security"
+)
+
func Setting(ctx *middleware.Context) {
ctx.Data["Title"] = "Setting"
ctx.Data["PageIsUserSetting"] = true
ctx.Data["IsUserPageSetting"] = true
ctx.Data["Owner"] = ctx.User
- ctx.HTML(200, "user/setting")
+ ctx.HTML(200, SETTING)
}
func SettingPost(ctx *middleware.Context, form auth.UpdateProfileForm) {
@@ -28,7 +37,7 @@ func SettingPost(ctx *middleware.Context, form auth.UpdateProfileForm) {
ctx.Data["IsUserPageSetting"] = true
if ctx.HasError() {
- ctx.HTML(200, "user/setting")
+ ctx.HTML(200, SETTING)
return
}
@@ -90,14 +99,14 @@ func SettingSocial(ctx *middleware.Context) {
ctx.Handle(500, "user.SettingSocial(GetOauthByUserId)", err)
return
}
- ctx.HTML(200, "user/social")
+ ctx.HTML(200, SOCIAL)
}
func SettingPassword(ctx *middleware.Context) {
ctx.Data["Title"] = "Password"
ctx.Data["PageIsUserSetting"] = true
ctx.Data["IsUserPageSettingPasswd"] = true
- ctx.HTML(200, "user/password")
+ ctx.HTML(200, PASSWORD)
}
func SettingPasswordPost(ctx *middleware.Context, form auth.UpdatePasswdForm) {
@@ -106,7 +115,7 @@ func SettingPasswordPost(ctx *middleware.Context, form auth.UpdatePasswdForm) {
ctx.Data["IsUserPageSettingPasswd"] = true
if ctx.HasError() {
- ctx.HTML(200, "user/password")
+ ctx.HTML(200, PASSWORD)
return
}
@@ -207,7 +216,7 @@ func SettingSSHKeys(ctx *middleware.Context, form auth.AddSSHKeyForm) {
}
}
- ctx.HTML(200, "user/publickey")
+ ctx.HTML(200, PUBLICKEY)
}
func SettingNotification(ctx *middleware.Context) {
@@ -215,7 +224,7 @@ func SettingNotification(ctx *middleware.Context) {
ctx.Data["Title"] = "Notification"
ctx.Data["PageIsUserSetting"] = true
ctx.Data["IsUserPageSettingNotify"] = true
- ctx.HTML(200, "user/notification")
+ ctx.HTML(200, NOTIFICATION)
}
func SettingSecurity(ctx *middleware.Context) {
@@ -223,5 +232,5 @@ func SettingSecurity(ctx *middleware.Context) {
ctx.Data["Title"] = "Security"
ctx.Data["PageIsUserSetting"] = true
ctx.Data["IsUserPageSettingSecurity"] = true
- ctx.HTML(200, "user/security")
+ ctx.HTML(200, SECURITY)
}
diff --git a/routers/user/user.go b/routers/user/user.go
index 8fcbeb6a..8144730e 100644
--- a/routers/user/user.go
+++ b/routers/user/user.go
@@ -17,12 +17,21 @@ import (
"github.com/gogits/gogs/modules/setting"
)
+const (
+ SIGNIN base.TplName = "user/signin"
+ SIGNUP base.TplName = "user/signup"
+ DELETE base.TplName = "user/delete"
+ ACTIVATE base.TplName = "user/activate"
+ FORGOT_PASSWORD base.TplName = "user/forgot_passwd"
+ RESET_PASSWORD base.TplName = "user/reset_passwd"
+)
+
func SignIn(ctx *middleware.Context) {
ctx.Data["Title"] = "Log In"
if _, ok := ctx.Session.Get("socialId").(int64); ok {
ctx.Data["IsSocialLogin"] = true
- ctx.HTML(200, "user/signin")
+ ctx.HTML(200, SIGNIN)
return
}
@@ -34,7 +43,7 @@ func SignIn(ctx *middleware.Context) {
// Check auto-login.
uname := ctx.GetCookie(setting.CookieUserName)
if len(uname) == 0 {
- ctx.HTML(200, "user/signin")
+ ctx.HTML(200, SIGNIN)
return
}
@@ -57,7 +66,7 @@ func SignIn(ctx *middleware.Context) {
secret := base.EncodeMd5(user.Rands + user.Passwd)
value, _ := ctx.GetSecureCookie(secret, setting.CookieRememberName)
if value != user.Name {
- ctx.HTML(200, "user/signin")
+ ctx.HTML(200, SIGNIN)
return
}
@@ -86,7 +95,7 @@ func SignInPost(ctx *middleware.Context, form auth.LogInForm) {
}
if ctx.HasError() {
- ctx.HTML(200, "user/signin")
+ ctx.HTML(200, SIGNIN)
return
}
@@ -94,7 +103,7 @@ func SignInPost(ctx *middleware.Context, form auth.LogInForm) {
if err != nil {
if err == models.ErrUserNotExist {
log.Trace("%s Log in failed: %s", ctx.Req.RequestURI, form.UserName)
- ctx.RenderWithErr("Username or password is not correct", "user/signin", &form)
+ ctx.RenderWithErr("Username or password is not correct", SIGNIN, &form)
return
}
@@ -151,7 +160,7 @@ func SignUp(ctx *middleware.Context) {
if setting.Service.DisableRegistration {
ctx.Data["DisableRegistration"] = true
- ctx.HTML(200, "user/signup")
+ ctx.HTML(200, SIGNUP)
return
}
@@ -160,7 +169,7 @@ func SignUp(ctx *middleware.Context) {
return
}
- ctx.HTML(200, "user/signup")
+ ctx.HTML(200, SIGNUP)
}
func oauthSignUp(ctx *middleware.Context, sid int64) {
@@ -180,7 +189,7 @@ func oauthSignUp(ctx *middleware.Context, sid int64) {
ctx.Data["username"] = strings.Replace(ctx.Session.Get("socialName").(string), " ", "", -1)
ctx.Data["email"] = ctx.Session.Get("socialEmail")
log.Trace("user.oauthSignUp(social ID): %v", ctx.Session.Get("socialId"))
- ctx.HTML(200, "user/signup")
+ ctx.HTML(200, SIGNUP)
}
func SignUpPost(ctx *middleware.Context, form auth.RegisterForm) {
@@ -198,14 +207,14 @@ func SignUpPost(ctx *middleware.Context, form auth.RegisterForm) {
}
if ctx.HasError() {
- ctx.HTML(200, "user/signup")
+ ctx.HTML(200, SIGNUP)
return
}
if form.Password != form.RetypePasswd {
ctx.Data["Err_Password"] = true
ctx.Data["Err_RetypePasswd"] = true
- ctx.RenderWithErr("Password and re-type password are not same.", "user/signup", &form)
+ ctx.RenderWithErr("Password and re-type password are not same.", SIGNUP, &form)
return
}
@@ -221,12 +230,12 @@ func SignUpPost(ctx *middleware.Context, form auth.RegisterForm) {
switch err {
case models.ErrUserAlreadyExist:
ctx.Data["Err_UserName"] = true
- ctx.RenderWithErr("Username has been already taken", "user/signup", &form)
+ ctx.RenderWithErr("Username has been already taken", SIGNUP, &form)
case models.ErrEmailAlreadyUsed:
ctx.Data["Err_Email"] = true
- ctx.RenderWithErr("E-mail address has been already used", "user/signup", &form)
+ ctx.RenderWithErr("E-mail address has been already used", SIGNUP, &form)
case models.ErrUserNameIllegal:
- ctx.RenderWithErr(models.ErrRepoNameIllegal.Error(), "user/signup", &form)
+ ctx.RenderWithErr(models.ErrRepoNameIllegal.Error(), SIGNUP, &form)
default:
ctx.Handle(500, "user.SignUpPost(RegisterUser)", err)
}
@@ -265,7 +274,7 @@ func Delete(ctx *middleware.Context) {
ctx.Data["Title"] = "Delete Account"
ctx.Data["PageIsUserSetting"] = true
ctx.Data["IsUserPageSettingDelete"] = true
- ctx.HTML(200, "user/delete")
+ ctx.HTML(200, DELETE)
}
func DeletePost(ctx *middleware.Context) {
@@ -321,7 +330,7 @@ func Activate(ctx *middleware.Context) {
} else {
ctx.Data["ServiceNotEnabled"] = true
}
- ctx.HTML(200, "user/activate")
+ ctx.HTML(200, ACTIVATE)
return
}
@@ -343,7 +352,7 @@ func Activate(ctx *middleware.Context) {
}
ctx.Data["IsActivateFailed"] = true
- ctx.HTML(200, "user/activate")
+ ctx.HTML(200, ACTIVATE)
}
func ForgotPasswd(ctx *middleware.Context) {
@@ -351,12 +360,12 @@ func ForgotPasswd(ctx *middleware.Context) {
if setting.MailService == nil {
ctx.Data["IsResetDisable"] = true
- ctx.HTML(200, "user/forgot_passwd")
+ ctx.HTML(200, FORGOT_PASSWORD)
return
}
ctx.Data["IsResetRequest"] = true
- ctx.HTML(200, "user/forgot_passwd")
+ ctx.HTML(200, FORGOT_PASSWORD)
}
func ForgotPasswdPost(ctx *middleware.Context) {
@@ -381,7 +390,7 @@ func ForgotPasswdPost(ctx *middleware.Context) {
if ctx.Cache.IsExist("MailResendLimit_" + u.LowerName) {
ctx.Data["ResendLimited"] = true
- ctx.HTML(200, "user/forgot_passwd")
+ ctx.HTML(200, FORGOT_PASSWORD)
return
}
@@ -393,7 +402,7 @@ func ForgotPasswdPost(ctx *middleware.Context) {
ctx.Data["Email"] = email
ctx.Data["Hours"] = setting.Service.ActiveCodeLives / 60
ctx.Data["IsResetSent"] = true
- ctx.HTML(200, "user/forgot_passwd")
+ ctx.HTML(200, FORGOT_PASSWORD)
}
func ResetPasswd(ctx *middleware.Context) {
@@ -406,7 +415,7 @@ func ResetPasswd(ctx *middleware.Context) {
}
ctx.Data["Code"] = code
ctx.Data["IsResetForm"] = true
- ctx.HTML(200, "user/reset_passwd")
+ ctx.HTML(200, RESET_PASSWORD)
}
func ResetPasswdPost(ctx *middleware.Context) {
@@ -443,5 +452,5 @@ func ResetPasswdPost(ctx *middleware.Context) {
}
ctx.Data["IsResetFailed"] = true
- ctx.HTML(200, "user/reset_passwd")
+ ctx.HTML(200, RESET_PASSWORD)
}
diff --git a/templates/VERSION b/templates/VERSION
index 7d143dcc..ca3b3f1b 100644
--- a/templates/VERSION
+++ b/templates/VERSION
@@ -1 +1 @@
-0.4.5.0621 Alpha \ No newline at end of file
+0.4.5.0623 Alpha \ No newline at end of file
diff --git a/templates/admin/auths/edit.tmpl b/templates/admin/auth/edit.tmpl
index a2c2ddc6..a2c2ddc6 100644
--- a/templates/admin/auths/edit.tmpl
+++ b/templates/admin/auth/edit.tmpl
diff --git a/templates/admin/auths/new.tmpl b/templates/admin/auth/new.tmpl
index abb88043..abb88043 100644
--- a/templates/admin/auths/new.tmpl
+++ b/templates/admin/auth/new.tmpl
diff --git a/templates/admin/users/edit.tmpl b/templates/admin/user/edit.tmpl
index b1fffb69..b1fffb69 100644
--- a/templates/admin/users/edit.tmpl
+++ b/templates/admin/user/edit.tmpl
diff --git a/templates/admin/users/new.tmpl b/templates/admin/user/new.tmpl
index 4f4866c4..4f4866c4 100644
--- a/templates/admin/users/new.tmpl
+++ b/templates/admin/user/new.tmpl
diff --git a/templates/mail/auth/active_email.tmpl b/templates/mail/auth/active.tmpl
index 72d9948b..72d9948b 100644
--- a/templates/mail/auth/active_email.tmpl
+++ b/templates/mail/auth/active.tmpl
diff --git a/templates/org/dashboard.tmpl b/templates/org/dashboard.tmpl
new file mode 100644
index 00000000..f86de1f4
--- /dev/null
+++ b/templates/org/dashboard.tmpl
@@ -0,0 +1,73 @@
+{{template "base/head" .}}
+{{template "base/navbar" .}}
+<div id="body-nav">
+ <div class="container">
+ <div class="btn-group pull-left" id="dashboard-switch">
+ <button type="button" class="btn btn-default">
+ <img src="//1.gravatar.com/avatar/f72f7454ce9d710baa506394f68f4132?s=28" alt="user-avatar" title="username">
+ gogits
+ </button>
+ <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
+ <span class="caret"></span>
+ </button>
+ <div class="dropdown-menu clone-group-btn no-propagation">
+ <ul id="dashboard-switch-menu" class="list-unstyled">
+ <li class="checked"><a href="#"><i class="fa fa-check"></i>
+ <img src="//1.gravatar.com/avatar/f72f7454ce9d710baa506394f68f4132?s=28" alt="user-avatar" title="username">
+ gogits/gogs</a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ <ul class="nav nav-pills pull-right">
+ <li class="active"><a href="/">Feed</a></li>
+ <li><a href="/issues">Issues</a></li>
+ <li><a href="#">Setting</a></li>
+ <!-- <li><a href="/pulls">Pull Requests</a></li>
+ <li><a href="/stars">Stars</a></li> -->
+ </ul>
+ <h3>News Feed</h3>
+ </div>
+</div>
+<div id="body" class="container" data-page="user">
+ {{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}}
+ <div id="feed-left" class="col-md-8">
+ <ul class="list-unstyled activity-list">
+ {{range .Feeds}}
+ <li>
+ <i class="icon fa fa-{{ActionIcon .OpType}}"></i>
+ <div class="info"><span class="meta">{{TimeSince .Created}}</span><br>{{ActionDesc . | str2html}}</div>
+ <span class="clearfix"></span>
+ </li>
+ {{else}}
+ <li>Oh. Looks like there isn't any activity here yet. Get Busy!</li>
+ {{end}}
+ </ul>
+ </div>
+ <div id="feed-right" class="col-md-4">
+ <div class="panel panel-default repo-panel">
+ <div class="panel-heading">Repositories
+ <div class="btn-group pull-right" id="user-dashboard-repo-new">
+ <button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus-square"></i>New</button>
+ <div class="dropdown-menu dropdown-menu-right">
+ <ul class="list-unstyled">
+ <li><a href="/repo/create"><i class="fa fa-book"></i>Repository</a></li>
+ <li><a href="/repo/migrate"><i class="fa fa-clipboard"></i>Migration</a></li>
+ <!-- <li><a href="#"><i class="fa fa-users"></i>Organization</a></li> -->
+ </ul>
+ </div>
+ </div>
+ </div>
+
+ <div class="panel-body">
+ <ul class="list-group">{{range .MyRepos}}
+ <li class="list-group-item"><a href="/{{$.SignedUserName}}/{{.Name}}">
+ <!-- <span class="stars pull-right"><i class="fa fa-star"></i>{{.NumStars}}</span> -->
+ <i class="fa fa-book"></i>{{.Name}}{{if .IsPrivate}} <span class="label label-default">Private</span>{{end}}</a>
+ </li>{{end}}
+ </ul>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/org/members.tmpl b/templates/org/members.tmpl
new file mode 100644
index 00000000..ba14cb4c
--- /dev/null
+++ b/templates/org/members.tmpl
@@ -0,0 +1,56 @@
+{{template "base/head" .}}
+{{template "base/navbar" .}}
+<div id="body-nav" class="org-nav org-nav-auto">
+ <div class="container clearfix">
+ <div id="org-nav-wrapper">
+ <ul class="nav nav-pills pull-right">
+ <li class="active"><a href="#"><i class="fa fa-users"></i>Members
+ <span class="label label-default">5</span></a>
+ </li>
+ <li><a href="#"><i class="fa fa-tags"></i>Teams
+ <span class="label label-default">2</span></a>
+ </li>
+ </ul>
+ <img class="pull-left org-small-logo" src="https://avatars3.githubusercontent.com/u/6656686?s=140" alt="" width="60"/>
+ <div id="org-nav-info">
+ <h2 class="org-name">Organization Name</h2>
+ </div>
+ </div>
+
+ </div>
+</div>
+<div id="body" class="container">
+ <div id="org">
+ <div id="org-members">
+ <div class="member">&nbsp;
+ <div class="avatar col-md-1">
+ <img src="https://avatars3.githubusercontent.com/u/2142787?s=140" alt=""/>
+ </div>
+ <div class="name col-md-4">
+ <a href="#"><strong>fuxiaohei</strong><span class="nick">傅小黑</span></a>
+ </div>
+ <div class="role col-md-2 pull-right">
+ <strong>Member</strong>
+ </div>
+ <div class="status col-md-1 pull-right">
+ <strong>Public</strong>
+ </div>
+ </div>
+ <div class="member">&nbsp;
+ <div class="avatar col-md-1">
+ <img src="https://avatars3.githubusercontent.com/u/2142787?s=140" alt=""/>
+ </div>
+ <div class="name col-md-4">
+ <a href="#"><strong>fuxiaohei</strong><span class="nick">傅小黑</span></a>
+ </div>
+ <div class="role col-md-2 pull-right">
+ <strong><i class="fa fa-user"></i>Owner</strong>
+ </div>
+ <div class="status col-md-1 pull-right">
+ <i class="fa fa-lock"></i>Private
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/org/new.tmpl b/templates/org/new.tmpl
new file mode 100644
index 00000000..baa9c9df
--- /dev/null
+++ b/templates/org/new.tmpl
@@ -0,0 +1,48 @@
+{{template "base/head" .}}
+{{template "base/navbar" .}}
+<div class="container" id="body">
+ <form action="/repo/create" method="post" class="form-horizontal card" id="org-create">
+ {{.CsrfTokenHtml}}
+ <h3>Create New Organization</h3>
+ {{template "base/alert" .}}
+ <div class="form-group">
+ <label class="col-md-2 control-label">Owner<strong class="text-danger">*</strong></label>
+ <div class="col-md-8">
+ <p class="form-control-static">{{.SignedUserName}}</p>
+ <input type="hidden" value="{{.SignedUserId}}" name="userId"/>
+ </div>
+ </div>
+
+ <div class="form-group {{if .Err_RepoName}}has-error has-feedback{{end}}">
+ <label class="col-md-2 control-label">Organization<strong class="text-danger">*</strong></label>
+ <div class="col-md-8">
+ <input name="repo" type="text" class="form-control" placeholder="Type your repository name" value="{{.repo}}" required="required">
+ <span class="help-block">Great organization names are short and memorable. </span>
+ </div>
+ </div>
+
+ <div class="form-group {{if .Err_Email}}has-error has-feedback{{end}}">
+ <label class="col-md-2 control-label">Email<strong class="text-danger">*</strong></label>
+ <div class="col-md-8">
+ <input name="email" type="text" class="form-control" placeholder="Type organization's email" value="" required="required">
+ <span class="help-block">Organization's Email receives all notifications and confirmations.</span>
+ </div>
+ </div>
+<!--
+ <div class="form-group">
+ <label class="col-md-2 control-label">Owners<strong class="text-danger">*</strong></label>
+ <div class="col-md-8">
+ owners
+ </div>
+ </div>-->
+
+
+ <div class="form-group">
+ <div class="col-md-offset-2 col-md-8">
+ <button type="submit" class="btn btn-lg btn-primary">Create An Organization</button>
+ <a href="/" class="text-danger">Cancel</a>
+ </div>
+ </div>
+ </form>
+</div>
+{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/org/setting.tmpl b/templates/org/setting.tmpl
new file mode 100644
index 00000000..1be9707a
--- /dev/null
+++ b/templates/org/setting.tmpl
@@ -0,0 +1,151 @@
+{{template "base/head" .}}
+{{template "base/navbar" .}}
+<div id="body-nav">
+ <div class="container">
+ <div class="btn-group pull-left" id="dashboard-switch">
+ <button type="button" class="btn btn-default">
+ <img src="//1.gravatar.com/avatar/f72f7454ce9d710baa506394f68f4132?s=28" alt="user-avatar"
+ title="username">
+ gogits
+ </button>
+ <!--
+ <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
+ <span class="caret"></span>
+ </button>
+ <div class="dropdown-menu clone-group-btn no-propagation">
+ <ul id="dashboard-switch-menu" class="list-unstyled">
+ <li class="checked"><a href="#"><i class="fa fa-check"></i>
+ <img src="//1.gravatar.com/avatar/f72f7454ce9d710baa506394f68f4132?s=28" alt="user-avatar" title="username">
+ gogits/gogs</a>
+ </li>
+ </ul>
+ </div>-->
+ </div>
+ <ul class="nav nav-pills pull-right">
+ <li><a href="/">Feed</a></li>
+ <li><a href="/issues">Issues</a></li>
+ <li class="active"><a href="#">Setting</a></li>
+ <!-- <li><a href="/pulls">Pull Requests</a></li>
+ <li><a href="/stars">Stars</a></li> -->
+ </ul>
+ </div>
+</div>
+<div id="body" class="container" data-page="org">
+ <div id="user-setting-nav" class="col-md-2 repo-setting-nav">
+ <ul class="list-group">
+ <li class="list-group-item active"><a href="#">Options</a></li>
+ </ul>
+ </div>
+ <div id="repo-setting-container" class="col-md-10">
+ {{template "base/alert" .}}
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ Repository Options
+ </div>
+
+ <div class="panel-body">
+ <form action="/{{.Owner.Name}}/{{.Repository.Name}}/settings" method="post" class="form-horizontal">
+ {{.CsrfTokenHtml}}
+ <input type="hidden" name="action" value="update">
+
+ <div class="form-group">
+ <label class="col-md-3 text-right" for="org-setting-name">Name</label>
+
+ <div class="col-md-9">
+ <input class="form-control" name="name" value="" title="" id="org-setting-name"/>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label class="col-md-3 text-right" for="org-email">Email</label>
+
+ <div class="col-md-9">
+ <input class="form-control" name="email" value="" title="" id="org-email" type="email"/>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label class="col-md-3 text-right" for="org-desc">Description</label>
+
+ <div class="col-md-9">
+ <textarea class="form-control" name="desc" id="org-desc" rows="3">{{.Repository.Description}}</textarea>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label class="col-md-3 text-right" for="org-site">Official Site</label>
+
+ <div class="col-md-9">
+ <input type="url" class="form-control" name="site" value="{{.Repository.Website}}"
+ id="org-site"/>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label class="col-md-3 text-right" for="org-location">Location</label>
+
+ <div class="col-md-9">
+ <input class="form-control" name="email" value="" title="" id="org-location"/>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <div class="col-md-9 col-md-offset-3">
+ <button class="btn btn-primary" type="submit">Save Options</button>
+ </div>
+ </div>
+ </form>
+ </div>
+ </div>
+
+ <div class="panel panel-warning">
+ <div class="panel-heading">
+ Danger Zone
+ </div>
+ <div class="panel-body">
+ <button type="button" class="btn btn-default pull-right" href="#delete-org-modal" data-toggle="modal">
+ Delete this organization
+ </button>
+ <dd>
+ <dt>Delete this organization</dt>
+ <dl>Once you delete this organization and all repositories in, there is no going back. Please be
+ certain.
+ </dl>
+ </dd>
+
+ <div class="modal fade" id="delete-org-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
+ aria-hidden="true">
+ <div class="modal-dialog">
+ <form action="/{{.Owner.Name}}/{{.Repository.Name}}/settings" method="post"
+ class="modal-content">
+ {{.CsrfTokenHtml}}
+ <input type="hidden" name="action" value="delete">
+
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal"
+ aria-hidden="true">&times;</button>
+ <h4 class="modal-title" id="myModalLabel">Delete organization</h4>
+ </div>
+
+ <div class="modal-body">
+ <div class="form-group">
+ <label>Please enter your organization name "<strong class="text-danger">{{.Repository.Name}}</strong>"</label>
+ <input name="organization" class="form-control" type="text"
+ placeholder="Type your organization name" required="required">
+ </div>
+ </div>
+
+ <div class="modal-footer">
+ <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
+ <button class="btn btn-danger btn-lg">I understand the consequences, delete this
+ organization
+ </button>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/org/teams.tmpl b/templates/org/teams.tmpl
new file mode 100644
index 00000000..a8218812
--- /dev/null
+++ b/templates/org/teams.tmpl
@@ -0,0 +1,65 @@
+{{template "base/head" .}}
+{{template "base/navbar" .}}
+<div id="body-nav" class="org-nav org-nav-auto">
+ <div class="container clearfix">
+ <div id="org-nav-wrapper">
+ <ul class="nav nav-pills pull-right">
+ <li><a href="#"><i class="fa fa-users"></i>Members
+ <span class="label label-default">5</span></a>
+ </li>
+ <li class="active"><a href="#"><i class="fa fa-tags"></i>Teams
+ <span class="label label-default">2</span></a>
+ </li>
+ </ul>
+ <img class="pull-left org-small-logo" src="https://avatars3.githubusercontent.com/u/6656686?s=140" alt="" width="60"/>
+ <div id="org-nav-info">
+ <h2 class="org-name">Organization Name</h2>
+ </div>
+ </div>
+ </div>
+</div>
+<div id="body" class="container">
+ <div id="org">
+ <div id="org-teams">
+ <div class="org-team col-md-6">
+ <div class="panel panel-default">
+ <h2 class="panel-heading org-team-name"><a href="#"><strong>Team Name</strong></a></h2>
+ <div class="panel-body">
+ <p class="org-team-meta">4 members · 10 repositories</p>
+ <p class="org-team-members">
+ <a href="#">
+ <img class="img-thumbnail" src="https://avatars2.githubusercontent.com/u/2946214?s=60" alt=""/>
+ </a>
+ <a href="#">
+ <img class="img-thumbnail" src="https://avatars2.githubusercontent.com/u/2946214?s=60" alt=""/>
+ </a>
+ </p>
+ </div>
+ <div class="panel-footer">
+ <button class="pull-right btn btn-default">Join</button>
+ </div>
+ </div>
+ </div>
+ <div class="org-team col-md-6">
+ <div class="panel panel-default">
+ <h2 class="panel-heading org-team-name"><a href="#"><strong>Team Name</strong></a></h2>
+ <div class="panel-body">
+ <p class="org-team-meta">4 members · 10 repositories</p>
+ <p class="org-team-members">
+ <a href="#">
+ <img class="img-thumbnail" src="https://avatars2.githubusercontent.com/u/2946214?s=60" alt=""/>
+ </a>
+ <a href="#">
+ <img class="img-thumbnail" src="https://avatars2.githubusercontent.com/u/2946214?s=60" alt=""/>
+ </a>
+ </p>
+ </div>
+ <div class="panel-footer">
+ <button class="pull-right btn btn-danger">Leave</button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/repo/branches.tmpl b/templates/repo/branch.tmpl
index 8d2d59d7..8d2d59d7 100644
--- a/templates/repo/branches.tmpl
+++ b/templates/repo/branch.tmpl
diff --git a/templates/repo/hooks_add.tmpl b/templates/repo/hook_add.tmpl
index df3ff3bd..df3ff3bd 100644
--- a/templates/repo/hooks_add.tmpl
+++ b/templates/repo/hook_add.tmpl
diff --git a/templates/repo/hooks_edit.tmpl b/templates/repo/hook_edit.tmpl
index c3fe217e..c3fe217e 100644
--- a/templates/repo/hooks_edit.tmpl
+++ b/templates/repo/hook_edit.tmpl
diff --git a/templates/issue/create.tmpl b/templates/repo/issue/create.tmpl
index 34cecc78..34cecc78 100644
--- a/templates/issue/create.tmpl
+++ b/templates/repo/issue/create.tmpl
diff --git a/templates/issue/list.tmpl b/templates/repo/issue/list.tmpl
index 0fae3eb6..0fae3eb6 100644
--- a/templates/issue/list.tmpl
+++ b/templates/repo/issue/list.tmpl
diff --git a/templates/issue/milestone.tmpl b/templates/repo/issue/milestone.tmpl
index 8a5751c1..8a5751c1 100644
--- a/templates/issue/milestone.tmpl
+++ b/templates/repo/issue/milestone.tmpl
diff --git a/templates/issue/milestone_edit.tmpl b/templates/repo/issue/milestone_edit.tmpl
index 8f1a05e0..8f1a05e0 100644
--- a/templates/issue/milestone_edit.tmpl
+++ b/templates/repo/issue/milestone_edit.tmpl
diff --git a/templates/issue/milestone_new.tmpl b/templates/repo/issue/milestone_new.tmpl
index 044b7d10..044b7d10 100644
--- a/templates/issue/milestone_new.tmpl
+++ b/templates/repo/issue/milestone_new.tmpl
diff --git a/templates/issue/view.tmpl b/templates/repo/issue/view.tmpl
index ba1fe16b..ba1fe16b 100644
--- a/templates/issue/view.tmpl
+++ b/templates/repo/issue/view.tmpl
diff --git a/templates/release/edit.tmpl b/templates/repo/release/edit.tmpl
index e437092c..e437092c 100644
--- a/templates/release/edit.tmpl
+++ b/templates/repo/release/edit.tmpl
diff --git a/templates/release/list.tmpl b/templates/repo/release/list.tmpl
index 0f02508f..0f02508f 100644
--- a/templates/release/list.tmpl
+++ b/templates/repo/release/list.tmpl
diff --git a/templates/release/new.tmpl b/templates/repo/release/new.tmpl
index 6c5cf40c..6c5cf40c 100644
--- a/templates/release/new.tmpl
+++ b/templates/repo/release/new.tmpl
diff --git a/templates/user/dashboard.tmpl b/templates/user/dashboard.tmpl
index c44ba362..12018ad8 100644
--- a/templates/user/dashboard.tmpl
+++ b/templates/user/dashboard.tmpl
@@ -12,7 +12,9 @@
</button>
<div class="dropdown-menu clone-group-btn no-propagation">
<ul id="dashboard-switch-menu" class="list-unstyled">
- <li class="checked"><a href="#"><i class="fa fa-check"></i> gogits/gogs</a></li>
+ <li class="checked"><a href="#"><i class="fa fa-check"></i>
+ <img src="//1.gravatar.com/avatar/f72f7454ce9d710baa506394f68f4132?s=28" alt="user-avatar" title="username">
+ gogits/gogs</a></li>
</ul>
</div>
</div>
diff --git a/templates/user/issue.tmpl b/templates/user/issues.tmpl
index d1c2bd99..d1c2bd99 100644
--- a/templates/user/issue.tmpl
+++ b/templates/user/issues.tmpl