Merge branch 'master' of github.com:gogits/gogs

This commit is contained in:
slene 2014-03-16 00:15:26 +08:00
commit 3d032dfb5a
6 changed files with 17 additions and 25 deletions

View File

@ -67,20 +67,3 @@ func Delete(ctx *middleware.Context, form auth.DeleteRepoForm) {
ctx.Render.Redirect("/", 302)
}
func List(ctx *middleware.Context) {
if ctx.User != nil {
ctx.Render.Redirect("/")
return
}
ctx.Data["Title"] = "Repositories"
repos, err := models.GetRepositories(ctx.User)
if err != nil {
ctx.Handle(200, "repo.List", err)
return
}
ctx.Data["Repos"] = repos
ctx.Render.HTML(200, "repo/list", ctx.Data)
}

View File

@ -43,7 +43,6 @@ func Single(ctx *middleware.Context, params martini.Params) {
ctx.Data["Treenames"] = treenames
ctx.Data["IsRepoToolbarSource"] = true
ctx.Data["Files"] = files
ctx.Render.HTML(200, "repo/single", ctx.Data)
}

View File

@ -60,7 +60,12 @@ func Profile(ctx *middleware.Context, params martini.Params) {
}
ctx.Data["Feeds"] = feeds
default:
repos, err := models.GetRepositories(user)
if err != nil {
ctx.Handle(200, "user.Profile", err)
return
}
ctx.Data["Repos"] = repos
}
ctx.Render.HTML(200, "user/profile", ctx.Data)

View File

@ -4,9 +4,9 @@
<div class="container">
<ul class="nav nav-pills pull-right">
<li class="active"><a href="/">Feed</a></li>
<li><a href="/issues/">Issues</a></li>
<li><a href="/pulls/">Pull Requests</a></li>
<li><a href="/stars/">Stars</a></li>
<li><a href="/issues">Issues</a></li>
<li><a href="/pulls">Pull Requests</a></li>
<li><a href="/stars">Stars</a></li>
</ul>
<h3>News Feed</h3>
</div>
@ -29,7 +29,7 @@
<div id="gogs-feed-right" class="col-md-4">
<div class="panel panel-default repo-panel">
<div class="panel-heading">Your Repositories
<a class="btn btn-success pull-right btn-sm" href="/repo/create/"><i class="fa fa-plus-square"></i>New Repo</a>
<a class="btn btn-success pull-right btn-sm" href="/repo/create"><i class="fa fa-plus-square"></i>New Repo</a>
</div>
<div class="panel-body">
<ul class="list-group">{{range .MyRepos}}

View File

@ -44,7 +44,13 @@
</ul>
</div>
{{else}}
<div class="tab-pane active">repo</div>
{{$owner := .Owner}}
<div class="tab-pane active">
{{range .Repos}}
<h4><a href="/{{$owner.Name}}/{{.LowerName}}">{{.LowerName}}</a> <small>Star:{{.NumStars}} Fork:{{.NumForks}}</small></h4>
<p>{{.Description}}</p>
{{end}}
</div>
{{end}}
</div>
</div>

1
web.go
View File

@ -66,7 +66,6 @@ func runWeb(*cli.Context) {
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/list", middleware.SignInRequire(false), repo.List)
m.Get("/:username/:reponame/settings", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Setting)
m.Get("/:username/:reponame/tree/:branchname/**",