From f610bfa8a2ccaf195fe89866da55879436a202d8 Mon Sep 17 00:00:00 2001 From: ExMex <great.mafia2010@gmail.com> Date: Tue, 12 Jan 2016 03:09:59 +0100 Subject: [PATCH 1/3] Added organization display on profile Fixed "Follower" Icon too big --- routers/user/profile.go | 7 +++++++ templates/user/profile.tmpl | 9 +++++++-- 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..324056a10c 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}} + <img class="ui mini image" src="{{.AvatarLink}}"> + {{end}} + </li> {{if and .IsSigned (ne .SignedUserName .Owner.Name)}} <li class="follow"> {{if .SignedUser.IsFollowing .Owner.Id}} From 53a63de9dcd3f5dd79d727d9e91aae626403ac9f Mon Sep 17 00:00:00 2001 From: ExMex <great.mafia2010@gmail.com> Date: Tue, 12 Jan 2016 03:19:46 +0100 Subject: [PATCH 2/3] Added links to org profile icons --- templates/user/profile.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 324056a10c..50d371b59b 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -59,7 +59,7 @@ */}} <li> {{range .Orgs}} - <img class="ui mini image" src="{{.AvatarLink}}"> + <a href="{{AppSubUrl}}/{{.Name}}"><img class="ui mini image" src="{{.AvatarLink}}"></a> {{end}} </li> {{if and .IsSigned (ne .SignedUserName .Owner.Name)}} From 40413c5c6c1204a465c8be27e72e49ea9c2554cb Mon Sep 17 00:00:00 2001 From: ExMex <great.mafia2010@gmail.com> Date: Thu, 14 Jan 2016 11:48:24 +0100 Subject: [PATCH 3/3] Added improvement from Unknwon --- templates/user/profile.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 50d371b59b..f82edb2230 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -59,7 +59,7 @@ */}} <li> {{range .Orgs}} - <a href="{{AppSubUrl}}/{{.Name}}"><img class="ui mini image" src="{{.AvatarLink}}"></a> + <a href="{{.HomeLink}}"><img class="ui mini image" src="{{.AvatarLink}}"></a> {{end}} </li> {{if and .IsSigned (ne .SignedUserName .Owner.Name)}}