mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2024-11-25 08:57:31 +00:00
7 lines
410 B
Plaintext
7 lines
410 B
Plaintext
|
mixin subscribe_button(ucid, isSubscribed, referrer)
|
||
|
- const subscribePath = !subscribed ? "subscribe" : "unsubscribe"
|
||
|
form(method="post" action=`/formapi/${subscribePath}/${ucid}`).subscribe-form
|
||
|
if referrer
|
||
|
input(type="hidden" name="referrer" value=referrer)
|
||
|
button(data-subscribed=(+isSubscribed) data-ucid=ucid)&attributes(attributes)#subscribe= !subscribed ? "Subscribe" : "Unsubscribe"
|