File tree Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import (
20
20
"code.gitea.io/gitea/modules/markup/markdown"
21
21
"code.gitea.io/gitea/modules/setting"
22
22
"code.gitea.io/gitea/modules/util"
23
+ "code.gitea.io/gitea/routers/web/shared/user"
23
24
shared_user "code.gitea.io/gitea/routers/web/shared/user"
24
25
)
25
26
@@ -41,22 +42,11 @@ func Home(ctx *context.Context) {
41
42
if ctx .Written () {
42
43
return
43
44
}
44
-
45
+ user . PrepareContextForOrgProfileBigAvatar ( ctx )
45
46
org := ctx .Org .Organization
46
47
47
48
ctx .Data ["PageIsUserProfile" ] = true
48
49
ctx .Data ["Title" ] = org .DisplayName ()
49
- if len (org .Description ) != 0 {
50
- desc , err := markdown .RenderString (& markup.RenderContext {
51
- Ctx : ctx ,
52
- Metas : map [string ]string {"mode" : "document" },
53
- }, org .Description )
54
- if err != nil {
55
- ctx .ServerError ("RenderString" , err )
56
- return
57
- }
58
- ctx .Data ["RenderedDescription" ] = desc
59
- }
60
50
61
51
var orderBy db.SearchOrderBy
62
52
ctx .Data ["SortType" ] = ctx .FormString ("sort" )
Original file line number Diff line number Diff line change @@ -35,6 +35,18 @@ func PrepareContextForOrgProfileBigAvatar(ctx *context.Context) {
35
35
prepareContextForCommonProfile (ctx )
36
36
37
37
ctx .Data ["IsFollowing" ] = ctx .Doer != nil && user_model .IsFollowing (ctx , ctx .Doer .ID , ctx .ContextUser .ID )
38
+
39
+ if len (ctx .ContextUser .Description ) != 0 {
40
+ desc , err := markdown .RenderString (& markup.RenderContext {
41
+ Ctx : ctx ,
42
+ Metas : map [string ]string {"mode" : "document" },
43
+ }, ctx .ContextUser .Description )
44
+ if err != nil {
45
+ ctx .ServerError ("RenderString" , err )
46
+ return
47
+ }
48
+ ctx .Data ["RenderedDescription" ] = desc
49
+ }
38
50
}
39
51
40
52
// PrepareContextForProfileBigAvatar set the context for big avatar view on the profile page
You can’t perform that action at this time.
0 commit comments