summaryrefslogtreecommitdiff
path: root/src/invidious/views/user/subscription_manager.ecr
blob: c2a89ca223b1e4e8aa16a4b84c0ff166affa4ab4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<% content_for "header" do %>
<title><%= translate(locale, "Subscription manager") %> - Invidious</title>
<% end %>

<div class="pure-g h-box">
    <div class="pure-u-1-3">
        <h3>
            <a href="/feed/subscriptions">
                <%= translate_count(locale, "generic_subscriptions_count", subscriptions.size, NumberFormatting::HtmlSpan) %>
            </a>
        </h3>
    </div>
    <div class="pure-u-1-3">
        <h3 style="text-align:center">
            <a href="/feed/history">
                <%= translate(locale, "Watch history") %>
            </a>
        </h3>
    </div>
    <div class="pure-u-1-3">
        <h3 style="text-align:right">
            <a href="/data_control?referer=<%= URI.encode_www_form(referer) %>">
                <%= translate(locale, "Import/export") %>
            </a>
        </h3>
    </div>
</div>

<% subscriptions.each do |channel| %>
    <div class="h-box">
        <div class="pure-g<% if channel.deleted %> deleted <% end %>">
            <div class="pure-u-2-5">
                <h3 style="padding-left:0.5em">
                    <a href="/channel/<%= channel.id %>"><%= HTML.escape(channel.author) %></a>
                </h3>
            </div>
            <div class="pure-u-2-5"></div>
            <div class="pure-u-1-5" style="text-align:right">
                <h3 style="padding-right:0.5em">
                    <form data-onsubmit="return_false" action="/subscription_ajax?action_remove_subscriptions=1&c=<%= channel.id %>&referer=<%= env.get("current_page") %>" method="post">
                        <input type="hidden" name="csrf_token" value="<%= HTML.escape(env.get?("csrf_token").try &.as(String) || "") %>">
                        <a data-onclick="remove_subscription" data-ucid="<%= channel.id %>" href="#">
                            <input style="all:unset" type="submit" value="<%= translate(locale, "unsubscribe") %>">
                        </a>
                    </form>
                </h3>
            </div>
        </div>

        <% if subscriptions[-1].author != channel.author %>
            <hr>
        <% end %>
    </div>
<% end %>