Mirror of @tangled.org/core. Running on a Raspberry Pi Zero 2 (Please be gentle).
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 and committed by
Tangled
d0be79b0 050c5aef

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