followButtons HTML formatting

This commit is contained in:
perennial
2024-10-14 21:23:05 +11:00
parent 143c1efdb1
commit 4c3e1b4dbd
+30 -11
View File
@@ -1,6 +1,14 @@
{* used only on user page *}
{* only used on user page *}
{{- if .User.IsFollowed == true && LoggedIn }}
<button type="button" class="custom-btn-secondary text-nowrap me-2" hx-post="/self/unfollowUser/{{ .User.ID }}" hx-target="body" hx-indicator="#follow-spinner" hx-push-url="true">
<button
type="button"
class="custom-btn-secondary text-nowrap me-2"
hx-post="/self/unfollowUser/{{ .User.ID }}"
hx-target="body"
hx-indicator="#follow-spinner"
hx-push-url="true"
>
<div class="d-flex">
<div><i class="bi bi-person-fill me-2"></i>Following</div>
<div class="follow-spinner ms-2" id="follow-spinner">
@@ -13,12 +21,15 @@
{{- else }}
<!-- NOTE: bootstrap doesnt have custom hover states so the dropdown stays as a separate button -->
<div class="btn-group">
<button type="button" class="custom-btn-secondary text-nowrap me-2"
hx-post="/self/followUser/{{ .User.ID }}"
hx-target="body"
hx-indicator="#follow-spinner"
hx-push-url="true"
hx-vals='{"private": false}'>
<button
type="button"
class="custom-btn-secondary text-nowrap me-2"
hx-post="/self/followUser/{{ .User.ID }}"
hx-target="body"
hx-indicator="#follow-spinner"
hx-push-url="true"
hx-vals='{"private": false}'
>
<div class="d-flex">
<div><i class="bi bi-person-plus me-2"></i>Follow</div>
<div class="follow-spinner ms-2" id="follow-spinner">
@@ -28,17 +39,25 @@
</div>
</div>
</button>
<button type="button" class="custom-btn-secondary dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
<button
type="button"
class="custom-btn-secondary dropdown-toggle dropdown-toggle-split"
data-bs-toggle="dropdown"
aria-expanded="false"
>
<span class="visually-hidden">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu dropdown-menu-end shadow-md">
<li>
<a class="dropdown-item" href="#"
<a
class="dropdown-item"
href="#"
hx-post="/self/followUser/{{ .User.ID }}"
hx-target="body"
hx-indicator="#follow-spinner"
hx-push-url="true"
hx-vals='{"private": true}'>
hx-vals='{"private": true}'
>
Follow privately
</a>
</li>