From f610bfa8a2ccaf195fe89866da55879436a202d8 Mon Sep 17 00:00:00 2001 From: ExMex Date: Tue, 12 Jan 2016 03:09:59 +0100 Subject: [PATCH] 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 915cf86c6..3a2536381 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 741d0c125..324056a10 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -40,7 +40,7 @@ {{end}}
  • {{.i18n.Tr "user.join_on"}} {{DateFmtShort .Owner.Created}}
  • - + {{.Owner.NumFollowers}} {{.i18n.Tr "user.followers"}} @@ -51,12 +51,17 @@
  • {{/*
  • - + {{.Owner.NumStars}} {{.i18n.Tr "user.starred"}}
  • */}} +
  • + {{range .Orgs}} + + {{end}} +
  • {{if and .IsSigned (ne .SignedUserName .Owner.Name)}}
  • {{if .SignedUser.IsFollowing .Owner.Id}}