Browse Source

Mirror update on create repo page

for-closed-social
Unknown 10 years ago
parent
commit
4cf7a1fca5
2 changed files with 23 additions and 1 deletions
  1. +13
    -0
      routers/repo/repo.go
  2. +10
    -1
      templates/repo/create.tmpl

+ 13
- 0
routers/repo/repo.go View File

@ -36,6 +36,13 @@ func Create(ctx *middleware.Context) {
ctx.Data["PageIsNewRepo"] = true
ctx.Data["LanguageIgns"] = models.LanguageIgns
ctx.Data["Licenses"] = models.Licenses
if err := ctx.User.GetOrganizations(); err != nil {
ctx.Handle(500, "home.Dashboard(GetOrganizations)", err)
return
}
ctx.Data["Orgs"] = ctx.User.Orgs
ctx.HTML(200, CREATE)
}
@ -45,6 +52,12 @@ func CreatePost(ctx *middleware.Context, form auth.CreateRepoForm) {
ctx.Data["LanguageIgns"] = models.LanguageIgns
ctx.Data["Licenses"] = models.Licenses
if err := ctx.User.GetOrganizations(); err != nil {
ctx.Handle(500, "home.Dashboard(GetOrganizations)", err)
return
}
ctx.Data["Orgs"] = ctx.User.Orgs
if ctx.HasError() {
ctx.HTML(200, CREATE)
return

+ 10
- 1
templates/repo/create.tmpl View File

@ -19,12 +19,21 @@
<div class="dropdown-menu clone-group-btn no-propagation">
<ul id="dashboard-switch-menu" class="list-unstyled">
<li data-uid="{{.SignedUser.Id}}" class="checked">
<a href="#">
<a>
<i class="fa fa-check"></i>
<img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username">
{{.SignedUser.Name}}
</a>
</li>
{{range .Orgs}}
<li data-uid="{{.Id}}">
<a>
<i class="fa fa-check"></i>
<img src="{{.AvatarLink}}?s=28" alt="user-avatar" title="username">
{{.Name}}
</a>
</li>
{{end}}
</ul>
</div>
</div>

Loading…
Cancel
Save