tokarchuk/v1.17
Unknown 11 years ago
parent 79633ab1fb
commit 743fee6015
  1. 9
      routers/dashboard.go
  2. 2
      templates/repo/single_file.tmpl

@ -5,6 +5,7 @@
package routers package routers
import ( import (
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/middleware" "github.com/gogits/gogs/modules/middleware"
"github.com/gogits/gogs/routers/user" "github.com/gogits/gogs/routers/user"
) )
@ -14,6 +15,14 @@ func Home(ctx *middleware.Context) {
user.Dashboard(ctx) user.Dashboard(ctx)
return return
} }
// Check auto-login.
userName := ctx.GetCookie(base.CookieUserName)
if len(userName) != 0 {
ctx.Redirect("/user/login")
return
}
ctx.Data["PageIsHome"] = true ctx.Data["PageIsHome"] = true
ctx.HTML(200, "home") ctx.HTML(200, "home")
} }

@ -6,6 +6,7 @@
{{else}} {{else}}
<i class="icon fa fa-file-text-o"></i> <i class="icon fa fa-file-text-o"></i>
{{.FileName}} <span class="file-size">{{FileSize .FileSize}}</span> {{.FileName}} <span class="file-size">{{FileSize .FileSize}}</span>
{{end}}
<div class="btn-group pull-right"> <div class="btn-group pull-right">
<a class="btn btn-default hidden" href="#">Edit</a> <a class="btn btn-default hidden" href="#">Edit</a>
<a class="btn btn-default" href="{{.FileLink}}">Raw</a> <a class="btn btn-default" href="{{.FileLink}}">Raw</a>
@ -13,7 +14,6 @@
<a class="btn btn-default hidden" href="#">History</a> <a class="btn btn-default hidden" href="#">History</a>
<a class="btn btn-danger hidden" href="#">Delete</a> <a class="btn btn-danger hidden" href="#">Delete</a>
</div> </div>
{{end}}
</div> </div>
{{if not .FileIsText}} {{if not .FileIsText}}
<div class="panel-footer text-center"> <div class="panel-footer text-center">

Loading…
Cancel
Save