Browse Source

Merge pull request #2383 from exmex/develop

Added organization display on profile
for-closed-social
Unknwon 8 years ago
parent
commit
f75b5f4287
2 changed files with 14 additions and 2 deletions
  1. +7
    -0
      routers/user/profile.go
  2. +7
    -2
      templates/user/profile.tmpl

+ 7
- 0
routers/user/profile.go View File

@ -74,6 +74,13 @@ func Profile(ctx *middleware.Context) {
ctx.Data["Title"] = u.DisplayName() ctx.Data["Title"] = u.DisplayName()
ctx.Data["PageIsUserProfile"] = true ctx.Data["PageIsUserProfile"] = true
ctx.Data["Owner"] = u ctx.Data["Owner"] = u
orgs, err := models.GetOwnedOrgsByUserIDDesc(u.Id, "updated")
if err != nil {
ctx.Handle(500, "GetOwnedOrgsByUserIDDesc", err)
return
}
ctx.Data["Orgs"] = orgs
tab := ctx.Query("tab") tab := ctx.Query("tab")
ctx.Data["TabName"] = tab ctx.Data["TabName"] = tab

+ 7
- 2
templates/user/profile.tmpl View File

@ -40,7 +40,7 @@
{{end}} {{end}}
<li><i class="icon octicon octicon-clock"></i> {{.i18n.Tr "user.join_on"}} {{DateFmtShort .Owner.Created}}</li> <li><i class="icon octicon octicon-clock"></i> {{.i18n.Tr "user.join_on"}} {{DateFmtShort .Owner.Created}}</li>
<li> <li>
<i class="user icon"></i>
<i class="icon octicon octicon-person"></i>
<a href="{{.Owner.HomeLink}}/followers"> <a href="{{.Owner.HomeLink}}/followers">
{{.Owner.NumFollowers}} {{.i18n.Tr "user.followers"}} {{.Owner.NumFollowers}} {{.i18n.Tr "user.followers"}}
</a> </a>
@ -51,12 +51,17 @@
</li> </li>
{{/* {{/*
<li> <li>
<i class="octicon octicon-star"></i>
<i class="icon octicon octicon-star"></i>
<a href="{{.Owner.HomeLink}}/stars"> <a href="{{.Owner.HomeLink}}/stars">
{{.Owner.NumStars}} {{.i18n.Tr "user.starred"}} {{.Owner.NumStars}} {{.i18n.Tr "user.starred"}}
</a> </a>
</li> </li>
*/}} */}}
<li>
{{range .Orgs}}
<a href="{{.HomeLink}}"><img class="ui mini image" src="{{.AvatarLink}}"></a>
{{end}}
</li>
{{if and .IsSigned (ne .SignedUserName .Owner.Name)}} {{if and .IsSigned (ne .SignedUserName .Owner.Name)}}
<li class="follow"> <li class="follow">
{{if .SignedUser.IsFollowing .Owner.Id}} {{if .SignedUser.IsFollowing .Owner.Id}}

Loading…
Cancel
Save