Add subscribe and unsubscribe button

This commit is contained in:
Omar Roth
2018-03-31 09:51:14 -05:00
parent a7452d61fa
commit 7757eca92c
2 changed files with 91 additions and 9 deletions

View File

@@ -132,6 +132,21 @@ function toggle_comments(target) {
<h3><%= video.info["author"] %></h3>
</a>
</p>
<% if authorized %>
<% if subscriptions.includes? video.info["ucid"] %>
<p>
<a href="/subscription_ajax?action_remove_subscriptions=1&c=<%= video.info["ucid"] %>">
<b>Unsubscribe from <%= video.info["author"] %></b>
</a>
</p>
<% else %>
<p>
<a href="/subscription_ajax?action_create_subscription_to_channel=1&c=<%= video.info["ucid"] %>">
<b>Subscribe to <%= video.info["author"] %></b>
</a>
</p>
<% end %>
<% end %>
<p>
<b>Shared <%= video.published.to_s("%B %-d, %Y") %></b>
</p>