From 7a765dc664d20f966e4e52abac1f5372045e166c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Mon, 14 Dec 2020 23:44:29 -0500 Subject: Change general design theme --- youtube/templates/common_elements.html | 67 ++++++++++++++++------------------ 1 file changed, 31 insertions(+), 36 deletions(-) (limited to 'youtube/templates/common_elements.html') diff --git a/youtube/templates/common_elements.html b/youtube/templates/common_elements.html index 0587ce3..fcd4125 100644 --- a/youtube/templates/common_elements.html +++ b/youtube/templates/common_elements.html @@ -15,60 +15,55 @@ {% endmacro %} {% macro item(info, description=false, horizontal=true, include_author=true, include_badges=true, lazy_load=false) %} -
+
{% if info['error'] %} {{ info['error'] }} {% else %} -
+
- {% if lazy_load %} - - {% else %} - - {% endif %} - {% if info['type'] != 'channel' %} -
- {{ (info['video_count']|commatize + ' videos') if info['type'] == 'playlist' else info['duration'] }} -
- {% endif %} -
+
+ {% if lazy_load %} + thumbnail + {% elif info['type'] == 'channel' %} + thumbnail + {% else %} + thumbnail + {% endif %} - + {% if info['type'] != 'channel' %} +

{{ (info['video_count']|commatize + ' videos') if info['type'] == 'playlist' else info['duration'] }}

+ {% endif %} +
+ +

{{ info['title'] }}

{% if include_author %} {% if info.get('author_url') %} -
By {{ info['author'] }}
+
{{ info['author'] }}
{% else %}
{{ info['author'] }}
{% endif %} {% endif %} -
    + +
    {% if info['type'] == 'channel' %} -
  • {{ info['approx_subscriber_count'] }} subscribers
  • -
  • {{ info['video_count']|commatize }} videos
  • +
    {{ info['approx_subscriber_count'] }} subscribers
    +
    {{ info['video_count']|commatize }} videos
    {% else %} - {% if info.get('approx_view_count') %} -
  • {{ info['approx_view_count'] }} views
  • - {% endif %} {% if info.get('time_published') %} -
  • + + {% endif %} + {% if info.get('approx_view_count') %} +
    {{ info['approx_view_count'] }} views
    {% endif %} {% endif %} -
- - {% if description %} - {{ text_runs(info.get('description', '')) }} - {% endif %} - {% if include_badges %} - {{ info['badges']|join(' | ') }} - {% endif %} +
{% if info['type'] == 'video' %} {% endif %} {% endif %} -
- + {% endmacro %} {% macro page_buttons(estimated_pages, url, parameters_dictionary) %} @@ -84,12 +79,12 @@ {% for page in range(page_start, page_end+1) %} {% if page == current_page %} -
{{ page }}
+ {% else %} {# IMPORTANT: Jinja SUCKS #} {# https://stackoverflow.com/questions/36886650/how-to-add-a-new-entry-into-a-dictionary-object-while-using-jinja2 #} {% set _ = parameters_dictionary.__setitem__('page', page) %} - {{ page }} + {{ page }} {% endif %} {% endfor %} @@ -101,11 +96,11 @@ {% if current_page != 1 %} {% set _ = parameters_dictionary.__setitem__('page', current_page - 1) %} - Previous page + Previous page {% endif %} {% if not is_last_page %} {% set _ = parameters_dictionary.__setitem__('page', current_page + 1) %} - Next page + Next page {% endif %} {% endmacro %} -- cgit v1.2.3