2019-01-28 03:06:28 +00:00
|
|
|
<% if user %>
|
|
|
|
<% if subscriptions.includes? ucid %>
|
|
|
|
<p>
|
2019-04-16 04:23:40 +00:00
|
|
|
<form onsubmit="return false;" action="/subscription_ajax?action_remove_subscriptions=1&c=<%= ucid %>&referer=<%= env.get("current_page") %>" method="post">
|
2019-04-18 21:23:50 +00:00
|
|
|
<input type="hidden" name="csrf_token" value="<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>">
|
2019-04-16 04:23:40 +00:00
|
|
|
<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>
|
2019-01-28 03:06:28 +00:00
|
|
|
</p>
|
|
|
|
<% else %>
|
|
|
|
<p>
|
2019-04-16 04:23:40 +00:00
|
|
|
<form onsubmit="return false;" action="/subscription_ajax?action_create_subscription_to_channel=1&c=<%= ucid %>&referer=<%= env.get("current_page") %>" method="post">
|
2019-04-18 21:23:50 +00:00
|
|
|
<input type="hidden" name="csrf_token" value="<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>">
|
2019-04-16 04:23:40 +00:00
|
|
|
<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>
|
2019-01-28 03:06:28 +00:00
|
|
|
</a>
|
2019-04-16 04:23:40 +00:00
|
|
|
</form>
|
2019-01-28 03:06:28 +00:00
|
|
|
</p>
|
|
|
|
<% 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 %>
|