2019-01-28 03:06:28 +00:00
|
|
|
<% if user %>
|
|
|
|
<% if subscriptions.includes? ucid %>
|
2019-05-02 01:03:39 +00:00
|
|
|
<p>
|
|
|
|
<form onsubmit="return false" action="/subscription_ajax?action_remove_subscriptions=1&c=<%= ucid %>&referer=<%= env.get("current_page") %>" method="post">
|
|
|
|
<input type="hidden" name="csrf_token" value="<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>">
|
|
|
|
<a id="subscribe" onclick="unsubscribe()" class="pure-button pure-button-primary" href="#">
|
|
|
|
<b><input style="all:unset" type="submit" value="<%= translate(locale, "Unsubscribe") %> | <%= sub_count_text %>"></b>
|
|
|
|
</a>
|
|
|
|
</form>
|
|
|
|
</p>
|
2019-01-28 03:06:28 +00:00
|
|
|
<% else %>
|
2019-05-02 01:03:39 +00:00
|
|
|
<p>
|
|
|
|
<form onsubmit="return false" action="/subscription_ajax?action_create_subscription_to_channel=1&c=<%= ucid %>&referer=<%= env.get("current_page") %>" method="post">
|
|
|
|
<input type="hidden" name="csrf_token" value="<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>">
|
|
|
|
<a id="subscribe" onclick="subscribe()" class="pure-button pure-button-primary" href="#">
|
|
|
|
<b><input style="all:unset" type="submit" value="<%= translate(locale, "Subscribe") %> | <%= sub_count_text %>"></b>
|
|
|
|
</a>
|
|
|
|
</form>
|
|
|
|
</p>
|
2019-01-28 03:06:28 +00:00
|
|
|
<% end %>
|
|
|
|
<% else %>
|
|
|
|
<p>
|
2019-03-23 19:05:13 +00:00
|
|
|
<a id="subscribe" class="pure-button pure-button-primary"
|
2019-01-28 03:06:28 +00:00
|
|
|
href="/login?referer=<%= env.get("current_page") %>">
|
2019-04-14 22:10:32 +00:00
|
|
|
<b><%= translate(locale, "Subscribe") %> | <%= sub_count_text %></b>
|
2019-01-28 03:06:28 +00:00
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
<% end %>
|