diff options
Diffstat (limited to 'youtube/templates/base.html')
| -rw-r--r-- | youtube/templates/base.html | 80 |
1 files changed, 50 insertions, 30 deletions
diff --git a/youtube/templates/base.html b/youtube/templates/base.html index 7b32d76..a67e745 100644 --- a/youtube/templates/base.html +++ b/youtube/templates/base.html @@ -1,77 +1,97 @@ +{% if settings.app_public %} + {% set app_url = settings.app_url|string %} +{% else %} + {% set app_url = settings.app_url|string + ':' + settings.port_number|string %} +{% endif %} <!DOCTYPE html> <html lang="en"> <head> - <meta charset="UTF-8"/> - <meta name="viewport" content="width=device-width, initial-scale=1"/> - <meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' 'unsafe-eval'; media-src 'self' https://*.googlevideo.com; {{ "img-src 'self' https://*.googleusercontent.com https://*.ggpht.com https://*.ytimg.com;" if not settings.proxy_images else "" }}"/> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; media-src 'self' blob: {{ app_url }}/* data: https://*.googlevideo.com; img-src 'self' https://*.googleusercontent.com https://*.ggpht.com https://*.ytimg.com; connect-src 'self' https://*.googlevideo.com; font-src 'self' data:; worker-src 'self' blob:;"> <title>{{ page_title }}</title> - <link title="Youtube local" href="/youtube.com/opensearch.xml" rel="search" type="application/opensearchdescription+xml"/> - <link href="/youtube.com/static/favicon.ico" type="image/x-icon" rel="icon"/> - <link href="/youtube.com/static/normalize.css" rel="stylesheet"/> - <link href="{{ theme_path }}" rel="stylesheet"/> + <link title="YT Local" href="/youtube.com/opensearch.xml" rel="search" type="application/opensearchdescription+xml"> + <link href="/youtube.com/static/favicon.ico" type="image/x-icon" rel="icon"> + <link href="/youtube.com/static/normalize.css" rel="stylesheet"> + <link href="{{ theme_path }}" rel="stylesheet"> + <link href="/youtube.com/shared.css" rel="stylesheet"> {% block style %} {{ style }} {% endblock %} + + {% if js_data %} + <script> + // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later + data = {{ js_data|tojson }}; + // @license-end + </script> + {% endif %} + <script> + // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later + // Image prefix for thumbnails + let settings_img_prefix = "{{ settings.img_prefix or '' }}"; + // @license-end + </script> </head> <body> <header class="header"> <nav class="home"> - <a href="/youtube.com" id="home-link">YouTube Local</a> + <a href="/youtube.com" id="home-link">YT Local</a> </nav> - <form class="form" id="site-search" action="/youtube.com/search"> - <input type="search" name="query" class="search-box" value="{{ search_box_value }}" - {{ "autofocus" if request.path == "/" else "" }} placeholder="Type to search..."> - <button type="submit" value="Search" class="search-button">Search</button> + <form class="form" id="site-search" action="/youtube.com/results"> + <input type="search" name="search_query" class="search-box" value="{{ search_box_value }}" + {{ "autofocus" if (request.path in ("/", "/results") or error_message) else "" }} required placeholder="{{ _('Type to search...') }}"> + <button type="submit" value="Search" class="search-button">{{ _('Search') }}</button> <!-- options --> <div class="dropdown"> <!-- hidden box --> - <input id="options-toggle-cbox" class="opt-box" role="button" type="checkbox"> + <input id="options-toggle-cbox" class="opt-box" type="checkbox"> <!-- end hidden box --> - <label class="dropdown-label" for="options-toggle-cbox">Options</label> + <label class="dropdown-label" for="options-toggle-cbox">{{ _('Options') }}</label> <div class="dropdown-content"> - <h3>Sort by</h3> + <h3>{{ _('Sort by') }}</h3> <div class="option"> <input type="radio" id="sort_relevance" name="sort" value="0"> - <label for="sort_relevance">Relevance</label> + <label for="sort_relevance">{{ _('Relevance') }}</label> </div> <div class="option"> <input type="radio" id="sort_upload_date" name="sort" value="2"> - <label for="sort_upload_date">Upload date</label> + <label for="sort_upload_date">{{ _('Upload date') }}</label> </div> <div class="option"> <input type="radio" id="sort_view_count" name="sort" value="3"> - <label for="sort_view_count">View count</label> + <label for="sort_view_count">{{ _('View count') }}</label> </div> <div class="option"> <input type="radio" id="sort_rating" name="sort" value="1"> - <label for="sort_rating">Rating</label> + <label for="sort_rating">{{ _('Rating') }}</label> </div> - <h3>Upload date</h3> + <h3>{{ _('Upload date') }}</h3> <div class="option"> <input type="radio" id="time_any" name="time" value="0"> - <label for="time_any">Any</label> + <label for="time_any">{{ _('Any') }}</label> </div> <div class="option"> <input type="radio" id="time_last_hour" name="time" value="1"> - <label for="time_last_hour">Last hour</label> + <label for="time_last_hour">{{ _('Last hour') }}</label> </div> <div class="option"> <input type="radio" id="time_today" name="time" value="2"> - <label for="time_today">Today</label> + <label for="time_today">{{ _('Today') }}</label> </div> <div class="option"> <input type="radio" id="time_this_week" name="time" value="3"> - <label for="time_this_week">This week</label> + <label for="time_this_week">{{ _('This week') }}</label> </div> <div class="option"> <input type="radio" id="time_this_month" name="time" value="4"> - <label for="time_this_month">This month</label> + <label for="time_this_month">{{ _('This month') }}</label> </div> <div class="option"> <input type="radio" id="time_this_year" name="time" value="5"> - <label for="time_this_year">This year</label> + <label for="time_this_year">{{ _('This year') }}</label> </div> <h3>Type</h3> @@ -119,7 +139,7 @@ {% if header_playlist_names is defined %} <form class="playlist" id="playlist-edit" action="/youtube.com/edit_playlist" method="post" target="_self"> - <input class="play-box" name="playlist_name" id="playlist-name-selection" list="playlist-options" type="search" placeholder="I added your playlist..."> + <input class="play-box" name="playlist_name" id="playlist-name-selection" list="playlist-options" type="search" placeholder="Add name of your playlist..."> <datalist class="play-hidden" id="playlist-options"> {% for playlist_name in header_playlist_names %} <option value="{{ playlist_name }}">{{ playlist_name }}</option> @@ -127,7 +147,7 @@ </datalist> <button class="play-add" type="submit" id="playlist-add-button" name="action" value="add">+List</button> <div class="play-clean"> - <button type="reset" id="item-selection-reset">Clear selection</button> + <button type="reset" id="item-selection-reset">Clear</button> </div> </form> <script src="/youtube.com/static/js/playlistadd.js"></script> @@ -150,8 +170,8 @@ </div> <div> <p>This site is Free/Libre Software</p> - {% if current_commit and current_version %} - <p>Current version: {{ current_version }}-{{ current_commit }} @ {{ current_branch }}</p> + {% if current_commit != None %} + <p>Current version: {{ current_commit }} @ {{ current_branch }}</p> {% else %} <p>Current version: {{ current_version }}</p> {% endif %} |
