mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-07 23:06:42 +01:00
31 lines
767 B
Text
31 lines
767 B
Text
<% watch_path = ~p"/images/#{@image}/subscription"
|
|
|
|
watch_class =
|
|
if @watching do
|
|
"hidden"
|
|
else
|
|
""
|
|
end
|
|
|
|
unwatch_path = ~p"/images/#{@image}/subscription"
|
|
|
|
unwatch_class =
|
|
if @watching do
|
|
""
|
|
else
|
|
"hidden"
|
|
end %>
|
|
<%= if @conn.assigns.current_user do %>
|
|
<span class="js-subscription-target">
|
|
<a class={"js-subscription-link #{watch_class}"} data-method="post" data-remote="true" href={watch_path}>
|
|
<i class="fa fa-bell"></i> Subscribe
|
|
</a>
|
|
<a class={"js-subscription-link #{unwatch_class}"} data-method="delete" data-remote="true" href={unwatch_path}>
|
|
<i class="fa fa-bell-slash"></i> Unsubscribe
|
|
</a>
|
|
</span>
|
|
<% else %>
|
|
<a href={~p"/sessions/new"}>
|
|
<i class="fa fa-bell"></i> Subscribe
|
|
</a>
|
|
<% end %>
|