back interdiff of round #5 and #4

appview: add reaction for issues/PRs (close #65) #265

merged
opened by boltless.me targeting master from boltless.me/core: push-uoymosxlmxvl

Add sh.tangled.feed.reaction lexicon and UI to react to issues/PRs close #65 close #113

Signed-off-by: Seongmin Lee boltlessengineer@proton.me

files
api
appview
db
issues
pages
templates
layouts
repo
fragments
issues
pulls
fragments
pulls
state
cmd
lexicons
ERROR
api/tangled/cbor_gen.go

Failed to calculate interdiff for this file.

ERROR
api/tangled/feedreaction.go

Failed to calculate interdiff for this file.

ERROR
appview/db/db.go

Failed to calculate interdiff for this file.

ERROR
appview/db/issues.go

Failed to calculate interdiff for this file.

ERROR
appview/db/reaction.go

Failed to calculate interdiff for this file.

ERROR
appview/issues/issues.go

Failed to calculate interdiff for this file.

ERROR
appview/pages/pages.go

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/layouts/repobase.html

Failed to calculate interdiff for this file.

REVERTED
appview/pages/templates/repo/issues/fragments/reaction.html
···
-
{{ define "repo/issues/fragments/reaction" }}
-
<button
-
id="reactIndi-{{ .Kind }}"
-
class="flex justify-center items-center min-w-8 min-h-8 rounded border
-
leading-4 px-3 gap-1
-
{{ if eq .Count 0 }}
-
hidden
-
{{ end }}
-
{{ if .IsReacted }}
-
bg-sky-100
-
border-sky-400
-
dark:bg-sky-900
-
dark:border-sky-500
-
{{ else }}
-
border-gray-200
-
hover:bg-gray-50
-
hover:border-gray-300
-
dark:border-gray-700
-
dark:hover:bg-gray-700
-
dark:hover:border-gray-600
-
{{ end }}
-
"
-
{{ if .IsReacted }}
-
hx-delete="/react?subject={{ .ThreadAt }}&kind={{ .Kind }}"
-
{{ else }}
-
hx-post="/react?subject={{ .ThreadAt }}&kind={{ .Kind }}"
-
{{ end }}
-
hx-swap="outerHTML"
-
hx-trigger="click from:(#reactBtn-{{ .Kind }}, #reactIndi-{{ .Kind }})"
-
hx-disabled-elt="this"
-
>
-
<span>{{ .Kind }}</span> <span>{{ .Count }}</span>
-
</button>
-
{{ end }}
ERROR
appview/pages/templates/repo/issues/issue.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/pulls/fragments/pullHeader.html

Failed to calculate interdiff for this file.

ERROR
appview/pulls/pulls.go

Failed to calculate interdiff for this file.

ERROR
appview/state/reaction.go

Failed to calculate interdiff for this file.

ERROR
appview/state/router.go

Failed to calculate interdiff for this file.

ERROR
cmd/gen.go

Failed to calculate interdiff for this file.

ERROR
lexicons/feed/reaction.json

Failed to calculate interdiff for this file.

NEW
appview/pages/templates/repo/fragments/reaction.html
···
+
{{ define "repo/fragments/reaction" }}
+
<button
+
id="reactIndi-{{ .Kind }}"
+
class="flex justify-center items-center min-w-8 min-h-8 rounded border
+
leading-4 px-3 gap-1
+
{{ if eq .Count 0 }}
+
hidden
+
{{ end }}
+
{{ if .IsReacted }}
+
bg-sky-100
+
border-sky-400
+
dark:bg-sky-900
+
dark:border-sky-500
+
{{ else }}
+
border-gray-200
+
hover:bg-gray-50
+
hover:border-gray-300
+
dark:border-gray-700
+
dark:hover:bg-gray-700
+
dark:hover:border-gray-600
+
{{ end }}
+
"
+
{{ if .IsReacted }}
+
hx-delete="/react?subject={{ .ThreadAt }}&kind={{ .Kind }}"
+
{{ else }}
+
hx-post="/react?subject={{ .ThreadAt }}&kind={{ .Kind }}"
+
{{ end }}
+
hx-swap="outerHTML"
+
hx-trigger="click from:(#reactBtn-{{ .Kind }}, #reactIndi-{{ .Kind }})"
+
hx-disabled-elt="this"
+
>
+
<span>{{ .Kind }}</span> <span>{{ .Count }}</span>
+
</button>
+
{{ end }}
NEW
appview/pages/templates/repo/fragments/reactionsPopUp.html
···
+
{{ define "repo/fragments/reactionsPopUp" }}
+
<details
+
id="reactionsPopUp"
+
class="relative inline-block"
+
>
+
<summary
+
class="flex justify-center items-center min-w-8 min-h-8 rounded border border-gray-200 dark:border-gray-700
+
hover:bg-gray-50
+
hover:border-gray-300
+
dark:hover:bg-gray-700
+
dark:hover:border-gray-600
+
cursor-pointer list-none"
+
>
+
{{ i "smile" "size-4" }}
+
</summary>
+
<div
+
class="absolute flex left-0 z-10 mt-4 rounded bg-white dark:bg-gray-800 dark:text-white border border-gray-200 dark:border-gray-700 shadow-lg"
+
>
+
{{ range $kind := . }}
+
<button
+
id="reactBtn-{{ $kind }}"
+
class="size-12 hover:bg-gray-100 dark:hover:bg-gray-700"
+
hx-on:click="this.parentElement.parentElement.removeAttribute('open')"
+
>
+
{{ $kind }}
+
</button>
+
{{ end }}
+
</div>
+
</details>
+
{{ end }}