From d88e0be08bc986efa11a628ec1a0effce077c0cc Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Mon, 1 Sep 2025 19:57:06 +0100 Subject: [PATCH] appview/issues: rework issue editing Signed-off-by: oppiliappan --- .../issues/fragments/editIssueComment.html | 82 +++++++++---------- .../repo/issues/fragments/issueComment.html | 58 ------------- 2 files changed, 37 insertions(+), 103 deletions(-) delete mode 100644 appview/pages/templates/repo/issues/fragments/issueComment.html diff --git a/appview/pages/templates/repo/issues/fragments/editIssueComment.html b/appview/pages/templates/repo/issues/fragments/editIssueComment.html index 5b62a8a..422fd0a 100644 --- a/appview/pages/templates/repo/issues/fragments/editIssueComment.html +++ b/appview/pages/templates/repo/issues/fragments/editIssueComment.html @@ -1,51 +1,43 @@ {{ define "repo/issues/fragments/editIssueComment" }} - {{ with .Comment }} -
-
- {{ $owner := didOrHandle $.LoggedInUser.Did $.LoggedInUser.Handle }} - {{ $owner }} +
+ - - {{ $isIssueAuthor := eq .OwnerDid $.Issue.OwnerDid }} - {{ if $isIssueAuthor }} - - author - {{ end }} - - - - {{ template "repo/fragments/time" .Created }} - - - - - -
+ {{ template "editActions" $ }} +
+{{ end }} -
- -
+{{ define "editActions" }} +
+ {{ template "cancel" . }} + {{ template "save" . }}
- {{ end }} {{ end }} +{{ define "save" }} + +{{ end }} + +{{ define "cancel" }} + +{{ end }} diff --git a/appview/pages/templates/repo/issues/fragments/issueComment.html b/appview/pages/templates/repo/issues/fragments/issueComment.html deleted file mode 100644 index 2737671..0000000 --- a/appview/pages/templates/repo/issues/fragments/issueComment.html +++ /dev/null @@ -1,58 +0,0 @@ -{{ define "repo/issues/fragments/issueComment" }} - {{ with .Comment }} -
-
- {{ template "user/fragments/picHandleLink" .OwnerDid }} - - - {{ $isIssueAuthor := eq .OwnerDid $.Issue.OwnerDid }} - {{ if $isIssueAuthor }} - - author - {{ end }} - - - - {{ if .Deleted }} - deleted {{ template "repo/fragments/time" .Deleted }} - {{ else if .Edited }} - edited {{ template "repo/fragments/time" .Edited }} - {{ else }} - {{ template "repo/fragments/time" .Created }} - {{ end }} - - - {{ $isCommentOwner := and $.LoggedInUser (eq $.LoggedInUser.Did .OwnerDid) }} - {{ if and $isCommentOwner (not .Deleted) }} - - - {{ end }} - -
- {{ if not .Deleted }} -
- {{ .Body | markdown }} -
- {{ end }} -
- {{ end }} -{{ end }} -- 2.51.2