summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-01-14 21:07:17 +0800
committerUnknwon <u@gogs.io>2016-01-14 21:07:17 +0800
commitf75b5f42870b03ed366956f6b83ca21a34dad810 (patch)
tree9c9399b12699b072179ec16fe2e7343e2a51b77e
parenta72f57374d3357a6e591f24926a0d551954ccbc5 (diff)
parent40413c5c6c1204a465c8be27e72e49ea9c2554cb (diff)
downloadgitea-f75b5f42870b03ed366956f6b83ca21a34dad810.tar.gz
gitea-f75b5f42870b03ed366956f6b83ca21a34dad810.zip
Merge pull request #2383 from exmex/develop
Added organization display on profile
-rw-r--r--routers/user/profile.go7
-rw-r--r--templates/user/profile.tmpl9
2 files changed, 14 insertions, 2 deletions
diff --git a/routers/user/profile.go b/routers/user/profile.go
index 915cf86c61..3a25363818 100644
--- a/routers/user/profile.go
+++ b/routers/user/profile.go
@@ -74,6 +74,13 @@ func Profile(ctx *middleware.Context) {
ctx.Data["Title"] = u.DisplayName()
ctx.Data["PageIsUserProfile"] = true
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")
ctx.Data["TabName"] = tab
diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl
index 741d0c125f..f82edb2230 100644
--- a/templates/user/profile.tmpl
+++ b/templates/user/profile.tmpl
@@ -40,7 +40,7 @@
{{end}}
<li><i class="icon octicon octicon-clock"></i> {{.i18n.Tr "user.join_on"}} {{DateFmtShort .Owner.Created}}</li>
<li>
- <i class="user icon"></i>
+ <i class="icon octicon octicon-person"></i>
<a href="{{.Owner.HomeLink}}/followers">
{{.Owner.NumFollowers}} {{.i18n.Tr "user.followers"}}
</a>
@@ -51,12 +51,17 @@
</li>
{{/*
<li>
- <i class="octicon octicon-star"></i>
+ <i class="icon octicon octicon-star"></i>
<a href="{{.Owner.HomeLink}}/stars">
{{.Owner.NumStars}} {{.i18n.Tr "user.starred"}}
</a>
</li>
*/}}
+ <li>
+ {{range .Orgs}}
+ <a href="{{.HomeLink}}"><img class="ui mini image" src="{{.AvatarLink}}"></a>
+ {{end}}
+ </li>
{{if and .IsSigned (ne .SignedUserName .Owner.Name)}}
<li class="follow">
{{if .SignedUser.IsFollowing .Owner.Id}}