File size: 3,628 Bytes
340cbde
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{% extends "base.html" %}


{% block content %}
<div class="ui center aligned text container">
    <div class="ui centered vertical segment">
        <h2 class="ui header">
          <img src="{{data.avatar}}" class="ui circular image">
          {{data.channel_name}}
        </h2>
    </div>
    {% if data.short_description %}
    <div class="ui vertical segment">
        <p>{{data.short_description}}</p>
    </div>
    {%endif%}
    <div class="ui vertical segment">
          <!--<div class="ui tiny statistic">

            <div class="value">

                {%if data.approx_suscriber_count == None%}

                    <i class="user icon"></i> ?

                {%else%}

                    <i class="user icon"></i> {{data.approx_subscriber_count}}

                {%endif%}

            </div>

            <div class="label">

               Followers

            </div>

          </div>-->
{% if restricted or current_user.is_authenticated %}
    {% if not current_user.is_following_yt(data.channel_id) %}
        <form action="{{ url_for('ytfollow', channelId=data.channel_id) }}" method="post">
            <button type="submit" value="Submit" class="ui red button">
                <i class="user icon"></i>
                Subscribe
            </button>
        </form>
    {% else %}
        <form action="{{ url_for('ytunfollow', channelId=data.channel_id) }}" method="post">
            <button type="submit" value="Submit" class="ui red active button">
                <i class="user icon"></i>
                Unsubscribe
            </button>
        </form>
    {%endif%}
{%endif%}
    </div>
</div>

    <br>
    <br> 
    {% if data['error'] != None %}
        {% include '_empty_feed.html' %}
    {% else %}
    <div class="ui centered cards">
        {% for video in data['items'] %}
            <div class="ui card">
              <a class="image" href="{{url_for('watch', v=video.id, _method='GET')}}">
                <img src="{{video.thumbnail}}">
              </a>
              <div class="content">
                <a class="header" href="{{url_for('watch', v=video.id, _method='GET')}}">{{video.title}}</a>
                <div class="meta">
                  <a class="break-word" href="{{url_for('channel', id=video.channel_id)}}">{{data.channel_name}}</a>
                </div>
              </div>
                <div class="extra content">
                    <span class="left floated like">
                        <i class="eye icon"></i>
                        {{video.approx_view_count}}
                    </span>

                    {%if video.duration == "PREMIERING NOW" or video.duration == "LIVE"%}
                        <span class="right floated star">
                            <i class="red circle icon"></i>
                            LIVE
                        </span>
                    {%else%}
                        <span class="right floated star">
                            <i class="clock icon"></i>
                            {{video.time_published}}
                        </span>
                    {%endif%}
                </div>
            </div>
        {% endfor %}
    </div>
    {% endif %}

    <br>
    <div class="ui center aligned text container">
        <a href="{{prev_page}}"> <button class="ui left attached button"><i class="angle red left icon"></i></button> </a>
        <a href="{{next_page}}"> <button class="right attached ui button"><i class="angle red right icon"></i></button></a>
    </div>
    <br>
{% endblock %}