From e44d9ffd89be84ad0f2ddfe6fc986be8eb8fc032 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 18 Mar 2014 00:14:05 -0400 Subject: [PATCH 1/6] Delete commit and update getlastcommit --- gogs.go | 2 +- models/repo.go | 39 ++++++-------------------------------- routers/repo/single.go | 4 ++-- templates/repo/single.tmpl | 4 ++-- 4 files changed, 11 insertions(+), 38 deletions(-) diff --git a/gogs.go b/gogs.go index 433b9af094..2757fbc115 100644 --- a/gogs.go +++ b/gogs.go @@ -20,7 +20,7 @@ import ( // Test that go1.1 tag above is included in builds. main.go refers to this definition. const go11tag = true -const APP_VER = "0.1.0.0317.1" +const APP_VER = "0.1.0.0318.1" func init() { base.AppVer = APP_VER diff --git a/models/repo.go b/models/repo.go index 6e3754acf5..21d46aa250 100644 --- a/models/repo.go +++ b/models/repo.go @@ -400,15 +400,6 @@ func DeleteRepository(userId, repoId int64, userName string) (err error) { return nil } -// Commit represents a git commit. -type Commit struct { - Author string - Email string - Date time.Time - SHA string - Message string -} - var ( ErrRepoFileNotLoaded = fmt.Errorf("repo file not loaded") ) @@ -553,34 +544,16 @@ func GetReposFiles(userName, reposName, branchName, rpath string) ([]*RepoFile, } // GetLastestCommit returns the latest commit of given repository. -func GetLastestCommit(userName, repoName string) (*Commit, error) { - stdout, _, err := com.ExecCmd("git", "--git-dir="+RepoPath(userName, repoName), "log", "-1") +func GetLastCommit(userName, repoName, branchname string) (*git.Commit, error) { + repo, err := git.OpenRepository(RepoPath(userName, repoName)) if err != nil { return nil, err } - - commit := new(Commit) - for _, line := range strings.Split(stdout, "\n") { - if len(line) == 0 { - continue - } - switch { - case line[0] == 'c': - commit.SHA = line[7:] - case line[0] == 'A': - infos := strings.SplitN(line, " ", 3) - commit.Author = infos[1] - commit.Email = infos[2][1 : len(infos[2])-1] - case line[0] == 'D': - commit.Date, err = time.Parse("Mon Jan 02 15:04:05 2006 -0700", line[8:]) - if err != nil { - return nil, err - } - case line[:4] == " ": - commit.Message = line[4:] - } + r, err := repo.LookupReference(fmt.Sprintf("refs/heads/%s", branchname)) + if err != nil { + return nil, err } - return commit, nil + return r.LastCommit() } // GetCommits returns all commits of given branch of repository. diff --git a/routers/repo/single.go b/routers/repo/single.go index 1b5da9d307..64ea508b0e 100644 --- a/routers/repo/single.go +++ b/routers/repo/single.go @@ -90,13 +90,13 @@ func Single(ctx *middleware.Context, params martini.Params) { } // Get latest commit according username and repo name - commit, err := models.GetLastestCommit(params["username"], params["reponame"]) + commit, err := models.GetLastCommit(params["username"], params["reponame"], params["branchname"]) if err != nil { log.Error("repo.Single(GetLastestCommit): %v", err) ctx.Render.Error(404) return } - ctx.Data["LatestCommit"] = commit + ctx.Data["LastCommit"] = commit var readmeFile *models.RepoFile diff --git a/templates/repo/single.tmpl b/templates/repo/single.tmpl index 019ec8eaaa..3831c2dc41 100644 --- a/templates/repo/single.tmpl +++ b/templates/repo/single.tmpl @@ -42,10 +42,10 @@
- {{.LatestCommit.Author}} {{TimeSince .LatestCommit.Date}} + {{.LastCommit.Author.Name}} {{TimeSince .LastCommit.Author.When}}
From a3a93aef11f9ff6eca38e9147b022a0649b73bdf Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 18 Mar 2014 01:33:53 -0400 Subject: [PATCH 2/6] Add some config options --- conf/app.ini | 26 +++++++++++++++++++------- models/user.go | 2 +- modules/base/conf.go | 31 ++++++++++++++++++++++++++----- web.go | 13 +++++++++++++ 4 files changed, 59 insertions(+), 13 deletions(-) diff --git a/conf/app.ini b/conf/app.ini index 1c7021072f..9d4ee0b594 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -1,12 +1,14 @@ -# App name that shows on every page title +; App name that shows on every page title APP_NAME = Gogs: Go Git Service -# !!MUST CHANGE TO YOUR USER NAME!! +; !!MUST CHANGE TO YOUR USER NAME!! RUN_USER = lunny +; Either "dev", "prod" or "test", based on martini +RUN_MODE = dev [repository] ROOT = /Users/%(RUN_USER)s/git/gogs-repositories -LANG_IGNS=Google Go|C|Python|Ruby|C Sharp -LICENSES=Apache v2 License|GPL v2|MIT License|Affero GPL|BSD (3-Clause) License +LANG_IGNS = Google Go|C|Python|Ruby|C Sharp +LICENSES = Apache v2 License|GPL v2|MIT License|Affero GPL|BSD (3-Clause) License [server] DOMAIN = gogits.org @@ -14,15 +16,25 @@ HTTP_ADDR = HTTP_PORT = 3000 [database] -# Either "mysql" or "postgres", it's your choice +; Either "mysql" or "postgres", it's your choice DB_TYPE = mysql HOST = NAME = gogs USER = root PASSWD = -# For "postgres" only, either "disable" or "verify-full" +; For "postgres" only, either "disable", "require" or "verify-full" SSL_MODE = disable [security] -# !!CHANGE THIS TO KEEP YOUR USER DATA SAFE!! +; !!CHANGE THIS TO KEEP YOUR USER DATA SAFE!! USER_PASSWD_SALT = !#@FDEWREWR&*( + +[mailer] +ENABLED = true +; Name displayed in mail title +NAME = %(APP_NAME)s +; Mail server +HOST = +; Mailer user name and password +USER = +PASSWD = \ No newline at end of file diff --git a/models/user.go b/models/user.go index 87c644b2b6..80af9bd4ba 100644 --- a/models/user.go +++ b/models/user.go @@ -252,7 +252,7 @@ func LoginUserPlain(name, passwd string) (*User, error) { } else if !has { err = ErrUserNotExist } - return &user, nil + return &user, err } // FollowUser marks someone be another's follower. diff --git a/modules/base/conf.go b/modules/base/conf.go index 9ed5545e8a..83c7f8872d 100644 --- a/modules/base/conf.go +++ b/modules/base/conf.go @@ -13,13 +13,23 @@ import ( "github.com/Unknwon/com" "github.com/Unknwon/goconfig" + + "github.com/gogits/gogs/modules/log" ) +// Mailer represents a mail service. +type Mailer struct { + Name string + Host string + User, Passwd string +} + var ( - AppVer string - AppName string - Domain string - Cfg *goconfig.ConfigFile + AppVer string + AppName string + Domain string + Cfg *goconfig.ConfigFile + MailService *Mailer ) func exeDir() (string, error) { @@ -59,6 +69,17 @@ func init() { } Cfg.BlockMode = false - AppName = Cfg.MustValue("", "APP_NAME") + AppName = Cfg.MustValue("", "APP_NAME", "Gogs: Go Git Service") Domain = Cfg.MustValue("server", "DOMAIN") + + // Check mailer setting. + if Cfg.MustBool("mailer", "ENABLED") { + MailService = &Mailer{ + Name: Cfg.MustValue("mailer", "NAME", AppName), + Host: Cfg.MustValue("mailer", "HOST", "127.0.0.1:25"), + User: Cfg.MustValue("mailer", "USER", "example@example.com"), + Passwd: Cfg.MustValue("mailer", "PASSWD", "******"), + } + log.Info("Mail Service Enabled") + } } diff --git a/web.go b/web.go index ca504ea560..cc20097907 100644 --- a/web.go +++ b/web.go @@ -8,6 +8,7 @@ import ( "fmt" "html/template" "net/http" + "strings" "github.com/codegangsta/cli" "github.com/codegangsta/martini" @@ -34,8 +35,20 @@ gogs web`, Flags: []cli.Flag{}, } +// Check run mode(Default of martini is Dev). +func checkRunMode() { + switch base.Cfg.MustValue("", "RUN_MODE") { + case "prod": + martini.Env = martini.Prod + case "test": + martini.Env = martini.Test + } + log.Info("Run Mode: %s", strings.Title(martini.Env)) +} + func runWeb(*cli.Context) { log.Info("%s %s", base.AppName, base.AppVer) + checkRunMode() m := martini.Classic() From 76644c2fcc29d89dfea2248966527d1996628184 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 18 Mar 2014 04:19:10 -0400 Subject: [PATCH 3/6] Support go build.io --- .gobuild.yml | 7 +++++++ conf/app.ini | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .gobuild.yml diff --git a/.gobuild.yml b/.gobuild.yml new file mode 100644 index 0000000000..d667c93082 --- /dev/null +++ b/.gobuild.yml @@ -0,0 +1,7 @@ +filesets: + includes: + - templates + - public + - conf + - LICENSE + - README.md \ No newline at end of file diff --git a/conf/app.ini b/conf/app.ini index 9d4ee0b594..5dc21a676e 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -30,7 +30,7 @@ SSL_MODE = disable USER_PASSWD_SALT = !#@FDEWREWR&*( [mailer] -ENABLED = true +ENABLED = false ; Name displayed in mail title NAME = %(APP_NAME)s ; Mail server From ccd43b09b22f551070c2656dd2f4c7f347619a1c Mon Sep 17 00:00:00 2001 From: "shengxiang[skyblue]" Date: Tue, 18 Mar 2014 21:58:58 +0800 Subject: [PATCH 4/6] add some comment --- models/action.go | 4 +-- routers/user/setting.go | 2 ++ update.go | 4 +-- web.go | 58 ++++++++++++++++++++++------------------- 4 files changed, 37 insertions(+), 31 deletions(-) diff --git a/models/action.go b/models/action.go index 7917929df4..d388bca991 100644 --- a/models/action.go +++ b/models/action.go @@ -22,8 +22,8 @@ const ( // Action represents user operation type and information to the repository. type Action struct { Id int64 - UserId int64 // Receiver user id. - OpType int + UserId int64 // Receiver user id. + OpType int // Operations: CREATE DELETE STAR ... ActUserId int64 // Action user id. ActUserName string // Action user name. RepoId int64 diff --git a/routers/user/setting.go b/routers/user/setting.go index 91e992b18e..ea42f70cfa 100644 --- a/routers/user/setting.go +++ b/routers/user/setting.go @@ -14,6 +14,7 @@ import ( "github.com/gogits/gogs/modules/middleware" ) +// render user setting page (email, website modify) func Setting(ctx *middleware.Context, form auth.UpdateProfileForm) { ctx.Data["Title"] = "Setting" ctx.Data["PageIsUserSetting"] = true @@ -26,6 +27,7 @@ func Setting(ctx *middleware.Context, form auth.UpdateProfileForm) { return } + // below is for POST requests if hasErr, ok := ctx.Data["HasError"]; ok && hasErr.(bool) { ctx.Render.HTML(200, "user/setting", ctx.Data) return diff --git a/update.go b/update.go index 23d8fb028a..baa433d75c 100644 --- a/update.go +++ b/update.go @@ -10,8 +10,7 @@ import ( "github.com/codegangsta/cli" - git "github.com/gogits/git" - + "github.com/gogits/git" "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/log" ) @@ -25,6 +24,7 @@ gogs serv provide access auth for repositories`, Flags: []cli.Flag{}, } +// for command: ./gogs update func runUpdate(*cli.Context) { userName := os.Getenv("userName") userId := os.Getenv("userId") diff --git a/web.go b/web.go index cc20097907..a0e3971175 100644 --- a/web.go +++ b/web.go @@ -61,48 +61,52 @@ func runWeb(*cli.Context) { m.Use(middleware.InitContext()) + ignSignIn := middleware.SignInRequire(false) + reqSignIn, reqSignOut := middleware.SignInRequire(true), middleware.SignOutRequire() // Routers. - m.Get("/", middleware.SignInRequire(false), routers.Home) - m.Get("/issues", middleware.SignInRequire(true), user.Issues) - m.Get("/pulls", middleware.SignInRequire(true), user.Pulls) - m.Get("/stars", middleware.SignInRequire(true), user.Stars) - m.Any("/user/login", middleware.SignOutRequire(), binding.BindIgnErr(auth.LogInForm{}), user.SignIn) - m.Any("/user/logout", middleware.SignInRequire(true), user.SignOut) - m.Any("/user/sign_up", middleware.SignOutRequire(), binding.BindIgnErr(auth.RegisterForm{}), user.SignUp) - m.Any("/user/delete", middleware.SignInRequire(true), user.Delete) + m.Get("/", ignSignIn, routers.Home) + m.Get("/issues", reqSignIn, user.Issues) + m.Get("/pulls", reqSignIn, user.Pulls) + m.Get("/stars", reqSignIn, user.Stars) + m.Any("/user/login", reqSignOut, binding.BindIgnErr(auth.LogInForm{}), user.SignIn) + m.Any("/user/logout", reqSignIn, user.SignOut) + m.Any("/user/sign_up", reqSignOut, binding.BindIgnErr(auth.RegisterForm{}), user.SignUp) + m.Any("/user/delete", reqSignIn, user.Delete) m.Get("/user/feeds", binding.Bind(auth.FeedsForm{}), user.Feeds) - m.Any("/user/setting", middleware.SignInRequire(true), binding.BindIgnErr(auth.UpdateProfileForm{}), user.Setting) - m.Any("/user/setting/password", middleware.SignInRequire(true), binding.BindIgnErr(auth.UpdatePasswdForm{}), user.SettingPassword) - m.Any("/user/setting/ssh", middleware.SignInRequire(true), binding.BindIgnErr(auth.AddSSHKeyForm{}), user.SettingSSHKeys) - m.Any("/user/setting/notification", middleware.SignInRequire(true), user.SettingNotification) - m.Any("/user/setting/security", middleware.SignInRequire(true), user.SettingSecurity) + m.Any("/user/setting", reqSignIn, binding.BindIgnErr(auth.UpdateProfileForm{}), user.Setting) + m.Any("/user/setting/password", reqSignIn, binding.BindIgnErr(auth.UpdatePasswdForm{}), user.SettingPassword) + m.Any("/user/setting/ssh", reqSignIn, binding.BindIgnErr(auth.AddSSHKeyForm{}), user.SettingSSHKeys) + m.Any("/user/setting/notification", reqSignIn, user.SettingNotification) + m.Any("/user/setting/security", reqSignIn, user.SettingSecurity) - m.Get("/user/:username", middleware.SignInRequire(false), user.Profile) + m.Get("/user/:username", ignSignIn, user.Profile) - m.Any("/repo/create", middleware.SignInRequire(true), binding.BindIgnErr(auth.CreateRepoForm{}), repo.Create) + m.Any("/repo/create", reqSignIn, binding.BindIgnErr(auth.CreateRepoForm{}), repo.Create) m.Get("/help", routers.Help) - m.Post("/:username/:reponame/settings", middleware.SignInRequire(true), middleware.RepoAssignment(true), repo.SettingPost) - m.Get("/:username/:reponame/settings", middleware.SignInRequire(true), middleware.RepoAssignment(true), repo.Setting) + m.Post("/:username/:reponame/settings", reqSignIn, middleware.RepoAssignment(true), repo.SettingPost) + m.Get("/:username/:reponame/settings", reqSignIn, middleware.RepoAssignment(true), repo.Setting) - m.Get("/:username/:reponame/commits/:branchname", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Commits) - m.Get("/:username/:reponame/issues", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Issues) - m.Get("/:username/:reponame/pulls", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Pulls) - m.Get("/:username/:reponame/branches", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Branches) + m.Get("/:username/:reponame/commits/:branchname", ignSignIn, middleware.RepoAssignment(true), repo.Commits) + m.Get("/:username/:reponame/issues", ignSignIn, middleware.RepoAssignment(true), repo.Issues) + m.Get("/:username/:reponame/pulls", ignSignIn, middleware.RepoAssignment(true), repo.Pulls) + m.Get("/:username/:reponame/branches", ignSignIn, middleware.RepoAssignment(true), repo.Branches) m.Get("/:username/:reponame/tree/:branchname/**", - middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Single) + ignSignIn, middleware.RepoAssignment(true), repo.Single) m.Get("/:username/:reponame/tree/:branchname", - middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Single) - m.Get("/:username/:reponame/commit/:commitid/**", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Single) - m.Get("/:username/:reponame/commit/:commitid", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Single) + ignSignIn, middleware.RepoAssignment(true), repo.Single) + m.Get("/:username/:reponame/commit/:commitid/**", ignSignIn, middleware.RepoAssignment(true), repo.Single) + m.Get("/:username/:reponame/commit/:commitid", ignSignIn, middleware.RepoAssignment(true), repo.Single) - m.Get("/:username/:reponame", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Single) + m.Get("/:username/:reponame", ignSignIn, middleware.RepoAssignment(true), repo.Single) listenAddr := fmt.Sprintf("%s:%s", base.Cfg.MustValue("server", "HTTP_ADDR"), base.Cfg.MustValue("server", "HTTP_PORT", "3000")) log.Info("Listen: %s", listenAddr) - http.ListenAndServe(listenAddr, m) + if err := http.ListenAndServe(listenAddr, m); err != nil { + log.Critical(err.Error()) + } } From fbd252c1cf26009e8880c632c8154361db33175e Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 18 Mar 2014 18:31:54 -0400 Subject: [PATCH 5/6] Mirror fix --- routers/dashboard.go | 5 +++-- routers/repo/single.go | 10 ++++++---- routers/user/setting.go | 13 +++++++++---- routers/user/user.go | 18 ++++++++++-------- templates/base/navbar.tmpl | 2 +- templates/help.tmpl | 11 +++++++++++ templates/home.tmpl | 2 +- templates/repo/issues.tmpl | 9 +++++++++ templates/repo/pulls.tmpl | 9 +++++++++ templates/user/issues.tmpl | 17 +++++++++++++++++ templates/user/notification.tmpl | 12 +----------- templates/user/password.tmpl | 26 ++++++++------------------ templates/user/publickey.tmpl | 13 +------------ templates/user/pulls.tmpl | 17 +++++++++++++++++ templates/user/security.tmpl | 12 +----------- templates/user/setting.tmpl | 12 +----------- templates/user/setting_nav.tmpl | 11 +++++++++++ templates/user/stars.tmpl | 17 +++++++++++++++++ 18 files changed, 133 insertions(+), 83 deletions(-) create mode 100644 templates/help.tmpl create mode 100644 templates/repo/issues.tmpl create mode 100644 templates/repo/pulls.tmpl create mode 100644 templates/user/issues.tmpl create mode 100644 templates/user/pulls.tmpl create mode 100644 templates/user/setting_nav.tmpl create mode 100644 templates/user/stars.tmpl diff --git a/routers/dashboard.go b/routers/dashboard.go index ddaef0cb56..d5358f0a00 100644 --- a/routers/dashboard.go +++ b/routers/dashboard.go @@ -18,6 +18,7 @@ func Home(ctx *middleware.Context) { ctx.Render.HTML(200, "home", ctx.Data) } -func Help(ctx *middleware.Context) string { - return "This is help page" +func Help(ctx *middleware.Context) { + ctx.Data["PageIsHelp"] = true + ctx.Render.HTML(200, "help", ctx.Data) } diff --git a/routers/repo/single.go b/routers/repo/single.go index 0cc41b1c8f..d64248d990 100644 --- a/routers/repo/single.go +++ b/routers/repo/single.go @@ -182,10 +182,12 @@ func Commits(ctx *middleware.Context, params martini.Params) { ctx.Render.HTML(200, "repo/commits", ctx.Data) } -func Issues(ctx *middleware.Context) string { - return "This is issues page" +func Issues(ctx *middleware.Context) { + ctx.Data["IsRepoToolbarIssues"] = true + ctx.Render.HTML(200, "repo/issues", ctx.Data) } -func Pulls(ctx *middleware.Context) string { - return "This is pulls page" +func Pulls(ctx *middleware.Context) { + ctx.Data["IsRepoToolbarPulls"] = true + ctx.Render.HTML(200, "repo/pulls", ctx.Data) } diff --git a/routers/user/setting.go b/routers/user/setting.go index ea42f70cfa..3f60c6c6fb 100644 --- a/routers/user/setting.go +++ b/routers/user/setting.go @@ -14,10 +14,11 @@ import ( "github.com/gogits/gogs/modules/middleware" ) -// render user setting page (email, website modify) +// Render user setting page (email, website modify) func Setting(ctx *middleware.Context, form auth.UpdateProfileForm) { ctx.Data["Title"] = "Setting" - ctx.Data["PageIsUserSetting"] = true + ctx.Data["PageIsUserSetting"] = true // For navbar arrow. + ctx.Data["IsUserPageSetting"] = true // For setting nav highlight. user := ctx.User ctx.Data["Owner"] = user @@ -50,6 +51,7 @@ func Setting(ctx *middleware.Context, form auth.UpdateProfileForm) { func SettingPassword(ctx *middleware.Context, form auth.UpdatePasswdForm) { ctx.Data["Title"] = "Password" ctx.Data["PageIsUserSetting"] = true + ctx.Data["IsUserPageSettingPasswd"] = true if ctx.Req.Method == "GET" { ctx.Render.HTML(200, "user/password", ctx.Data) @@ -149,20 +151,23 @@ func SettingSSHKeys(ctx *middleware.Context, form auth.AddSSHKeyForm) { } ctx.Data["PageIsUserSetting"] = true + ctx.Data["IsUserPageSettingSSH"] = true ctx.Data["Keys"] = keys ctx.Render.HTML(200, "user/publickey", ctx.Data) } func SettingNotification(ctx *middleware.Context) { - // todo user setting notification + // TODO: user setting notification ctx.Data["Title"] = "Notification" ctx.Data["PageIsUserSetting"] = true + ctx.Data["IsUserPageSettingNotify"] = true ctx.Render.HTML(200, "user/notification", ctx.Data) } func SettingSecurity(ctx *middleware.Context) { - // todo user setting security + // TODO: user setting security ctx.Data["Title"] = "Security" ctx.Data["PageIsUserSetting"] = true + ctx.Data["IsUserPageSettingSecurity"] = true ctx.Render.HTML(200, "user/security", ctx.Data) } diff --git a/routers/user/user.go b/routers/user/user.go index c43cf84a24..f8c9b4d3dd 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -151,6 +151,8 @@ func SignUp(ctx *middleware.Context, form auth.RegisterForm) { func Delete(ctx *middleware.Context) { ctx.Data["Title"] = "Delete Account" + ctx.Data["PageIsUserSetting"] = true + ctx.Data["IsUserPageSettingDelete"] = true if ctx.Req.Method == "GET" { ctx.Render.HTML(200, "user/delete", ctx.Data) @@ -182,7 +184,7 @@ func Delete(ctx *middleware.Context) { } const ( - feedTpl = ` + TPL_FEED = `
%s
%s
` ) @@ -194,20 +196,20 @@ func Feeds(ctx *middleware.Context, form auth.FeedsForm) { feeds := make([]string, len(actions)) for i := range actions { - feeds[i] = fmt.Sprintf(feedTpl, base.ActionIcon(actions[i].OpType), + feeds[i] = fmt.Sprintf(TPL_FEED, base.ActionIcon(actions[i].OpType), base.TimeSince(actions[i].Created), base.ActionDesc(actions[i], ctx.User.AvatarLink())) } ctx.Render.JSON(200, &feeds) } -func Issues(ctx *middleware.Context) string { - return "This is issues page" +func Issues(ctx *middleware.Context) { + ctx.Render.HTML(200, "user/issues", ctx.Data) } -func Pulls(ctx *middleware.Context) string { - return "This is pulls page" +func Pulls(ctx *middleware.Context) { + ctx.Render.HTML(200, "user/pulls", ctx.Data) } -func Stars(ctx *middleware.Context) string { - return "This is stars page" +func Stars(ctx *middleware.Context) { + ctx.Render.HTML(200, "user/stars", ctx.Data) } diff --git a/templates/base/navbar.tmpl b/templates/base/navbar.tmpl index 181beb5a44..4902ce2593 100644 --- a/templates/base/navbar.tmpl +++ b/templates/base/navbar.tmpl @@ -3,7 +3,7 @@