From: Unknown Date: Mon, 24 Mar 2014 16:43:51 +0000 (-0400) Subject: Fix X-Git-Tag: v0.9.99~2348 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=743fee60158edb5815b86504db29b268f29e1cbf;p=gitea.git Fix --- diff --git a/routers/dashboard.go b/routers/dashboard.go index 76ecc3f676..2c81cf23c1 100644 --- a/routers/dashboard.go +++ b/routers/dashboard.go @@ -5,6 +5,7 @@ package routers import ( + "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/middleware" "github.com/gogits/gogs/routers/user" ) @@ -14,6 +15,14 @@ func Home(ctx *middleware.Context) { user.Dashboard(ctx) return } + + // Check auto-login. + userName := ctx.GetCookie(base.CookieUserName) + if len(userName) != 0 { + ctx.Redirect("/user/login") + return + } + ctx.Data["PageIsHome"] = true ctx.HTML(200, "home") } diff --git a/templates/repo/single_file.tmpl b/templates/repo/single_file.tmpl index 45586012ba..6c7e5650a3 100644 --- a/templates/repo/single_file.tmpl +++ b/templates/repo/single_file.tmpl @@ -6,14 +6,14 @@ {{else}} {{.FileName}} {{FileSize .FileSize}} -
- - Raw - - - -
{{end}} +
+ + Raw + + + +
{{if not .FileIsText}}