diff --git a/appview/pages/templates/repo/issues/fragments/issueCommentBody.html b/appview/pages/templates/repo/issues/fragments/issueCommentBody.html new file mode 100644 index 00000000..0dbababe --- /dev/null +++ b/appview/pages/templates/repo/issues/fragments/issueCommentBody.html @@ -0,0 +1,9 @@ +{{ define "repo/issues/fragments/issueCommentBody" }} +
+ {{ if not .Comment.Deleted }} +
{{ .Comment.Body | markdown }}
+ {{ else }} +
[deleted by author]
+ {{ end }} +
+{{ end }} diff --git a/appview/pages/templates/repo/issues/fragments/issueCommentHeader.html b/appview/pages/templates/repo/issues/fragments/issueCommentHeader.html new file mode 100644 index 00000000..58fd6bf4 --- /dev/null +++ b/appview/pages/templates/repo/issues/fragments/issueCommentHeader.html @@ -0,0 +1,56 @@ +{{ define "repo/issues/fragments/issueCommentHeader" }} +
+ {{ template "user/fragments/picHandleLink" .Comment.Did }} + {{ template "hats" $ }} + {{ template "timestamp" . }} + {{ $isCommentOwner := and .LoggedInUser (eq .LoggedInUser.Did .Comment.Did) }} + {{ if and $isCommentOwner (not .Comment.Deleted) }} + {{ template "edit" . }} + {{ template "delete" . }} + {{ end }} +
+{{ end }} + +{{ define "hats" }} + {{ $isIssueAuthor := eq .Comment.Did .Issue.Did }} + {{ if $isIssueAuthor }} + (author) + {{ end }} +{{ end }} + +{{ define "timestamp" }} + + {{ if .Comment.Deleted }} + {{ template "repo/fragments/shortTimeAgo" .Comment.Deleted }} + {{ else if .Comment.Edited }} + edited {{ template "repo/fragments/shortTimeAgo" .Comment.Edited }} + {{ else }} + {{ template "repo/fragments/shortTimeAgo" .Comment.Created }} + {{ end }} + +{{ end }} + +{{ define "edit" }} + + {{ i "pencil" "size-3" }} + +{{ end }} + +{{ define "delete" }} + + {{ i "trash-2" "size-3" }} + {{ i "loader-circle" "size-3 animate-spin hidden group-[.htmx-request]:inline" }} + +{{ end }} diff --git a/appview/pages/templates/repo/issues/fragments/newComment.html b/appview/pages/templates/repo/issues/fragments/newComment.html new file mode 100644 index 00000000..f55e3482 --- /dev/null +++ b/appview/pages/templates/repo/issues/fragments/newComment.html @@ -0,0 +1,145 @@ +{{ define "repo/issues/fragments/newComment" }} + {{ if .LoggedInUser }} +
+
+
+ {{ template "user/fragments/picHandleLink" .LoggedInUser.Did }} +
+ +
+
+
+ +
+ + + {{ $isIssueAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Issue.Did) }} + {{ $isRepoCollaborator := .RepoInfo.Roles.IsCollaborator }} + {{ $isRepoOwner := .RepoInfo.Roles.IsOwner }} + {{ if and (or $isIssueAuthor $isRepoCollaborator $isRepoOwner) (eq .State "open") }} + +
+
+
+
+ + {{ else if and (or $isIssueAuthor $isRepoCollaborator $isRepoOwner) (eq .State "closed") }} + + {{ end }} + + +
+
+ {{ else }} +
+ login to join the discussion +
+ {{ end }} +{{ end }}