Mirror of @tangled.org/core. Running on a Raspberry Pi Zero 2 (Please be gentle).

allow collaborators to close issues

+12 -5
+9 -4
appview/pages/pages.go
··· 231 231 return slices.Contains(r.Roles, "repo:owner") 232 232 } 233 233 234 + func (r RolesInRepo) IsCollaborator() bool { 235 + return slices.Contains(r.Roles, "repo:collaborator") 236 + } 237 + 234 238 func (r RepoInfo) OwnerWithAt() string { 235 239 if r.OwnerHandle != "" { 236 240 return fmt.Sprintf("@%s", r.OwnerHandle) ··· 445 441 } 446 442 447 443 type RepoSettingsParams struct { 448 - LoggedInUser *auth.User 449 - RepoInfo RepoInfo 450 - Collaborators []Collaborator 451 - Active string 444 + LoggedInUser *auth.User 445 + RepoInfo RepoInfo 446 + Collaborators []Collaborator 447 + Active string 448 + // TODO: use repoinfo.roles 452 449 IsCollaboratorInviteAllowed bool 453 450 } 454 451
+3 -1
appview/pages/templates/repo/issues/issue.html
··· 101 101 </form> 102 102 {{ end }} 103 103 104 - {{ if eq .LoggedInUser.Did .Issue.OwnerDid }} 104 + {{ $isIssueAuthor := eq .LoggedInUser.Did .Issue.OwnerDid }} 105 + {{ $isRepoCollaborator := .RepoInfo.Roles.IsCollaborator }} 106 + {{ if or $isIssueAuthor $isRepoCollaborator }} 105 107 {{ $action := "close" }} 106 108 {{ $icon := "circle-x" }} 107 109 {{ $hoverColor := "red" }}