2019-11-17 18:50:42 +01:00
|
|
|
elixir:
|
2024-04-29 02:55:27 +02:00
|
|
|
watch_path = ~p"/images/#{@image}/subscription"
|
2019-11-17 18:50:42 +01:00
|
|
|
watch_class = if @watching, do: "hidden", else: ""
|
|
|
|
|
2024-04-29 02:55:27 +02:00
|
|
|
unwatch_path = ~p"/images/#{@image}/subscription"
|
2019-11-17 18:50:42 +01:00
|
|
|
unwatch_class = if @watching, do: "", else: "hidden"
|
|
|
|
|
|
|
|
= if @conn.assigns.current_user do
|
2024-03-03 06:31:06 +01:00
|
|
|
span.js-subscription-target
|
2019-11-17 18:50:42 +01:00
|
|
|
a.js-subscription-link href=watch_path class=watch_class data-remote="true" data-method="post"
|
|
|
|
i.fa.fa-bell>
|
2019-12-19 07:51:21 +01:00
|
|
|
' Subscribe
|
2019-11-17 18:50:42 +01:00
|
|
|
|
|
|
|
a.js-subscription-link href=unwatch_path class=unwatch_class data-remote="true" data-method="delete"
|
|
|
|
i.fa.fa-bell-slash>
|
2019-12-19 07:51:21 +01:00
|
|
|
' Unsubscribe
|
2019-11-17 18:50:42 +01:00
|
|
|
- else
|
2024-04-29 02:55:27 +02:00
|
|
|
a href=~p"/sessions/new"
|
2019-11-17 18:50:42 +01:00
|
|
|
i.fa.fa-bell>
|
2019-12-19 07:51:21 +01:00
|
|
|
' Subscribe
|