1
0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2024-11-14 12:27:28 +00:00
cloudtube/pug/includes/subscribe-button.pug

7 lines
410 B
Plaintext
Raw Normal View History

2020-08-30 13:54:59 +00:00
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"