forked from tangled.org/core
this repo has no description

allow collaborators to close issues

Changed files
+12 -5
appview
pages
templates
repo
issues
+9 -4
appview/pages/pages.go
···
return slices.Contains(r.Roles, "repo:owner")
}
+
func (r RolesInRepo) IsCollaborator() bool {
+
return slices.Contains(r.Roles, "repo:collaborator")
+
}
+
func (r RepoInfo) OwnerWithAt() string {
if r.OwnerHandle != "" {
return fmt.Sprintf("@%s", r.OwnerHandle)
···
}
type RepoSettingsParams struct {
-
LoggedInUser *auth.User
-
RepoInfo RepoInfo
-
Collaborators []Collaborator
-
Active string
+
LoggedInUser *auth.User
+
RepoInfo RepoInfo
+
Collaborators []Collaborator
+
Active string
+
// TODO: use repoinfo.roles
IsCollaboratorInviteAllowed bool
}
+3 -1
appview/pages/templates/repo/issues/issue.html
···
</form>
{{ end }}
-
{{ if eq .LoggedInUser.Did .Issue.OwnerDid }}
+
{{ $isIssueAuthor := eq .LoggedInUser.Did .Issue.OwnerDid }}
+
{{ $isRepoCollaborator := .RepoInfo.Roles.IsCollaborator }}
+
{{ if or $isIssueAuthor $isRepoCollaborator }}
{{ $action := "close" }}
{{ $icon := "circle-x" }}
{{ $hoverColor := "red" }}