mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-28 13:57:59 +01:00
42 lines
1.2 KiB
Text
42 lines
1.2 KiB
Text
<%
|
|
watch_path = ~p"/channels/#{@channel}/subscription"
|
|
|
|
watch_class =
|
|
if @watching do
|
|
"hidden"
|
|
else
|
|
""
|
|
end
|
|
|
|
unwatch_path = ~p"/channels/#{@channel}/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 media-box__header media-box__header--channel media-box__header--link #{watch_class}"} data-method="post" data-remote="true" href={watch_path}>
|
|
<i class="fa fa-bell"></i>
|
|
<span class="hide-mobile">
|
|
Subscribe
|
|
</span>
|
|
</a>
|
|
<a class={"js-subscription-link media-box__header media-box__header--channel media-box__header--link #{unwatch_class}"} data-method="delete" data-remote="true" href={unwatch_path}>
|
|
<i class="fa fa-bell-slash"></i>
|
|
<span class="hide-mobile">
|
|
Unsubscribe
|
|
</span>
|
|
</a>
|
|
</span>
|
|
<% else %>
|
|
<a class="media-box__header media-box__header--channel media-box__header--link" href={~p"/sessions/new"}>
|
|
<i class="fa fa-bell"></i>
|
|
<span class="hide-mobile">
|
|
Subscribe
|
|
</span>
|
|
</a>
|
|
<% end %>
|