Browse Source

Merge branch 'master' of gitote.in:gitote/gitote

Yoginth 7 years ago
parent
commit
2a9e4870a3

+ 0 - 1
cmd/hook.go

@@ -245,7 +245,6 @@ func runHookPostReceive(c *cli.Context) error {
 		if err == nil {
 			resp.Body.Close()
 			if resp.StatusCode/100 != 2 {
-				raven.CaptureErrorAndWait(err, nil)
 				log.Error(2, "Fail to trigger task: not 2xx response code")
 			}
 		} else {

+ 1 - 0
routes/dev/template.go

@@ -6,6 +6,7 @@ import (
 	"gitote/gitote/pkg/setting"
 )
 
+//TemplatePreview pre render the template to preview it
 func TemplatePreview(c *context.Context) {
 	c.Data["User"] = models.User{Name: "Yoginth"}
 	c.Data["AppVer"] = setting.AppVer

+ 21 - 0
routes/home.go

@@ -10,14 +10,26 @@ import (
 )
 
 const (
+  	// HOME page template
 	HOME                  = "home"
+  
+  	// EXPLORE_HOME page template
 	EXPLORE_HOME          = "explore/home"
+  
+  	// EXPLORE_REPOS page template
 	EXPLORE_REPOS         = "explore/repos"
+  
+  	// EXPLORE_USERS page template
 	EXPLORE_USERS         = "explore/users"
+  
+  	// EXPLORE_TRENDING page template
 	EXPLORE_TRENDING      = "explore/trending"
+  
+  	// EXPLORE_ORGANIZATIONS page template
 	EXPLORE_ORGANIZATIONS = "explore/organizations"
 )
 
+// Home shows the home page
 func Home(c *context.Context) {
 	if c.IsLogged {
 		if !c.User.IsActive && setting.Service.RegisterEmailConfirm {
@@ -40,6 +52,7 @@ func Home(c *context.Context) {
 	c.Success(HOME)
 }
 
+// ExploreHome shows explore page
 func ExploreHome(c *context.Context) {
 	c.Data["Title"] = c.Tr("explore")
 	c.Data["PageIsExplore"] = true
@@ -75,6 +88,7 @@ func ExploreHome(c *context.Context) {
 	c.Success(EXPLORE_HOME)
 }
 
+// ExploreRepos shows explore repositories page
 func ExploreRepos(c *context.Context) {
 	c.Data["Title"] = c.Tr("explore")
 	c.Data["PageIsExplore"] = true
@@ -86,6 +100,7 @@ func ExploreRepos(c *context.Context) {
 	}
 
 	keyword := c.Query("q")
+  	// Search a repository
 	repos, count, err := models.SearchRepositoryByName(&models.SearchRepoOptions{
 		Keyword:  keyword,
 		UserID:   c.UserID(),
@@ -110,6 +125,7 @@ func ExploreRepos(c *context.Context) {
 	c.Success(EXPLORE_REPOS)
 }
 
+// ExploreTrending shows trending repositories page
 func ExploreTrending(c *context.Context) {
 	c.Data["Title"] = c.Tr("explore.trending")
 	c.Data["PageIsTrending"] = true
@@ -134,6 +150,7 @@ func ExploreTrending(c *context.Context) {
 	c.Success(EXPLORE_TRENDING)
 }
 
+// UserSearchOptions is the structure of the options choosed by the user
 type UserSearchOptions struct {
 	Type     models.UserType
 	Counter  func() int64
@@ -143,6 +160,7 @@ type UserSearchOptions struct {
 	TplName  string
 }
 
+// RenderUserSearch renders user search
 func RenderUserSearch(c *context.Context, opts *UserSearchOptions) {
 	page := c.QueryInt("page")
 	if page <= 1 {
@@ -184,6 +202,7 @@ func RenderUserSearch(c *context.Context, opts *UserSearchOptions) {
 	c.Success(opts.TplName)
 }
 
+// ExploreUsers shows explore users page
 func ExploreUsers(c *context.Context) {
 	c.Data["Title"] = c.Tr("explore")
 	c.Data["PageIsExplore"] = true
@@ -199,6 +218,7 @@ func ExploreUsers(c *context.Context) {
 	})
 }
 
+//ExploreOrganizations shows explore organizations page
 func ExploreOrganizations(c *context.Context) {
 	c.Data["Title"] = c.Tr("explore")
 	c.Data["PageIsExplore"] = true
@@ -214,6 +234,7 @@ func ExploreOrganizations(c *context.Context) {
 	})
 }
 
+// NotFound renders 404 page if page not found
 func NotFound(c *context.Context) {
 	c.Data["Title"] = "Page Not Found"
 	c.NotFound()

+ 6 - 0
routes/install.go

@@ -28,9 +28,11 @@ import (
 )
 
 const (
+  	// INSTALL page template
 	INSTALL = "install"
 )
 
+// checkRunMode check if it is runned or not in production
 func checkRunMode() {
 	if setting.ProdMode {
 		macaron.Env = macaron.PROD
@@ -41,6 +43,7 @@ func checkRunMode() {
 	log.Info("Run Mode: %s", strings.Title(macaron.Env))
 }
 
+// NewServices initializes new services
 func NewServices() {
 	setting.NewServices()
 	mailer.NewContext()
@@ -98,6 +101,7 @@ func GlobalInit() {
 	}
 }
 
+// InstallInit initialize the install
 func InstallInit(c *context.Context) {
 	if setting.InstallLock {
 		c.NotFound()
@@ -114,6 +118,7 @@ func InstallInit(c *context.Context) {
 	c.Data["DbOptions"] = dbOpts
 }
 
+// Install shows install page
 func Install(c *context.Context) {
 	f := form.Install{}
 
@@ -174,6 +179,7 @@ func Install(c *context.Context) {
 	c.Success(INSTALL)
 }
 
+// InstallPost install gitote
 func InstallPost(c *context.Context, f form.Install) {
 	c.Data["CurDbOption"] = f.DbType
 

+ 14 - 1
routes/org/members.go

@@ -12,10 +12,14 @@ import (
 )
 
 const (
-	MEMBERS       = "org/member/members"
+	// MEMBERS page template
+	MEMBERS = "org/member/members"
+
+	//MEMBER_INVITE page template
 	MEMBER_INVITE = "org/member/invite"
 )
 
+//Members shows organization members
 func Members(c *context.Context) {
 	org := c.Org.Organization
 	c.Data["Title"] = org.FullName
@@ -30,6 +34,8 @@ func Members(c *context.Context) {
 	c.HTML(200, MEMBERS)
 }
 
+// MembersAction handle the user actions
+// Like : make organization public/private, delete or leave it
 func MembersAction(c *context.Context) {
 	uid := com.StrTo(c.Query("uid")).MustInt64()
 	if uid == 0 {
@@ -40,18 +46,21 @@ func MembersAction(c *context.Context) {
 	org := c.Org.Organization
 	var err error
 	switch c.Params(":action") {
+	// Make organization private
 	case "private":
 		if c.User.ID != uid && !c.Org.IsOwner {
 			c.Error(404)
 			return
 		}
 		err = models.ChangeOrgUserStatus(org.ID, uid, false)
+	// Make organization public
 	case "public":
 		if c.User.ID != uid && !c.Org.IsOwner {
 			c.Error(404)
 			return
 		}
 		err = models.ChangeOrgUserStatus(org.ID, uid, true)
+	// Remove the organization
 	case "remove":
 		if !c.Org.IsOwner {
 			c.Error(404)
@@ -63,6 +72,7 @@ func MembersAction(c *context.Context) {
 			c.Redirect(c.Org.OrgLink + "/members")
 			return
 		}
+	// Leave the organization
 	case "leave":
 		err = org.RemoveMember(c.User.ID)
 		if models.IsErrLastOrgOwner(err) {
@@ -89,6 +99,7 @@ func MembersAction(c *context.Context) {
 	}
 }
 
+// Invitation validate user invitation to an organization
 func Invitation(c *context.Context) {
 	org := c.Org.Organization
 	c.Data["Title"] = org.FullName
@@ -98,6 +109,7 @@ func Invitation(c *context.Context) {
 		uname := c.Query("uname")
 		u, err := models.GetUserByName(uname)
 		if err != nil {
+			// Check if user exists
 			if errors.IsUserNotExist(err) {
 				c.Flash.Error(c.Tr("form.user_not_exist"))
 				c.Redirect(c.Org.OrgLink + "/invitations/new")
@@ -107,6 +119,7 @@ func Invitation(c *context.Context) {
 			return
 		}
 
+		// Add user to the organization
 		if err = org.AddMember(u.ID); err != nil {
 			c.Handle(500, " AddMember", err)
 			return

+ 4 - 0
routes/org/org.go

@@ -10,14 +10,17 @@ import (
 )
 
 const (
+	// CREATE organization page template
 	CREATE = "org/create"
 )
 
+// Create renders the page to create an organization
 func Create(c *context.Context) {
 	c.Data["Title"] = c.Tr("new_org")
 	c.HTML(200, CREATE)
 }
 
+// CreatePost creates an organization with the body fields
 func CreatePost(c *context.Context, f form.CreateOrg) {
 	c.Data["Title"] = c.Tr("new_org")
 
@@ -32,6 +35,7 @@ func CreatePost(c *context.Context, f form.CreateOrg) {
 		Type:     models.USER_TYPE_ORGANIZATION,
 	}
 
+	// Create organization
 	if err := models.CreateOrganization(org, c.User); err != nil {
 		c.Data["Err_OrgName"] = true
 		switch {

+ 23 - 2
routes/org/setting.go

@@ -13,17 +13,24 @@ import (
 )
 
 const (
-	SETTINGS_OPTIONS  = "org/settings/options"
-	SETTINGS_DELETE   = "org/settings/delete"
+	// SETTINGS_OPTIONS page template
+	SETTINGS_OPTIONS = "org/settings/options"
+
+	// SETTINGS_DELETE page template
+	SETTINGS_DELETE = "org/settings/delete"
+
+	// SETTINGS_WEBHOOKS page template
 	SETTINGS_WEBHOOKS = "org/settings/webhooks"
 )
 
+// Settings shows the organization settings page
 func Settings(c *context.Context) {
 	c.Data["Title"] = c.Tr("org.settings")
 	c.Data["PageIsSettingsOptions"] = true
 	c.HTML(200, SETTINGS_OPTIONS)
 }
 
+// SettingsPost updates organization settings with the body fields
 func SettingsPost(c *context.Context, f form.UpdateOrgSetting) {
 	c.Data["Title"] = c.Tr("org.settings")
 	c.Data["PageIsSettingsOptions"] = true
@@ -74,6 +81,8 @@ func SettingsPost(c *context.Context, f form.UpdateOrgSetting) {
 	org.Website = f.Website
 	org.Location = f.Location
 	org.IsVerified = f.IsVerified
+
+	// Update organization
 	if err := models.UpdateUser(org); err != nil {
 		c.Handle(500, "UpdateUser", err)
 		return
@@ -83,17 +92,22 @@ func SettingsPost(c *context.Context, f form.UpdateOrgSetting) {
 	c.Redirect(c.Org.OrgLink + "/settings")
 }
 
+// SettingsAvatar updates organization avatar
 func SettingsAvatar(c *context.Context, f form.Avatar) {
 	f.Source = form.AVATAR_LOCAL
+
+	// Update avatar
 	if err := user.UpdateAvatarSetting(c, f, c.Org.Organization); err != nil {
 		c.Flash.Error(err.Error())
 	} else {
 		c.Flash.Success(c.Tr("org.settings.update_avatar_success"))
 	}
 
+	// Redirect to "/settings"
 	c.Redirect(c.Org.OrgLink + "/settings")
 }
 
+// SettingsDeleteAvatar deletes organization avatar
 func SettingsDeleteAvatar(c *context.Context) {
 	if err := c.Org.Organization.DeleteAvatar(); err != nil {
 		c.Flash.Error(err.Error())
@@ -102,12 +116,14 @@ func SettingsDeleteAvatar(c *context.Context) {
 	c.Redirect(c.Org.OrgLink + "/settings")
 }
 
+// SettingsDelete deletes an organization
 func SettingsDelete(c *context.Context) {
 	c.Title("org.settings")
 	c.PageIs("SettingsDelete")
 
 	org := c.Org.Organization
 	if c.Req.Method == "POST" {
+		// Check if user is logged in
 		if _, err := models.UserLogin(c.User.Name, c.Query("password"), c.User.LoginSource); err != nil {
 			if errors.IsUserNotExist(err) {
 				c.RenderWithErr(c.Tr("form.enterred_invalid_password"), SETTINGS_DELETE, nil)
@@ -117,6 +133,7 @@ func SettingsDelete(c *context.Context) {
 			return
 		}
 
+		// Delete organization
 		if err := models.DeleteOrganization(org); err != nil {
 			if models.IsErrUserOwnRepos(err) {
 				c.Flash.Error(c.Tr("form.org_still_own_repo"))
@@ -134,6 +151,7 @@ func SettingsDelete(c *context.Context) {
 	c.Success(SETTINGS_DELETE)
 }
 
+// Webhooks shows organization webhooks settings
 func Webhooks(c *context.Context) {
 	c.Data["Title"] = c.Tr("org.settings")
 	c.Data["PageIsSettingsHooks"] = true
@@ -151,7 +169,10 @@ func Webhooks(c *context.Context) {
 	c.HTML(200, SETTINGS_WEBHOOKS)
 }
 
+// DeleteWbhook deletes an organization webhook
 func DeleteWebhook(c *context.Context) {
+
+	// Delete the webhook
 	if err := models.DeleteWebhookOfOrgByID(c.Org.Organization.ID, c.QueryInt64("id")); err != nil {
 		c.Flash.Error("DeleteWebhookByOrgID: " + err.Error())
 	} else {

+ 29 - 3
routes/org/teams.go

@@ -13,12 +13,20 @@ import (
 )
 
 const (
-	TEAMS             = "org/team/teams"
-	TEAM_NEW          = "org/team/new"
-	TEAM_MEMBERS      = "org/team/members"
+	// TEAMS page template
+	TEAMS = "org/team/teams"
+
+	// TEAM_NEW page template
+	TEAM_NEW = "org/team/new"
+
+	// TEAM_MEMBERS page template
+	TEAM_MEMBERS = "org/team/members"
+
+	// TEAM_REPOSITORIES page template
 	TEAM_REPOSITORIES = "org/team/repositories"
 )
 
+// Teams shows team page
 func Teams(c *context.Context) {
 	org := c.Org.Organization
 	c.Data["Title"] = org.FullName
@@ -35,6 +43,8 @@ func Teams(c *context.Context) {
 	c.HTML(200, TEAMS)
 }
 
+// TeamsAction handle the user action
+// Like : join, leave, add or remove a team
 func TeamsAction(c *context.Context) {
 	uid := com.StrTo(c.Query("uid")).MustInt64()
 	if uid == 0 {
@@ -45,14 +55,17 @@ func TeamsAction(c *context.Context) {
 	page := c.Query("page")
 	var err error
 	switch c.Params(":action") {
+	// Join a team
 	case "join":
 		if !c.Org.IsOwner {
 			c.Error(404)
 			return
 		}
 		err = c.Org.Team.AddMember(c.User.ID)
+	// Leave a team
 	case "leave":
 		err = c.Org.Team.RemoveMember(c.User.ID)
+	// Remove a team
 	case "remove":
 		if !c.Org.IsOwner {
 			c.Error(404)
@@ -60,6 +73,7 @@ func TeamsAction(c *context.Context) {
 		}
 		err = c.Org.Team.RemoveMember(uid)
 		page = "team"
+	// Add a team
 	case "add":
 		if !c.Org.IsOwner {
 			c.Error(404)
@@ -104,6 +118,8 @@ func TeamsAction(c *context.Context) {
 	}
 }
 
+// TeamsRepoAction handle user actions
+// Like: add, remove a repository
 func TeamsRepoAction(c *context.Context) {
 	if !c.Org.IsOwner {
 		c.Error(404)
@@ -139,6 +155,7 @@ func TeamsRepoAction(c *context.Context) {
 	c.Redirect(c.Org.OrgLink + "/teams/" + c.Org.Team.LowerName + "/repositories")
 }
 
+// NewTeam shows the team creation page
 func NewTeam(c *context.Context) {
 	c.Data["Title"] = c.Org.Organization.FullName
 	c.Data["PageIsOrgTeams"] = true
@@ -147,6 +164,7 @@ func NewTeam(c *context.Context) {
 	c.HTML(200, TEAM_NEW)
 }
 
+// NewTeamPost creates an organization with the body fields
 func NewTeamPost(c *context.Context, f form.CreateTeam) {
 	c.Data["Title"] = c.Org.Organization.FullName
 	c.Data["PageIsOrgTeams"] = true
@@ -165,6 +183,7 @@ func NewTeamPost(c *context.Context, f form.CreateTeam) {
 		return
 	}
 
+	// Create a new team
 	if err := models.NewTeam(t); err != nil {
 		c.Data["Err_TeamName"] = true
 		switch {
@@ -181,6 +200,7 @@ func NewTeamPost(c *context.Context, f form.CreateTeam) {
 	c.Redirect(c.Org.OrgLink + "/teams/" + t.LowerName)
 }
 
+// TeamMembers shows team members page
 func TeamMembers(c *context.Context) {
 	c.Data["Title"] = c.Org.Team.Name
 	c.Data["PageIsOrgTeams"] = true
@@ -191,6 +211,7 @@ func TeamMembers(c *context.Context) {
 	c.HTML(200, TEAM_MEMBERS)
 }
 
+// TeamRepositories shows team repositoies page
 func TeamRepositories(c *context.Context) {
 	c.Data["Title"] = c.Org.Team.Name
 	c.Data["PageIsOrgTeams"] = true
@@ -201,6 +222,7 @@ func TeamRepositories(c *context.Context) {
 	c.HTML(200, TEAM_REPOSITORIES)
 }
 
+// EditTeam shows edit team page
 func EditTeam(c *context.Context) {
 	c.Data["Title"] = c.Org.Organization.FullName
 	c.Data["PageIsOrgTeams"] = true
@@ -209,6 +231,7 @@ func EditTeam(c *context.Context) {
 	c.HTML(200, TEAM_NEW)
 }
 
+// EditTeamPost edit team with the body fields
 func EditTeamPost(c *context.Context, f form.CreateTeam) {
 	t := c.Org.Team
 	c.Data["Title"] = c.Org.Organization.FullName
@@ -243,6 +266,7 @@ func EditTeamPost(c *context.Context, f form.CreateTeam) {
 		}
 	}
 	t.Description = f.Description
+	// Edit team
 	if err := models.UpdateTeam(t, isAuthChanged); err != nil {
 		c.Data["Err_TeamName"] = true
 		switch {
@@ -256,7 +280,9 @@ func EditTeamPost(c *context.Context, f form.CreateTeam) {
 	c.Redirect(c.Org.OrgLink + "/teams/" + t.LowerName)
 }
 
+// DeleteTeam deletes a team
 func DeleteTeam(c *context.Context) {
+	// Delete team
 	if err := models.DeleteTeam(c.Org.Team); err != nil {
 		c.Flash.Error("DeleteTeam: " + err.Error())
 	} else {

+ 61 - 15
routes/pages/pages.go

@@ -5,54 +5,91 @@ import (
 )
 
 const (
-	ABOUT          = "pages/about"
-	FAQ            = "pages/faq"
-	PRIVACY        = "pages/privacy"
-	TOS            = "pages/tos"
-	BRAND          = "pages/brand"
-	CONTACT        = "pages/contact"
-	CONTRIBUTE     = "pages/contribute"
-	SECURITY       = "pages/security"
-	VERIFIED       = "pages/verified"
-	MAKERS         = "pages/makers"
-	HELP           = "pages/help"
-	FEATURES       = "pages/features"
+	// ABOUT page template
+	ABOUT = "pages/about"
+
+	// FAQ page template
+	FAQ = "pages/faq"
+
+	// PRIVACY page template
+	PRIVACY = "pages/privacy"
+
+	// TOS page template
+	TOS = "pages/tos"
+
+	// BRAND page template
+	BRAND = "pages/brand"
+
+	// CONTACT page template
+	CONTACT = "pages/contact"
+
+	// CONTRIBUTE page template
+	CONTRIBUTE = "pages/contribute"
+
+	// SECURITY page template
+	SECURITY = "pages/security"
+
+	// VERIFIED page template
+	VERIFIED = "pages/verified"
+
+	// MAKERS page template
+	MAKERS = "pages/makers"
+
+	// HELP page template
+	HELP = "pages/help"
+
+	// FEATURES page template
+	FEATURES = "pages/features"
+
+	// FEATUREREQUEST page template
 	FEATUREREQUEST = "pages/request"
-	SPONSORSHIP    = "pages/sponsorship"
-	SITEMAP        = "pages/sitemap"
-	DONATE         = "pages/donate"
+
+	// SPONSORSHIP page template
+	SPONSORSHIP = "pages/sponsorship"
+
+	// SITEMAP page template
+	SITEMAP = "pages/sitemap"
+
+	// DONATE page template
+	DONATE = "pages/donate"
 )
 
+// About shows about page
 func About(c *context.Context) {
 	c.Data["Title"] = "About"
 
 	c.HTML(200, ABOUT)
 }
 
+// Faq shows faq page
 func Faq(c *context.Context) {
 	c.Data["Title"] = "FAQ"
 
 	c.HTML(200, FAQ)
 }
 
+// Privacy shows privacy page
 func Privacy(c *context.Context) {
 	c.Data["Title"] = "Privacy Policy"
 
 	c.HTML(200, PRIVACY)
 }
 
+// Tos shows tos page
 func Tos(c *context.Context) {
 	c.Data["Title"] = "Terms of Service"
 
 	c.HTML(200, TOS)
 }
 
+// Brand shows brand page
 func Brand(c *context.Context) {
 	c.Data["Title"] = "Gitote Brand"
 
 	c.HTML(200, BRAND)
 }
 
+// Contribute shows contribute page
 func Contribute(c *context.Context) {
 	c.Data["PageIsContribute"] = true
 	c.Data["Title"] = "Contribute"
@@ -60,24 +97,28 @@ func Contribute(c *context.Context) {
 	c.HTML(200, CONTRIBUTE)
 }
 
+// Security shows security page
 func Security(c *context.Context) {
 	c.Data["Title"] = "Security"
 
 	c.HTML(200, SECURITY)
 }
 
+// Verified shows verified page
 func Verified(c *context.Context) {
 	c.Data["Title"] = "Verified"
 
 	c.HTML(200, VERIFIED)
 }
 
+// Makers shows maker page
 func Makers(c *context.Context) {
 	c.Data["Title"] = "Makers"
 
 	c.HTML(200, MAKERS)
 }
 
+// Help shows help page
 func Help(c *context.Context) {
 	c.Data["Title"] = "Help"
 	c.Data["PageIsHelp"] = true
@@ -85,12 +126,14 @@ func Help(c *context.Context) {
 	c.HTML(200, HELP)
 }
 
+// Contact shows contact page
 func Contact(c *context.Context) {
 	c.Data["Title"] = "Contact"
 
 	c.HTML(200, CONTACT)
 }
 
+// Features shows features page
 func Features(c *context.Context) {
 	c.Data["Title"] = "Features"
 	c.Data["PageIsFeatures"] = true
@@ -98,18 +141,21 @@ func Features(c *context.Context) {
 	c.HTML(200, FEATURES)
 }
 
+// FeatureRequest shows feature request page
 func FeatureRequest(c *context.Context) {
 	c.Data["Title"] = "Feature Request"
 
 	c.HTML(200, FEATUREREQUEST)
 }
 
+// Sponsorship shows sponsorship page
 func Sponsorship(c *context.Context) {
 	c.Data["Title"] = "Sponsorship"
 
 	c.HTML(200, SPONSORSHIP)
 }
 
+// Donate shows donate page
 func Donate(c *context.Context) {
 	c.Data["Title"] = "Donate"
 

+ 16 - 0
routes/user/auth.go

@@ -69,6 +69,7 @@ func AutoLogin(c *context.Context) (bool, error) {
 	return true, nil
 }
 
+//Login is the handler for "/login"
 func Login(c *context.Context) {
 	c.Title("sign_in")
 
@@ -117,6 +118,7 @@ func Login(c *context.Context) {
 	c.Success(LOGIN)
 }
 
+//afterLogin set sessions cookies and redirect to "/"
 func afterLogin(c *context.Context, u *models.User, remember bool) {
 	if remember {
 		days := 86400 * setting.LoginRememberDays
@@ -145,6 +147,7 @@ func afterLogin(c *context.Context, u *models.User, remember bool) {
 	c.SubURLRedirect("/")
 }
 
+//LoginPost is the POST handler for "/login"
 func LoginPost(c *context.Context, f form.SignIn) {
 	c.Title("sign_in")
 
@@ -197,6 +200,7 @@ func LoginPost(c *context.Context, f form.SignIn) {
 	c.SubURLRedirect("/login/two_factor")
 }
 
+//LoginTwoFactor is the handler for "/login" with two factors authentication
 func LoginTwoFactor(c *context.Context) {
 	_, ok := c.Session.Get("twoFactorUserID").(int64)
 	if !ok {
@@ -207,6 +211,7 @@ func LoginTwoFactor(c *context.Context) {
 	c.Success(TWO_FACTOR)
 }
 
+//LoginTwoFactorPost is the POST handler for "/login" with two factors authentication
 func LoginTwoFactorPost(c *context.Context) {
 	userID, ok := c.Session.Get("twoFactorUserID").(int64)
 	if !ok {
@@ -251,6 +256,7 @@ func LoginTwoFactorPost(c *context.Context) {
 	afterLogin(c, u, c.Session.Get("twoFactorRemember").(bool))
 }
 
+//LoginTwoFactorRecoveryCode is the handler to recover Two Factor Code
 func LoginTwoFactorRecoveryCode(c *context.Context) {
 	_, ok := c.Session.Get("twoFactorUserID").(int64)
 	if !ok {
@@ -261,6 +267,7 @@ func LoginTwoFactorRecoveryCode(c *context.Context) {
 	c.Success(TWO_FACTOR_RECOVERY_CODE)
 }
 
+//LoginTwoFactorRecoveryCodePost is the POST handler to recover Two Factor Code
 func LoginTwoFactorRecoveryCodePost(c *context.Context) {
 	userID, ok := c.Session.Get("twoFactorUserID").(int64)
 	if !ok {
@@ -286,6 +293,7 @@ func LoginTwoFactorRecoveryCodePost(c *context.Context) {
 	afterLogin(c, u, c.Session.Get("twoFactorRemember").(bool))
 }
 
+//SignOut is the handler for "/user/logout"
 func SignOut(c *context.Context) {
 	c.Session.Delete("uid")
 	c.Session.Delete("uname")
@@ -295,6 +303,7 @@ func SignOut(c *context.Context) {
 	c.SubURLRedirect("/")
 }
 
+//SignUp is the handler for "/signup"
 func SignUp(c *context.Context) {
 	c.Title("sign_up")
 
@@ -309,6 +318,7 @@ func SignUp(c *context.Context) {
 	c.Success(SIGNUP)
 }
 
+//SignUpPost is the POST handler for "/join"
 func SignUpPost(c *context.Context, cpt *captcha.Captcha, f form.Register) {
 	c.Title("sign_up")
 
@@ -396,6 +406,7 @@ func SignUpPost(c *context.Context, cpt *captcha.Captcha, f form.Register) {
 	c.SubURLRedirect("/login")
 }
 
+//Activate activates the code
 func Activate(c *context.Context) {
 	code := c.Query("code")
 	if len(code) == 0 {
@@ -449,6 +460,7 @@ func Activate(c *context.Context) {
 	c.Success(ACTIVATE)
 }
 
+//ActivateEmail is the handler to activate the user email
 func ActivateEmail(c *context.Context) {
 	code := c.Query("code")
 	email_string := c.Query("email")
@@ -467,6 +479,7 @@ func ActivateEmail(c *context.Context) {
 	return
 }
 
+//ForgotPasswd is the handler for "/user/forget_password"
 func ForgotPasswd(c *context.Context) {
 	c.Title("auth.forgot_password")
 
@@ -480,6 +493,7 @@ func ForgotPasswd(c *context.Context) {
 	c.Success(FORGOT_PASSWORD)
 }
 
+//ForgotPasswdPost is the POST handler for "/user/forget_password"
 func ForgotPasswdPost(c *context.Context) {
 	c.Title("auth.forgot_password")
 
@@ -528,6 +542,7 @@ func ForgotPasswdPost(c *context.Context) {
 	c.Success(FORGOT_PASSWORD)
 }
 
+//ResetPasswd is the handler to reset your password
 func ResetPasswd(c *context.Context) {
 	c.Title("auth.reset_password")
 
@@ -541,6 +556,7 @@ func ResetPasswd(c *context.Context) {
 	c.Success(RESET_PASSWORD)
 }
 
+//ResetPasswdPost is the POST handler to reset your password
 func ResetPasswdPost(c *context.Context) {
 	c.Title("auth.reset_password")
 

+ 0 - 4
templates/user/dashboard/dashboard.tmpl

@@ -27,13 +27,11 @@
 						<div class="ui link list">
 							<a class="item" href="https://blog.gitote.in">Blog</a>
 							<a class="item" href="{{AppURL}}about">About</a>
-							<a class="item" href="{{AppURL}}shop">Shop</a>
 							<a class="item" href="{{AppURL}}contact">Contact</a>
 						</div>
 					</div>
 					<div class="three wide column">
 						<div class="ui link list">
-							<a class="item" href="{{AppURL}}developers">API</a>
 							<a class="item" href="{{AppURL}}faq">FAQ</a>
 							<a class="item" href="https://status.gitote.in">Status</a>
 							<a class="item" href="{{AppURL}}security">Security</a>
@@ -41,7 +39,6 @@
 					</div>
 					<div class="three wide column">
 						<div class="ui link list">
-							<a class="item" href="{{AppURL}}terms">Terms</a>
 							<a class="item" href="{{AppURL}}privacy">Privacy</a>
 							<a class="item" href="{{AppURL}}help">Help</a>
 						</div>
@@ -261,7 +258,6 @@
 						Status
 						<span style="font-size:8px" class="sitestatus ui empty circular label mini"></span>
 					</a>
-					<a class="contents" href="{{AppURL}}developers">Developers</a>
 					<a class="contents" href="{{AppURL}}tos">Terms</a>
 					<a class="contents" href="{{AppURL}}privacy">Privacy</a>
 					<a class="contents" href="{{AppURL}}brand">Brand</a>