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

appview: pages: add spinners to more buttons

This commit adds spinners to what I believe to be all the buttons on the
following pages:
- follow: add spinner to follow button
- issues/new: add spinner to create button
- issue: add spinners to close/reopen issue buttons
- issueComment: add spinner to delete button
- editIssueComment: add spinner to check mark button
- pulls/new: add spinner to create button
- pullNewComment: add spinner to comment button, submit and cancel
- pullResubmit: add spinners to resubmit / cancel button
- settings: add spinners to buttons
- knots: add spinners to buttons
- settings: add spinners to user settings page

authored by brookjeynes.dev and committed by Tangled d0be79b0 050c5aef

Changed files
+172 -63
appview
+11 -5
appview/pages/templates/knots.html
··· 10 <form 11 hx-post="/knots/key" 12 class="max-w-2xl mb-8 space-y-4" 13 > 14 <input 15 type="text" ··· 18 placeholder="knot.example.com" 19 required 20 class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:placeholder-gray-400" 21 - /> 22 - <button class="btn dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600" type="submit"> 23 - generate key 24 </button> 25 <div id="settings-knots-error" class="error dark:text-red-400"></div> 26 </form> ··· 70 </div> 71 <div class="flex gap-2 items-center"> 72 <button 73 - class="btn dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 gap-2" 74 - hx-post="/knots/{{ .Domain }}/init"> 75 {{ i "square-play" "w-5 h-5" }} 76 <span class="hidden md:inline">initialize</span> 77 </button> 78 </div> 79 </div>
··· 10 <form 11 hx-post="/knots/key" 12 class="max-w-2xl mb-8 space-y-4" 13 + hx-indicator="#generate-knot-key-spinner" 14 > 15 <input 16 type="text" ··· 19 placeholder="knot.example.com" 20 required 21 class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:placeholder-gray-400" 22 + > 23 + <button class="btn dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 flex gap-2 items-center" type="submit"> 24 + <span>generate key</span> 25 + <span id="generate-knot-key-spinner" class="group"> 26 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 27 + </span> 28 </button> 29 <div id="settings-knots-error" class="error dark:text-red-400"></div> 30 </form> ··· 74 </div> 75 <div class="flex gap-2 items-center"> 76 <button 77 + class="btn dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 flex gap-2 items-center group" 78 + hx-post="/knots/{{ .Domain }}/init" 79 + > 80 {{ i "square-play" "w-5 h-5" }} 81 <span class="hidden md:inline">initialize</span> 82 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 83 </button> 84 </div> 85 </div>
+2 -1
appview/pages/templates/repo/issues/fragments/editIssueComment.html
··· 23 </a> 24 25 <button 26 - class="btn px-2 py-1 flex items-center gap-2 text-sm" 27 hx-post="/{{ $.RepoInfo.FullName }}/issues/{{ .Issue }}/comment/{{ .CommentId }}/edit" 28 hx-include="#edit-textarea-{{ .CommentId }}" 29 hx-target="#comment-container-{{ .CommentId }}" 30 hx-swap="outerHTML"> 31 {{ i "check" "w-4 h-4" }} 32 </button> 33 <button 34 class="btn px-2 py-1 flex items-center gap-2 text-sm"
··· 23 </a> 24 25 <button 26 + class="btn px-2 py-1 flex items-center gap-2 text-sm group" 27 hx-post="/{{ $.RepoInfo.FullName }}/issues/{{ .Issue }}/comment/{{ .CommentId }}/edit" 28 hx-include="#edit-textarea-{{ .CommentId }}" 29 hx-target="#comment-container-{{ .CommentId }}" 30 hx-swap="outerHTML"> 31 {{ i "check" "w-4 h-4" }} 32 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 33 </button> 34 <button 35 class="btn px-2 py-1 flex items-center gap-2 text-sm"
+2 -1
appview/pages/templates/repo/issues/fragments/issueComment.html
··· 38 {{ i "pencil" "w-4 h-4" }} 39 </button> 40 <button 41 - class="btn px-2 py-1 text-sm text-red-500" 42 hx-delete="/{{ $.RepoInfo.FullName }}/issues/{{ .Issue }}/comment/{{ .CommentId }}/" 43 hx-confirm="Are you sure you want to delete your comment?" 44 hx-swap="outerHTML" 45 hx-target="#comment-container-{{.CommentId}}" 46 > 47 {{ i "trash-2" "w-4 h-4" }} 48 </button> 49 {{ end }} 50
··· 38 {{ i "pencil" "w-4 h-4" }} 39 </button> 40 <button 41 + class="btn px-2 py-1 text-sm text-red-500 flex gap-2 items-center group" 42 hx-delete="/{{ $.RepoInfo.FullName }}/issues/{{ .Issue }}/comment/{{ .CommentId }}/" 43 hx-confirm="Are you sure you want to delete your comment?" 44 hx-swap="outerHTML" 45 hx-target="#comment-container-{{.CommentId}}" 46 > 47 {{ i "trash-2" "w-4 h-4" }} 48 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 49 </button> 50 {{ end }} 51
+27 -6
appview/pages/templates/repo/issues/issue.html
··· 85 86 <div class="flex gap-2 mt-2"> 87 <button 88 - id="comment-button" 89 - hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment" 90 - type="submit" 91 hx-disabled-elt="#comment-button" 92 - class="btn p-2 flex items-center gap-2 no-underline hover:no-underline" 93 disabled 94 > 95 {{ i "message-square-plus" "w-4 h-4" }} 96 comment 97 </button> 98 99 {{ $isIssueAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Issue.OwnerDid) }} ··· 103 id="close-button" 104 type="button" 105 class="btn flex items-center gap-2" 106 hx-trigger="click" 107 > 108 {{ i "ban" "w-4 h-4" }} 109 close 110 </button> 111 <div 112 id="close-with-comment" ··· 114 hx-trigger="click from:#close-button" 115 hx-disabled-elt="#close-with-comment" 116 hx-target="#issue-comment" 117 hx-vals="js:{body: document.getElementById('comment-textarea').value.trim() !== '' ? document.getElementById('comment-textarea').value : ''}" 118 hx-swap="none" 119 > ··· 124 hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/close" 125 hx-trigger="click from:#close-button" 126 hx-target="#issue-action" 127 hx-swap="none" 128 > 129 </div> ··· 143 type="button" 144 class="btn flex items-center gap-2" 145 hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/reopen" 146 hx-swap="none" 147 > 148 {{ i "refresh-ccw-dot" "w-4 h-4" }} 149 reopen 150 </button> 151 {{ end }} 152 ··· 164 165 if (closeButton) { 166 if (textarea.value.trim() !== '') { 167 - closeButton.innerHTML = '{{ i "ban" "w-4 h-4" }} close with comment'; 168 } else { 169 - closeButton.innerHTML = '{{ i "ban" "w-4 h-4" }} close'; 170 } 171 } 172 }
··· 85 86 <div class="flex gap-2 mt-2"> 87 <button 88 + id="comment-button" 89 + hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment" 90 + type="submit" 91 hx-disabled-elt="#comment-button" 92 + class="btn p-2 flex items-center gap-2 no-underline hover:no-underline group" 93 disabled 94 > 95 {{ i "message-square-plus" "w-4 h-4" }} 96 comment 97 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 98 </button> 99 100 {{ $isIssueAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Issue.OwnerDid) }} ··· 104 id="close-button" 105 type="button" 106 class="btn flex items-center gap-2" 107 + hx-indicator="#close-spinner" 108 hx-trigger="click" 109 > 110 {{ i "ban" "w-4 h-4" }} 111 close 112 + <span id="close-spinner" class="group"> 113 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 114 + </span> 115 </button> 116 <div 117 id="close-with-comment" ··· 119 hx-trigger="click from:#close-button" 120 hx-disabled-elt="#close-with-comment" 121 hx-target="#issue-comment" 122 + hx-indicator="#close-spinner" 123 hx-vals="js:{body: document.getElementById('comment-textarea').value.trim() !== '' ? document.getElementById('comment-textarea').value : ''}" 124 hx-swap="none" 125 > ··· 130 hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/close" 131 hx-trigger="click from:#close-button" 132 hx-target="#issue-action" 133 + hx-indicator="#close-spinner" 134 hx-swap="none" 135 > 136 </div> ··· 150 type="button" 151 class="btn flex items-center gap-2" 152 hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/reopen" 153 + hx-indicator="#reopen-spinner" 154 hx-swap="none" 155 > 156 {{ i "refresh-ccw-dot" "w-4 h-4" }} 157 reopen 158 + <span id="reopen-spinner" class="group"> 159 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 160 + </span> 161 </button> 162 {{ end }} 163 ··· 175 176 if (closeButton) { 177 if (textarea.value.trim() !== '') { 178 + closeButton.innerHTML = ` 179 + {{ i "ban" "w-4 h-4" }} 180 + <span>close with comment</span> 181 + <span id="close-spinner" class="group"> 182 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 183 + </span>`; 184 } else { 185 + closeButton.innerHTML = ` 186 + {{ i "ban" "w-4 h-4" }} 187 + <span>close</span> 188 + <span id="close-spinner" class="group"> 189 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 190 + </span>`; 191 } 192 } 193 }
+7 -1
appview/pages/templates/repo/issues/new.html
··· 5 hx-post="/{{ .RepoInfo.FullName }}/issues/new" 6 class="mt-6 space-y-6" 7 hx-swap="none" 8 > 9 <div class="flex flex-col gap-4"> 10 <div> ··· 22 ></textarea> 23 </div> 24 <div> 25 - <button type="submit" class="btn">create</button> 26 </div> 27 </div> 28 <div id="issues" class="error"></div>
··· 5 hx-post="/{{ .RepoInfo.FullName }}/issues/new" 6 class="mt-6 space-y-6" 7 hx-swap="none" 8 + hx-indicator="#spinner" 9 > 10 <div class="flex flex-col gap-4"> 11 <div> ··· 23 ></textarea> 24 </div> 25 <div> 26 + <button type="submit" class="btn flex items-center gap-2"> 27 + create 28 + <span id="spinner" class="group"> 29 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 30 + </span> 31 + </button> 32 </div> 33 </div> 34 <div id="issues" class="error"></div>
+16 -7
appview/pages/templates/repo/pulls/fragments/pullNewComment.html
··· 7 </div> 8 <form 9 hx-post="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .RoundNumber }}/comment" 10 hx-swap="none" 11 - class="w-full flex flex-wrap gap-2"> 12 <textarea 13 name="body" 14 class="w-full p-2 rounded border border-gray-200" 15 - placeholder="Add to the discussion..."></textarea> 16 <button type="submit" class="btn flex items-center gap-2"> 17 - {{ i "message-square" "w-4 h-4" }} comment 18 </button> 19 - <button 20 - type="button" 21 - class="btn flex items-center gap-2" 22 hx-get="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .RoundNumber }}/actions" 23 hx-swap="outerHTML" 24 - hx-target="#pull-comment-card-{{ .RoundNumber }}"> 25 {{ i "x" "w-4 h-4" }} 26 <span>cancel</span> 27 </button> 28 <div id="pull-comment"></div> 29 </form>
··· 7 </div> 8 <form 9 hx-post="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .RoundNumber }}/comment" 10 + hx-indicator="#create-comment-spinner" 11 hx-swap="none" 12 + class="w-full flex flex-wrap gap-2" 13 + > 14 <textarea 15 name="body" 16 class="w-full p-2 rounded border border-gray-200" 17 + placeholder="Add to the discussion..."></textarea 18 + > 19 <button type="submit" class="btn flex items-center gap-2"> 20 + {{ i "message-square" "w-4 h-4" }} 21 + <span>comment</span> 22 + <span id="create-comment-spinner" class="group"> 23 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 24 + </span> 25 </button> 26 + <button 27 + type="button" 28 + class="btn flex items-center gap-2 group" 29 hx-get="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .RoundNumber }}/actions" 30 hx-swap="outerHTML" 31 + hx-target="#pull-comment-card-{{ .RoundNumber }}" 32 + > 33 {{ i "x" "w-4 h-4" }} 34 <span>cancel</span> 35 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 36 </button> 37 <div id="pull-comment"></div> 38 </form>
+20 -7
appview/pages/templates/repo/pulls/fragments/pullResubmit.html
··· 18 <form 19 hx-post="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/resubmit" 20 hx-swap="none" 21 - class="w-full flex flex-wrap gap-2"> 22 <textarea 23 name="patch" 24 class="w-full p-2 mb-2" 25 placeholder="Paste your updated patch here." 26 rows="15" 27 - >{{.Pull.LatestPatch}}</textarea> 28 <button 29 type="submit" 30 class="btn flex items-center gap-2" 31 {{ if or .Pull.State.IsClosed }} 32 disabled 33 - {{ end }}> 34 {{ i "rotate-ccw" "w-4 h-4" }} 35 <span>resubmit</span> 36 </button> 37 - <button 38 - type="button" 39 - class="btn flex items-center gap-2" 40 hx-get="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .Pull.LastRoundNumber }}/actions" 41 hx-swap="outerHTML" 42 - hx-target="#resubmit-pull-card"> 43 {{ i "x" "w-4 h-4" }} 44 <span>cancel</span> 45 </button> 46 </form> 47
··· 18 <form 19 hx-post="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/resubmit" 20 hx-swap="none" 21 + class="w-full flex flex-wrap gap-2" 22 + hx-indicator="#resubmit-spinner" 23 + > 24 <textarea 25 name="patch" 26 class="w-full p-2 mb-2" 27 placeholder="Paste your updated patch here." 28 rows="15" 29 + > 30 + {{.Pull.LatestPatch}} 31 + </textarea> 32 <button 33 type="submit" 34 class="btn flex items-center gap-2" 35 {{ if or .Pull.State.IsClosed }} 36 disabled 37 + {{ end }} 38 + > 39 {{ i "rotate-ccw" "w-4 h-4" }} 40 <span>resubmit</span> 41 + <span id="resubmit-spinner" class="group"> 42 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 43 + </span> 44 </button> 45 + <button 46 + type="button" 47 + class="btn flex items-center gap-2" 48 hx-get="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .Pull.LastRoundNumber }}/actions" 49 hx-swap="outerHTML" 50 + hx-target="#resubmit-pull-card" 51 + hx-indicator="#cancel-resubmit-spinner" 52 + > 53 {{ i "x" "w-4 h-4" }} 54 <span>cancel</span> 55 + <span id="cancel-resubmit-spinner" class="group"> 56 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 57 + </span> 58 </button> 59 </form> 60
+4
appview/pages/templates/repo/pulls/new.html
··· 4 <form 5 hx-post="/{{ .RepoInfo.FullName }}/pulls/new" 6 class="mt-6 space-y-6" 7 hx-swap="none" 8 > 9 <div class="flex flex-col gap-4"> ··· 105 <button type="submit" class="btn flex items-center gap-2"> 106 {{ i "git-pull-request-create" "w-4 h-4" }} 107 create pull 108 </button> 109 </div> 110 </div>
··· 4 <form 5 hx-post="/{{ .RepoInfo.FullName }}/pulls/new" 6 class="mt-6 space-y-6" 7 + hx-indicator="#create-pull-spinner" 8 hx-swap="none" 9 > 10 <div class="flex flex-col gap-4"> ··· 106 <button type="submit" class="btn flex items-center gap-2"> 107 {{ i "git-pull-request-create" "w-4 h-4" }} 108 create pull 109 + <span id="create-pull-spinner" class="group"> 110 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 111 + </span> 112 </button> 113 </div> 114 </div>
+46 -24
appview/pages/templates/repo/settings.html
··· 23 </div> 24 25 {{ if .RepoInfo.Roles.CollaboratorInviteAllowed }} 26 - <form hx-put="/{{ $.RepoInfo.FullName }}/settings/collaborator"> 27 - <label for="collaborator" class="dark:text-white" 28 - >add collaborator</label 29 - > 30 <input 31 type="text" 32 id="collaborator" ··· 34 required 35 class="dark:bg-gray-700 dark:text-white" 36 placeholder="enter did or handle" 37 - /> 38 <button 39 - class="btn my-2 dark:text-white dark:hover:bg-gray-700" 40 type="text" 41 > 42 - add 43 </button> 44 </form> 45 {{ end }} 46 47 - <form hx-put="/{{ $.RepoInfo.FullName }}/settings/branches/default" class="mt-6"> 48 <label for="branch">default branch</label> 49 - <select id="branch" name="branch" required class="p-1 border border-gray-200 bg-white dark:bg-gray-800 dark:text-white dark:border-gray-700"> 50 - {{ range .Branches }} 51 - <option 52 - value="{{ . }}" 53 - class="py-1" 54 - {{ if eq . $.DefaultBranch }} 55 - selected 56 - {{ end }} 57 - > 58 - {{ . }} 59 - </option> 60 - {{ end }} 61 - </select> 62 - <button class="btn my-2" type="text">save</button> 63 </form> 64 65 {{ if .RepoInfo.Roles.RepoDeleteAllowed }} 66 - <form hx-confirm="Are you sure you want to delete this repository?" hx-delete="/{{ $.RepoInfo.FullName }}/settings/delete" class="mt-6"> 67 <label for="branch">delete repository</label> 68 - <button class="btn my-2" type="text">delete</button> 69 <span> 70 Deleting a repository is irreversible and permanent. 71 </span>
··· 23 </div> 24 25 {{ if .RepoInfo.Roles.CollaboratorInviteAllowed }} 26 + <form 27 + hx-put="/{{ $.RepoInfo.FullName }}/settings/collaborator" 28 + class="group" 29 + > 30 + <label for="collaborator" class="dark:text-white"> 31 + add collaborator 32 + </label> 33 <input 34 type="text" 35 id="collaborator" ··· 37 required 38 class="dark:bg-gray-700 dark:text-white" 39 placeholder="enter did or handle" 40 + > 41 <button 42 + class="btn my-2 flex gap-2 items-center dark:text-white dark:hover:bg-gray-700" 43 type="text" 44 > 45 + <span>add</span> 46 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 47 </button> 48 </form> 49 {{ end }} 50 51 + <form 52 + hx-put="/{{ $.RepoInfo.FullName }}/settings/branches/default" 53 + class="mt-6 group" 54 + > 55 <label for="branch">default branch</label> 56 + <div class="flex gap-2 items-center"> 57 + <select id="branch" name="branch" required class="p-1 border border-gray-200 bg-white dark:bg-gray-800 dark:text-white dark:border-gray-700"> 58 + {{ range .Branches }} 59 + <option 60 + value="{{ . }}" 61 + class="py-1" 62 + {{ if eq . $.DefaultBranch }} 63 + selected 64 + {{ end }} 65 + > 66 + {{ . }} 67 + </option> 68 + {{ end }} 69 + </select> 70 + <button class="btn my-2 flex gap-2 items-center" type="text"> 71 + <span>save</span> 72 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 73 + </button> 74 + </div> 75 </form> 76 77 {{ if .RepoInfo.Roles.RepoDeleteAllowed }} 78 + <form 79 + hx-confirm="Are you sure you want to delete this repository?" 80 + hx-delete="/{{ $.RepoInfo.FullName }}/settings/delete" 81 + class="mt-6" 82 + hx-indicator="#delete-repo-spinner" 83 + > 84 <label for="branch">delete repository</label> 85 + <button class="btn my-2 flex gap-2 items-center" type="text"> 86 + <span>delete</span> 87 + <span id="delete-repo-spinner" class="group"> 88 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 89 + </span> 90 + </button> 91 <span> 92 Deleting a repository is irreversible and permanent. 93 </span>
+35 -10
appview/pages/templates/settings.html
··· 45 </div> 46 </div> 47 <button 48 - class="btn text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 gap-2" 49 title="Delete key" 50 hx-delete="/settings/keys?name={{urlquery .Name}}&rkey={{urlquery .Rkey}}&key={{urlquery .Key}}" 51 - hx-confirm="Are you sure you want to delete the key '{{ .Name }}'?"> 52 {{ i "trash-2" "w-5 h-5" }} 53 <span class="hidden md:inline">delete</span> 54 </button> 55 </div> 56 {{ end }} 57 </div> 58 <form 59 hx-put="/settings/keys" 60 hx-swap="none" 61 class="max-w-2xl mb-8 space-y-4" 62 > ··· 75 required 76 class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:placeholder-gray-400"/> 77 78 - <button class="btn dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600" type="submit">add key</button> 79 80 <div id="settings-keys" class="error dark:text-red-400"></div> 81 </form> ··· 129 </a> 130 {{ end }} 131 {{ if not .Primary }} 132 - <form hx-delete="/settings/emails" hx-confirm="Are you sure you wish to delete the email '{{ .Address }}'?"> 133 <input type="hidden" name="email" value="{{ .Address }}"> 134 <button 135 - class="btn text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300" 136 title="Delete email" 137 - type="submit"> 138 {{ i "trash-2" "w-5 h-5" }} 139 <span class="hidden md:inline">delete</span> 140 </button> 141 </form> 142 {{ end }} ··· 148 hx-put="/settings/emails" 149 hx-swap="none" 150 class="max-w-2xl mb-8 space-y-4" 151 > 152 <input 153 type="email" ··· 155 name="email" 156 placeholder="your@email.com" 157 required 158 - class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:placeholder-gray-400"/> 159 160 - <button class="btn dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600" type="submit">add email</button> 161 162 <div id="settings-emails-error" class="error dark:text-red-400"></div> 163 <div id="settings-emails-success" class="success dark:text-green-400"></div> 164 - 165 </form> 166 </section> 167 - {{ end }}
··· 45 </div> 46 </div> 47 <button 48 + class="btn text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 gap-2 group" 49 title="Delete key" 50 hx-delete="/settings/keys?name={{urlquery .Name}}&rkey={{urlquery .Rkey}}&key={{urlquery .Key}}" 51 + hx-confirm="Are you sure you want to delete the key '{{ .Name }}'?" 52 + > 53 {{ i "trash-2" "w-5 h-5" }} 54 <span class="hidden md:inline">delete</span> 55 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 56 </button> 57 </div> 58 {{ end }} 59 </div> 60 <form 61 hx-put="/settings/keys" 62 + hx-indicator="#add-sshkey-spinner" 63 hx-swap="none" 64 class="max-w-2xl mb-8 space-y-4" 65 > ··· 78 required 79 class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:placeholder-gray-400"/> 80 81 + <button class="btn dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 flex gap-2 items-center" type="submit"> 82 + <span>add key</span> 83 + <span id="add-sshkey-spinner" class="group"> 84 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 85 + </span> 86 + </button> 87 88 <div id="settings-keys" class="error dark:text-red-400"></div> 89 </form> ··· 137 </a> 138 {{ end }} 139 {{ if not .Primary }} 140 + <form 141 + hx-delete="/settings/emails" 142 + hx-confirm="Are you sure you wish to delete the email '{{ .Address }}'?" 143 + hx-indicator="#delete-email-{{ .Address }}-spinner" 144 + > 145 <input type="hidden" name="email" value="{{ .Address }}"> 146 <button 147 + class="btn text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 flex gap-2 items-center" 148 title="Delete email" 149 + type="submit" 150 + > 151 {{ i "trash-2" "w-5 h-5" }} 152 <span class="hidden md:inline">delete</span> 153 + <span id="delete-email-{{ .Address }}-spinner" class="group"> 154 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 155 + </span> 156 </button> 157 </form> 158 {{ end }} ··· 164 hx-put="/settings/emails" 165 hx-swap="none" 166 class="max-w-2xl mb-8 space-y-4" 167 + hx-indicator="#add-email-spinner" 168 > 169 <input 170 type="email" ··· 172 name="email" 173 placeholder="your@email.com" 174 required 175 + class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:placeholder-gray-400" 176 + > 177 178 + <button 179 + class="btn dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 flex gap-2 items-center" 180 + type="submit" 181 + > 182 + <span>add email</span> 183 + <span id="add-email-spinner" class="group"> 184 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 185 + </span> 186 + </button> 187 188 <div id="settings-emails-error" class="error dark:text-red-400"></div> 189 <div id="settings-emails-success" class="success dark:text-green-400"></div> 190 </form> 191 </section> 192 + {{ end }}
+2 -1
appview/pages/templates/user/fragments/follow.html
··· 1 {{ define "user/fragments/follow" }} 2 <button id="followBtn" 3 - class="btn mt-2 w-full" 4 5 {{ if eq .FollowStatus.String "IsNotFollowing" }} 6 hx-post="/follow?subject={{.UserDid}}" ··· 13 hx-swap="outerHTML" 14 > 15 {{ if eq .FollowStatus.String "IsNotFollowing" }}Follow{{ else }}Unfollow{{ end }} 16 </button> 17 {{ end }}
··· 1 {{ define "user/fragments/follow" }} 2 <button id="followBtn" 3 + class="btn mt-2 w-full flex gap-2 items-center group" 4 5 {{ if eq .FollowStatus.String "IsNotFollowing" }} 6 hx-post="/follow?subject={{.UserDid}}" ··· 13 hx-swap="outerHTML" 14 > 15 {{ if eq .FollowStatus.String "IsNotFollowing" }}Follow{{ else }}Unfollow{{ end }} 16 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 17 </button> 18 {{ end }}