aboutsummaryrefslogtreecommitdiffstats
path: root/modules/context/org.go
diff options
context:
space:
mode:
authorTim-Nicas Oelschläger <72873130+zokkis@users.noreply.github.com>2024-02-23 01:24:57 +0100
committerGitHub <noreply@github.com>2024-02-23 01:24:57 +0100
commit532e422027c88a4a3dc0c2968857f8d5f94d861f (patch)
treedbea8ccb30a7e10713bf16653f3d6aaee3ca3d23 /modules/context/org.go
parente0445042410da1fb3e5b44edebd0f5d2b7ae06b2 (diff)
downloadgitea-532e422027c88a4a3dc0c2968857f8d5f94d861f.tar.gz
gitea-532e422027c88a4a3dc0c2968857f8d5f94d861f.zip
Unify organizations header (#29248)
Unify organizations header before: ![image](https://github.com/go-gitea/gitea/assets/72873130/74474e0d-33c3-4bbf-9324-d130ea2c62f8) after: ![image](https://github.com/go-gitea/gitea/assets/72873130/1c65de0d-fa0f-4b17-ab8d-067de8c7113b) --------- Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'modules/context/org.go')
-rw-r--r--modules/context/org.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/context/org.go b/modules/context/org.go
index d068646577..018b76de43 100644
--- a/modules/context/org.go
+++ b/modules/context/org.go
@@ -11,6 +11,8 @@ import (
"code.gitea.io/gitea/models/perm"
"code.gitea.io/gitea/models/unit"
user_model "code.gitea.io/gitea/models/user"
+ "code.gitea.io/gitea/modules/markup"
+ "code.gitea.io/gitea/modules/markup/markdown"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/structs"
)
@@ -255,6 +257,19 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
ctx.Data["CanReadProjects"] = ctx.Org.CanReadUnit(ctx, unit.TypeProjects)
ctx.Data["CanReadPackages"] = ctx.Org.CanReadUnit(ctx, unit.TypePackages)
ctx.Data["CanReadCode"] = ctx.Org.CanReadUnit(ctx, unit.TypeCode)
+
+ ctx.Data["IsFollowing"] = ctx.Doer != nil && user_model.IsFollowing(ctx, ctx.Doer.ID, ctx.ContextUser.ID)
+ if len(ctx.ContextUser.Description) != 0 {
+ content, err := markdown.RenderString(&markup.RenderContext{
+ Metas: map[string]string{"mode": "document"},
+ Ctx: ctx,
+ }, ctx.ContextUser.Description)
+ if err != nil {
+ ctx.ServerError("RenderString", err)
+ return
+ }
+ ctx.Data["RenderedDescription"] = content
+ }
}
// OrgAssignment returns a middleware to handle organization assignment