this repo has no description

wip: rework pull actions

Signed-off-by: oppiliappan <me@oppi.li>

Changed files
+31 -13
appview
pages
templates
+6 -6
appview/pages/templates/repo/pulls/fragments/pullActions.html
··· 27 27 hx-get="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ $roundNumber }}/comment" 28 28 hx-target="#actions-{{$roundNumber}}" 29 29 hx-swap="outerHtml" 30 - class="btn p-2 flex items-center gap-2 no-underline hover:no-underline group"> 30 + class="btn-flat p-2 flex items-center gap-2 no-underline hover:no-underline group"> 31 31 {{ i "message-square-plus" "w-4 h-4" }} 32 32 <span>comment</span> 33 33 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} ··· 37 37 hx-delete="/{{ .BranchDeleteStatus.Repo.Did }}/{{ .BranchDeleteStatus.Repo.Name }}/branches" 38 38 hx-vals='{"branch": "{{ .BranchDeleteStatus.Branch }}" }' 39 39 hx-swap="none" 40 - class="btn p-2 flex items-center gap-2 no-underline hover:no-underline group text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300"> 40 + class="btn-flat p-2 flex items-center gap-2 no-underline hover:no-underline group text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300"> 41 41 {{ i "git-branch" "w-4 h-4" }} 42 42 <span>delete branch</span> 43 43 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} ··· 52 52 hx-post="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/merge" 53 53 hx-swap="none" 54 54 hx-confirm="Are you sure you want to merge pull #{{ .Pull.PullId }} into the `{{ .Pull.TargetBranch }}` branch?" 55 - class="btn p-2 flex items-center gap-2 group" {{ $disabled }}> 55 + class="btn-flat p-2 flex items-center gap-2 group" {{ $disabled }}> 56 56 {{ i "git-merge" "w-4 h-4" }} 57 57 <span>merge{{if $stackCount}} {{$stackCount}}{{end}}</span> 58 58 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} ··· 74 74 {{ end }} 75 75 76 76 hx-disabled-elt="#resubmitBtn" 77 - class="btn p-2 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed group" {{ $disabled }} 77 + class="btn-flat p-2 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed group" {{ $disabled }} 78 78 79 79 {{ if $disabled }} 80 80 title="Update this branch to resubmit this pull request" ··· 92 92 <button 93 93 hx-post="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/close" 94 94 hx-swap="none" 95 - class="btn p-2 flex items-center gap-2 group"> 95 + class="btn-flat p-2 flex items-center gap-2 group"> 96 96 {{ i "ban" "w-4 h-4" }} 97 97 <span>close</span> 98 98 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} ··· 103 103 <button 104 104 hx-post="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/reopen" 105 105 hx-swap="none" 106 - class="btn p-2 flex items-center gap-2 group"> 106 + class="btn-flat p-2 flex items-center gap-2 group"> 107 107 {{ i "refresh-ccw-dot" "w-4 h-4" }} 108 108 <span>reopen</span> 109 109 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }}
+1 -1
appview/pages/templates/repo/pulls/fragments/pullNewComment.html
··· 28 28 class="btn flex items-center gap-2 group" 29 29 hx-get="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .RoundNumber }}/actions" 30 30 hx-swap="outerHTML" 31 - hx-target="#pull-comment-card-{{ .RoundNumber }}" 31 + hx-target="#actions-{{.RoundNumber}}" 32 32 > 33 33 {{ i "x" "w-4 h-4" }} 34 34 <span>cancel</span>
+11 -6
appview/pages/templates/repo/pulls/pull.html
··· 17 17 {{ define "repoContentLayout" }} 18 18 <div class="grid grid-cols-1 md:grid-cols-10 gap-4 w-full"> 19 19 <div class="col-span-1 md:col-span-7"> 20 - <section class="bg-white dark:bg-gray-800 p-6 rounded relative w-full mx-auto dark:text-white"> 20 + <section class="bg-white dark:bg-gray-800 p-6 rounded relative w-full mx-auto dark:text-white h-full"> 21 21 {{ block "repoContent" . }}{{ end }} 22 22 </section> 23 23 {{ block "repoAfter" . }}{{ end }} ··· 172 172 {{ block "resubmitStatus" $ }} {{ end }} 173 173 {{ end }} 174 174 {{ if $.LoggedInUser }} 175 - {{ if eq $lastIdx .RoundNumber }} 176 - {{ template "newComment" (list $ .) }} 177 - {{ else }} 178 - {{ template "repo/pulls/fragments/replyPullCommentPlaceholder" (dict "LoggedInUser" $.LoggedInUser "Submission" .) }} 179 - {{ end }} 175 + {{ template "repo/pulls/fragments/pullActions" 176 + (dict 177 + "LoggedInUser" $.LoggedInUser 178 + "Pull" $.Pull 179 + "RepoInfo" $.RepoInfo 180 + "RoundNumber" .RoundNumber 181 + "MergeCheck" $.MergeCheck 182 + "ResubmitCheck" $.ResubmitCheck 183 + "BranchDeleteStatus" $.BranchDeleteStatus 184 + "Stack" $.Stack) }} 180 185 {{ else }} 181 186 <div class="bg-amber-50 dark:bg-amber-900 border border-amber-500 rounded drop-shadow-sm p-2 relative flex gap-2 items-center"> 182 187 <a href="/signup" class="btn-create py-0 hover:no-underline hover:text-white flex items-center gap-2">
+13
input.css
··· 124 124 dark:text-gray-100 dark:before:bg-gray-800 dark:before:border-gray-700; 125 125 } 126 126 127 + .btn-flat { 128 + @apply relative z-10 inline-flex min-h-[30px] cursor-pointer items-center justify-center 129 + bg-transparent px-2 pb-[0.2rem] text-sm text-gray-900 130 + before:absolute before:inset-0 before:-z-10 before:block before:rounded 131 + before:border before:border-gray-200 before:bg-white 132 + before:content-[''] before:transition-all before:duration-150 before:ease-in-out 133 + hover:before:bg-gray-50 134 + dark:hover:before:bg-gray-700 135 + focus:outline-none focus-visible:before:outline focus-visible:before:outline-2 focus-visible:before:outline-gray-400 136 + disabled:cursor-not-allowed disabled:opacity-50 137 + dark:text-gray-100 dark:before:bg-gray-800 dark:before:border-gray-700; 138 + } 139 + 127 140 .btn-create { 128 141 @apply btn text-white 129 142 before:bg-green-600 hover:before:bg-green-700