This repository has no description
0

Configure Feed

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

core / appview / pages / templates / repo / issues / fragments / subscribeButton.html
1.6 kB 34 lines
1{{ define "repo/issues/fragments/subscribeButton" }} 2 {{ $subscribed := false }} 3 {{ if .IsSubscribed }}{{ $subscribed = .IsSubscribed }}{{ end }} 4 <div id="issue-subscribe-btn" class="px-2 md:px-0"> 5 <div class="py-1 flex items-center text-sm"> 6 <span class="font-bold text-gray-500 dark:text-gray-400">Notifications</span> 7 </div> 8 {{ if $subscribed }} 9 <form 10 hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .IssueId }}/subscribe" 11 hx-target="#issue-subscribe-btn" 12 hx-swap="outerHTML"> 13 <input type="hidden" name="subscribe" value="false"> 14 <button type="submit" class="flex items-center gap-1.5 text-sm text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white transition-colors group"> 15 {{ i "bell" "w-4 h-4" }} 16 <span>Subscribed</span> 17 {{ i "loader-circle" "w-3 h-3 animate-spin hidden group-[.htmx-request]:inline" }} 18 </button> 19 </form> 20 {{ else }} 21 <form 22 hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .IssueId }}/subscribe" 23 hx-target="#issue-subscribe-btn" 24 hx-swap="outerHTML"> 25 <input type="hidden" name="subscribe" value="true"> 26 <button type="submit" class="flex items-center gap-1.5 text-sm text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 transition-colors group"> 27 {{ i "bell-off" "w-4 h-4" }} 28 <span>Subscribe</span> 29 {{ i "loader-circle" "w-3 h-3 animate-spin hidden group-[.htmx-request]:inline" }} 30 </button> 31 </form> 32 {{ end }} 33 </div> 34{{ end }}