forked from tangled.org/core
Monorepo for Tangled

allow collaborators to close issues

Changed files
+12 -5
appview
pages
templates
repo
issues
+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) ··· 441 445 } 442 446 443 447 type RepoSettingsParams struct { 444 - LoggedInUser *auth.User 445 - RepoInfo RepoInfo 446 - Collaborators []Collaborator 447 - Active string 448 + LoggedInUser *auth.User 449 + RepoInfo RepoInfo 450 + Collaborators []Collaborator 451 + Active string 452 + // TODO: use repoinfo.roles 448 453 IsCollaboratorInviteAllowed bool 449 454 } 450 455
+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" }}