aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/templates/subscription_manager.html
blob: 3b8a5c059a124d0fc2ba2b7e3a9fe1e0cdf88165 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
{% set page_title = 'Subscription Manager' %}
{% extends "base.html" %}
{% block style %}
    <link href="/youtube.com/static/subscription_manager.css" rel="stylesheet">
{% endblock style %}


{% macro subscription_list(sub_list) %}
    {% for subscription in sub_list %}
        <li class="sub-list-item {{ 'muted' if subscription['muted'] else '' }}">
            <input class="sub-list-checkbox" name="channel_ids" value="{{ subscription['channel_id'] }}" form="subscription-manager-form" type="checkbox">
            <a href="{{ subscription['channel_url'] }}" class="sub-list-item-name" title="{{ subscription['channel_name'] }}">{{ subscription['channel_name'] }}</a>
            <span class="tag-list">{{ ', '.join(subscription['tags']) }}</span>
        </li>
    {% endfor %}
{% endmacro %}

{% block main %}
    <div class="import-export">
        <form class="subscriptions-import-form" enctype="multipart/form-data" action="/youtube.com/import_subscriptions" method="POST">
            <h2>Import subscriptions</h2>
            <input type="file" id="subscriptions-import" accept="application/json, application/xml, text/x-opml" name="subscriptions_file">
            <input type="submit" value="Import" class="import-submit-button">
        </form>

        <!--<ul class="subscriptions-export-links">
            <li><a href="/youtube.com/subscriptions.opml">Export subscriptions (OPML)</a></li>
            <li><a href="/youtube.com/subscriptions.xml">Export subscriptions (RSS)</a></li>
        </ul>-->
    </div>

    <hr>

    <form id="subscription-manager-form" class="sub-list-controls" method="POST">
        {% if group_by_tags %}
            <a class="sort-button" href="/https://www.youtube.com/subscription_manager?group_by_tags=0">Don't group</a>
        {% else %}
            <a class="sort-button" href="/https://www.youtube.com/subscription_manager?group_by_tags=1">Group by tags</a>
        {% endif %}
        <input type="text" name="tags">
        <button type="submit" name="action" value="add_tags">Add tags</button>
        <button type="submit" name="action" value="remove_tags">Remove tags</button>
        <button type="submit" name="action" value="unsubscribe_verify">Unsubscribe</button>
        <button type="submit" name="action" value="mute">Mute</button>
        <button type="submit" name="action" value="unmute">Unmute</button>
        <input type="reset" value="Clear Selection">
    </form>


    {% if group_by_tags %}
        <ul class="tag-group-list">
            {% for tag_name, sub_list in tag_groups %}
                <li class="tag-group">
                    <h2 class="tag-group-name">{{ tag_name }}</h2>
                    <ol class="sub-list">
                        {{ subscription_list(sub_list) }}
                    </ol>
                </li>
            {% endfor %}
        </ul>
    {% else %}
        <ol class="sub-list">
            {{ subscription_list(sub_list) }}
        </ol>
    {% endif %}

{% endblock main %}