aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/middlewares.go
diff options
context:
space:
mode:
authorBwko <bouwko@gmail.com>2016-11-19 16:53:34 +0100
committerGitHub <noreply@github.com>2016-11-19 16:53:34 +0100
commit7b75d93f3da42a9ea1783b0cb85f88977549cf05 (patch)
tree059f1b6d40797680a60aec0b81df583e12c6bb85 /routers/repo/middlewares.go
parentfc3ed8a1de0e35eefff083176211c4eb61a264ca (diff)
downloadgitea-7b75d93f3da42a9ea1783b0cb85f88977549cf05.tar.gz
gitea-7b75d93f3da42a9ea1783b0cb85f88977549cf05.zip
Fix for anonymous users to switch views
Diffstat (limited to 'routers/repo/middlewares.go')
-rw-r--r--routers/repo/middlewares.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/routers/repo/middlewares.go b/routers/repo/middlewares.go
index b16b003cfe..11b0009dbf 100644
--- a/routers/repo/middlewares.go
+++ b/routers/repo/middlewares.go
@@ -23,14 +23,16 @@ func SetEditorconfigIfExists(ctx *context.Context) {
}
func SetDiffViewStyle(ctx *context.Context) {
+ queryStyle := ctx.Query("style")
+
if !ctx.IsSigned {
+ ctx.Data["IsSplitStyle"] = queryStyle == "split"
return
}
var (
- userStyle = ctx.User.DiffViewStyle
- queryStyle = ctx.Query("style")
- style string
+ userStyle = ctx.User.DiffViewStyle
+ style string
)
if queryStyle == "unified" || queryStyle == "split" {