mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-27 04:07:08 +00:00
golint fixed for parts of routers root, dev, user and org dirs (#167)
* golint fixed for parts of routers root, dev and org dirs * add user/auth.go golint fixed * rename unnecessary exported to unexported and user dir golint fixed
This commit is contained in:
parent
91953ae9b4
commit
cf045b029c
11 changed files with 225 additions and 132 deletions
|
@ -18,10 +18,10 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
DASHBOARD base.TplName = "user/dashboard/dashboard"
|
||||
ISSUES base.TplName = "user/dashboard/issues"
|
||||
PROFILE base.TplName = "user/profile"
|
||||
ORG_HOME base.TplName = "org/home"
|
||||
tplDashborad base.TplName = "user/dashboard/dashboard"
|
||||
tplIssues base.TplName = "user/dashboard/issues"
|
||||
tplProfile base.TplName = "user/profile"
|
||||
tplOrgHome base.TplName = "org/home"
|
||||
)
|
||||
|
||||
// getDashboardContextUser finds out dashboard is viewing as which context user.
|
||||
|
@ -86,6 +86,7 @@ func retrieveFeeds(ctx *context.Context, ctxUser *models.User, userID, offset in
|
|||
ctx.Data["Feeds"] = feeds
|
||||
}
|
||||
|
||||
// Dashboard render the dashborad page
|
||||
func Dashboard(ctx *context.Context) {
|
||||
ctxUser := getDashboardContextUser(ctx)
|
||||
if ctx.Written() {
|
||||
|
@ -150,9 +151,10 @@ func Dashboard(ctx *context.Context) {
|
|||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
ctx.HTML(200, DASHBOARD)
|
||||
ctx.HTML(200, tplDashborad)
|
||||
}
|
||||
|
||||
// Issues render the user issues page
|
||||
func Issues(ctx *context.Context) {
|
||||
isPullList := ctx.Params(":type") == "pulls"
|
||||
if isPullList {
|
||||
|
@ -308,9 +310,10 @@ func Issues(ctx *context.Context) {
|
|||
ctx.Data["State"] = "open"
|
||||
}
|
||||
|
||||
ctx.HTML(200, ISSUES)
|
||||
ctx.HTML(200, tplIssues)
|
||||
}
|
||||
|
||||
// ShowSSHKeys ouput all the ssh keys of user by uid
|
||||
func ShowSSHKeys(ctx *context.Context, uid int64) {
|
||||
keys, err := models.ListPublicKeys(uid)
|
||||
if err != nil {
|
||||
|
@ -373,9 +376,10 @@ func showOrgProfile(ctx *context.Context) {
|
|||
|
||||
ctx.Data["Teams"] = org.Teams
|
||||
|
||||
ctx.HTML(200, ORG_HOME)
|
||||
ctx.HTML(200, tplOrgHome)
|
||||
}
|
||||
|
||||
// Email2User show user page via email
|
||||
func Email2User(ctx *context.Context) {
|
||||
u, err := models.GetUserByEmail(ctx.Query("email"))
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue