forked from p85947160/gitea
Mirror fix
This commit is contained in:
parent
c3e0554fd7
commit
8de9517862
|
@ -17,3 +17,7 @@ func Home(ctx *middleware.Context) {
|
||||||
ctx.Data["PageIsHome"] = true
|
ctx.Data["PageIsHome"] = true
|
||||||
ctx.Render.HTML(200, "home", ctx.Data)
|
ctx.Render.HTML(200, "home", ctx.Data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Help(ctx *middleware.Context) string {
|
||||||
|
return "This is help page"
|
||||||
|
}
|
||||||
|
|
|
@ -60,3 +60,15 @@ func Setting(ctx *middleware.Context) {
|
||||||
ctx.Data["IsRepoToolbarSetting"] = true
|
ctx.Data["IsRepoToolbarSetting"] = true
|
||||||
ctx.Render.HTML(200, "repo/setting", ctx.Data)
|
ctx.Render.HTML(200, "repo/setting", ctx.Data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Commits(ctx *middleware.Context) string {
|
||||||
|
return "This is commits page"
|
||||||
|
}
|
||||||
|
|
||||||
|
func Issues(ctx *middleware.Context) string {
|
||||||
|
return "This is issues page"
|
||||||
|
}
|
||||||
|
|
||||||
|
func Pulls(ctx *middleware.Context) string {
|
||||||
|
return "This is pulls page"
|
||||||
|
}
|
||||||
|
|
|
@ -189,3 +189,15 @@ func Feeds(ctx *middleware.Context, form auth.FeedsForm) {
|
||||||
}
|
}
|
||||||
ctx.Render.JSON(200, &feeds)
|
ctx.Render.JSON(200, &feeds)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Issues(ctx *middleware.Context) string {
|
||||||
|
return "This is issues page"
|
||||||
|
}
|
||||||
|
|
||||||
|
func Pulls(ctx *middleware.Context) string {
|
||||||
|
return "This is pulls page"
|
||||||
|
}
|
||||||
|
|
||||||
|
func Stars(ctx *middleware.Context) string {
|
||||||
|
return "This is stars page"
|
||||||
|
}
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
<nav class="gogs-nav">
|
<nav class="gogs-nav">
|
||||||
<a id="gogs-nav-logo" class="gogs-nav-item{{if .PageIsHome}} active{{end}}" href="/"><img src="/img/favicon.png" alt="Gogs Logo" id="gogs-logo"></a>
|
<a id="gogs-nav-logo" class="gogs-nav-item{{if .PageIsHome}} active{{end}}" href="/"><img src="/img/favicon.png" alt="Gogs Logo" id="gogs-logo"></a>
|
||||||
<a class="gogs-nav-item{{if .PageIsUserDashboard}} active{{end}}" href="/">Dashboard</a>
|
<a class="gogs-nav-item{{if .PageIsUserDashboard}} active{{end}}" href="/">Dashboard</a>
|
||||||
<a class="gogs-nav-item" href="#">Explore</a>
|
<a class="gogs-nav-item" href="/help">Help</a>{{if .IsSigned}}
|
||||||
<a class="gogs-nav-item" href="#">Help</a>{{if .IsSigned}}
|
|
||||||
<a id="gogs-nav-out" class="gogs-nav-item navbar-right navbar-btn btn btn-danger" href="/user/logout/"><i class="fa fa-power-off fa-lg"></i></a>
|
<a id="gogs-nav-out" class="gogs-nav-item navbar-right navbar-btn btn btn-danger" href="/user/logout/"><i class="fa fa-power-off fa-lg"></i></a>
|
||||||
<a id="gogs-nav-avatar" class="gogs-nav-item navbar-right" href="{{.SignedUser.HomeLink}}" data-toggle="tooltip" data-placement="bottom" title="{{.SignedUserName}}">
|
<a id="gogs-nav-avatar" class="gogs-nav-item navbar-right" href="{{.SignedUser.HomeLink}}" data-toggle="tooltip" data-placement="bottom" title="{{.SignedUserName}}">
|
||||||
<img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username"/>
|
<img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username"/>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="gogs-repo-setting-container" class="col-md-9 tab-content">
|
<div id="gogs-repo-setting-container" class="col-md-9 tab-content">
|
||||||
<div id="options" class="tab-pane">
|
<div id="options" class="tab-pane">
|
||||||
repo-options
|
<h4>Repository Options</h4>
|
||||||
</div>
|
</div>
|
||||||
<div id="delete" class="tab-pane">
|
<div id="delete" class="tab-pane">
|
||||||
<h4>Delete Repository</h4>
|
<h4>Delete Repository</h4>
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
<a href="#" class="btn btn-success dropdown-toggle" data-toggle="dropdown"><i class="fa fa-chain"></i>master
|
<a href="#" class="btn btn-success dropdown-toggle" data-toggle="dropdown"><i class="fa fa-chain"></i>master
|
||||||
<b class="caret"></b></a>
|
<b class="caret"></b></a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li><a class="current" href="/{{.RepositoryLink}}/branch/master">master</a></li>
|
<li><a class="current" href="/{{.RepositoryLink}}/tree/master">master</a></li>
|
||||||
<li><a href="//{{.RepositoryLink}}/branch/develop">develop</a></li>
|
<li><a href="/{{.RepositoryLink}}/tree/develop">develop</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{{$paths := .Paths}}
|
{{$paths := .Paths}}
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
{{if .IsDir}}
|
{{if .IsDir}}
|
||||||
<a href="/{{$username}}/{{$reponame}}/tree/{{$branchname}}/{{.Path}}">{{.Name}}</a>
|
<a href="/{{$username}}/{{$reponame}}/tree/{{$branchname}}/{{.Path}}">{{.Name}}</a>
|
||||||
{{else}}
|
{{else}}
|
||||||
<a href="#">{{.Name}} - {{FileSize .Size}}</a>
|
<a href="/{{$username}}/{{$reponame}}/blob/{{$branchname}}/{{.Name}}">{{.Name}} - {{FileSize .Size}}</a>
|
||||||
{{end}}</td>
|
{{end}}</td>
|
||||||
<td class="date"><time datetime="{{.Created}}" data-title="true" title="{{.Created}}">{{TimeSince .Created}}</time></td>
|
<td class="date"><time datetime="{{.Created}}" data-title="true" title="{{.Created}}">{{TimeSince .Created}}</time></td>
|
||||||
<td class="text">{{.Message}}</td>
|
<td class="text">{{.Message}}</td>
|
||||||
|
|
8
web.go
8
web.go
|
@ -50,6 +50,9 @@ func runWeb(*cli.Context) {
|
||||||
|
|
||||||
// Routers.
|
// Routers.
|
||||||
m.Get("/", middleware.SignInRequire(false), routers.Home)
|
m.Get("/", middleware.SignInRequire(false), routers.Home)
|
||||||
|
m.Get("/issues", middleware.SignInRequire(true), user.Issues)
|
||||||
|
m.Get("/pulls", middleware.SignInRequire(true), user.Pulls)
|
||||||
|
m.Get("/stars", middleware.SignInRequire(true), user.Stars)
|
||||||
m.Any("/user/login", middleware.SignOutRequire(), binding.BindIgnErr(auth.LogInForm{}), user.SignIn)
|
m.Any("/user/login", middleware.SignOutRequire(), binding.BindIgnErr(auth.LogInForm{}), user.SignIn)
|
||||||
m.Any("/user/logout", middleware.SignInRequire(true), user.SignOut)
|
m.Any("/user/logout", middleware.SignInRequire(true), user.SignOut)
|
||||||
m.Any("/user/sign_up", middleware.SignOutRequire(), binding.BindIgnErr(auth.RegisterForm{}), user.SignUp)
|
m.Any("/user/sign_up", middleware.SignOutRequire(), binding.BindIgnErr(auth.RegisterForm{}), user.SignUp)
|
||||||
|
@ -67,7 +70,12 @@ func runWeb(*cli.Context) {
|
||||||
m.Any("/repo/create", middleware.SignInRequire(true), binding.BindIgnErr(auth.CreateRepoForm{}), repo.Create)
|
m.Any("/repo/create", middleware.SignInRequire(true), binding.BindIgnErr(auth.CreateRepoForm{}), repo.Create)
|
||||||
m.Any("/repo/delete", middleware.SignInRequire(true), binding.Bind(auth.DeleteRepoForm{}), repo.Delete)
|
m.Any("/repo/delete", middleware.SignInRequire(true), binding.Bind(auth.DeleteRepoForm{}), repo.Delete)
|
||||||
|
|
||||||
|
m.Get("/help", routers.Help)
|
||||||
|
|
||||||
m.Get("/:username/:reponame/settings", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Setting)
|
m.Get("/:username/:reponame/settings", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Setting)
|
||||||
|
m.Get("/:username/:reponame/commits", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Commits)
|
||||||
|
m.Get("/:username/:reponame/issues", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Issues)
|
||||||
|
m.Get("/:username/:reponame/pulls", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Pulls)
|
||||||
m.Get("/:username/:reponame/tree/:branchname/**",
|
m.Get("/:username/:reponame/tree/:branchname/**",
|
||||||
middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Single)
|
middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Single)
|
||||||
m.Get("/:username/:reponame/tree/:branchname",
|
m.Get("/:username/:reponame/tree/:branchname",
|
||||||
|
|
Loading…
Reference in New Issue