philomena/lib/philomena_web/templates/channel/subscription/_subscription.html.slime
2024-06-06 22:28:35 +02:00

23 lines
939 B
Text

elixir:
watch_path = ~p"/channels/#{@channel}/subscription"
watch_class = if @watching, do: "hidden", else: ""
unwatch_path = ~p"/channels/#{@channel}/subscription"
unwatch_class = if @watching, do: "", else: "hidden"
= if @conn.assigns.current_user do
span.js-subscription-target
a.js-subscription-link.media-box__header.media-box__header--channel.media-box__header--link href=watch_path class=watch_class data-remote="true" data-method="post"
i.fa.fa-bell>
span.hidden--mobile
' Subscribe
a.js-subscription-link.media-box__header.media-box__header--channel.media-box__header--link href=unwatch_path class=unwatch_class data-remote="true" data-method="delete"
i.fa.fa-bell-slash>
span.hidden--mobile
' Unsubscribe
- else
a.media-box__header.media-box__header--channel.media-box__header--link href=~p"/sessions/new"
i.fa.fa-bell>
span.hidden--mobile
' Subscribe