File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 55package context
66
77import (
8+ shared_group "code.gitea.io/gitea/models/shared/group"
89 "strings"
910
1011 "code.gitea.io/gitea/models/organization"
@@ -250,5 +251,19 @@ func OrgAssignment(opts OrgAssignmentOptions) func(ctx *Context) {
250251 }
251252 ctx .Data ["RenderedDescription" ] = content
252253 }
254+ ctx .Data ["AsGroupItem" ] = func (v any ) shared_group.GroupItem {
255+ if gi , ok := v .(shared_group.GroupItem ); ok {
256+ return gi
257+ }
258+ return nil
259+ }
260+ ctx .Data ["GroupNavItems" ] = shared_group .GetTopLevelGroupItemList (ctx , ctx .ContextUser .ID , ctx .Doer )
261+ ctx .Data ["GroupIsCurrent" ] = groupIsCurrent (ctx )
262+ ctx .Data ["GroupHasChild" ] = func (it shared_group.GroupItem ) bool {
263+ if ctx .RepoGroup == nil || ctx .RepoGroup .Group == nil {
264+ return false
265+ }
266+ return shared_group .GroupItemHasChild (it , ctx .RepoGroup .Group .ID , ctx , ctx .Doer )
267+ }
253268 }
254269}
You can’t perform that action at this time.
0 commit comments