From 7d3d8fe716ddca326503c2bab76724260a7d4b17 Mon Sep 17 00:00:00 2001 From: "icyphox.sh" Date: Sun, 13 Apr 2025 09:13:19 +0000 Subject: [PATCH] appview: pages/templates/repo: more fixes and improvements - use a better icon for reopen - fix subtle bug with close and comment - more spacing fixes --- .../templates/fragments/pullActions.html | 2 +- .../pages/templates/repo/issues/issue.html | 45 ++++++++++++------- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/appview/pages/templates/fragments/pullActions.html b/appview/pages/templates/fragments/pullActions.html index 4af5942..7b1d560 100644 --- a/appview/pages/templates/fragments/pullActions.html +++ b/appview/pages/templates/fragments/pullActions.html @@ -79,7 +79,7 @@ hx-post="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/reopen" hx-swap="none" class="btn p-2 flex items-center gap-2"> - {{ i "circle-dot" "w-4 h-4" }} + {{ i "refresh-ccw-dot" "w-4 h-4" }} reopen {{ end }} diff --git a/appview/pages/templates/repo/issues/issue.html b/appview/pages/templates/repo/issues/issue.html index 611d170..07b90f8 100644 --- a/appview/pages/templates/repo/issues/issue.html +++ b/appview/pages/templates/repo/issues/issue.html @@ -44,8 +44,7 @@ {{ end }} {{ define "repoAfter" }} - {{ if gt (len .Comments) 0 }} -
+
{{ range $index, $comment := .Comments }}
{{ end }}
- {{ end }} {{ block "newComment" . }} {{ end }} {{ end }} {{ define "newComment" }} +{{ if gt (len .Comments) 0 }} +
+{{ end }} {{ if .LoggedInUser }} -
-
{{ didOrHandle .LoggedInUser.Did .LoggedInUser.Handle }}
@@ -84,7 +83,6 @@ onkeyup="updateCommentForm()" >
-
@@ -100,7 +98,7 @@ {{ i "message-square-plus" "w-4 h-4" }} comment - + {{ $isIssueAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Issue.OwnerDid) }} {{ $isRepoCollaborator := .RepoInfo.Roles.IsCollaborator }} {{ if and (or $isIssueAuthor $isRepoCollaborator) (eq .State "open") }} @@ -119,16 +117,30 @@ hx-trigger="click from:#close-button" hx-disabled-elt="#close-with-comment" hx-target="#issue-comment" - hx-vals="js:{body: document.getElementById('comment-textarea').value.trim() !== '' ? document.getElementById('comment-textarea').value : null}"> + hx-vals="js:{body: document.getElementById('comment-textarea').value.trim() !== '' ? document.getElementById('comment-textarea').value : ''}" + hx-swap="none" + >
+ hx-swap="none" + >
+ {{ else if and (or $isIssueAuthor $isRepoCollaborator) (eq .State "closed") }} {{ end }} - +