home · contact · privacy
Fix breakages due to previous unfinished commit.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 26 Nov 2024 23:37:43 +0000 (00:37 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 26 Nov 2024 23:37:43 +0000 (00:37 +0100)
src/templates/_macros.tmpl
src/templates/playlist.tmpl
src/templates/queries.tmpl
src/templates/results.tmpl
src/templates/video.tmpl
src/templates/videos.tmpl
src/templates/yt_video.tmpl
src/ytplom/misc.py

index e11bc864a59a4cc9edfecf069b803c66f5e6e97b..aa6ed501695179a0da89deb7685a8d359aa4da5c 100644 (file)
@@ -1,13 +1,13 @@
-{% macro _link_if(cond, target) %}{% if cond %}<a href="/{{target}}">{% endif %}{{target}}{% if cond %}</a>{% endif %}{% endmacro %}
+{% macro _link_if(cond, target, display_name = false ) %}{% if cond %}<a href="/{{target}}">{% endif %}{% if display_name %}{{display_name}}{% else %}{{target}}{% endif %}{% if cond %}</a>{% endif %}{% endmacro %}
 
 
-{% macro nav_head(selected="") %}
+{% macro nav_head(page_names, selected="") %}
 <p>
 {{ _link_if("playlist" != selected, page_names.playlist) }}
 ·
 {{ _link_if("files" != selected, page_names.files) }}
 ·
-{{ _link_if("yt_queries" != selected, page_names.yt_queries) }}
+{{ _link_if("yt_queries" != selected, page_names.yt_queries, "queries") }}
 </p>
 <hr />
 {% endmacro %}
index 7625714ace16b8e080bf28bffd99cd1102612b53..c1d084e66b839556fffb3d40705b4109b4c7fbde 100644 (file)
@@ -36,7 +36,7 @@ td.history { width: 50%; }
 
 
 {% block body %}
-{{ macros.nav_head("playlist") }}
+{{ macros.nav_head(page_names, "playlist") }}
 <table>
 <tr><td id="status" colspan=2>
 {% if running %}{% if pause %}PAUSED{% else %}PLAYING{% endif %}{% else %}STOPPED{% endif %}:<br />
index 8dae26dcac85c7d4f918ff0bc00cfdf148ae175d..9ef271d0ae28d55e199f73955a36692318704b57 100644 (file)
@@ -2,7 +2,7 @@
 
 
 {% block body %}
-{{ macros.nav_head("yt_queries") }}
+{{ macros.nav_head(page_names, "yt_queries") }}
 <p>quota: {{quota_count}}/100000</p>
 <form action="/{{page_names.yt_queries}}" method="POST" />
 <input name="query" />
index 1998f7f146da7d9f7c0bc9510a906f99bcd915a8..872d461b3a088be6bb1529fab0be49c6914781b3 100644 (file)
@@ -2,13 +2,13 @@
 
 
 {% block body %}
-{{ macros.nav_head() }}
+{{ macros.nav_head(page_names) }}
 <p>query: {{query}}</p>
 <table>
 {% for video in videos %}
 <tr>
 <td>
-<a href="/{{page_names.yt_result}}/{{video.id_}}"><img src="/{page_names.thumbnails}/{{video.id_}}.jpg" /></a>
+<a href="/{{page_names.yt_result}}/{{video.id_}}"><img src="/{{page_names.thumbnails}}/{{video.id_}}.jpg" /></a>
 </td>
 <td>
 {{video.definition}}<br />
index 7de9b067c6d3c3e43f598b1e41eb56cfa9067b27..7ea70f95d498f8bf1fcac2515d2f4db3d8ccdad7 100644 (file)
@@ -2,7 +2,7 @@
 
 
 {% block body %}
-{{ macros.nav_head() }}
+{{ macros.nav_head(page_names) }}
 <table>
 <tr><th>path:</th><td>{{file.rel_path}}</td></tr>
 <tr><th>YouTube ID:</th><td><a href="/{{page_names.yt_result}}/{{file.yt_id}}">{{file.yt_id}}</a></tr>
index c49cf18e134c20a245818057bf2c5d830623c981..69543c8720b3afbc62bc9345f049a93c2a64cc8a 100644 (file)
@@ -2,7 +2,7 @@
 
 
 {% block body %}
-{{ macros.nav_head("files") }}
+{{ macros.nav_head(page_names, "files") }}
 <p>downloaded videos:</p>
 <ul>
 {% for video_id, path in videos %}
index 32477417ec51579bb227197e556d93333801ca51..73ffbab3dfda38dc1ccbc85702f6db3f828a2c12 100644 (file)
@@ -2,7 +2,7 @@
 
 
 {% block body %}
-{{ macros.nav_head() }}
+{{ macros.nav_head(page_names) }}
 <table>
 <tr><th>title:</th><td>{{video_data.title}}</td></tr>
 <tr><th>thumbnail:</th><td><img src="/{{page_names.thumbnails}}/{{video_data.id_}}.jpg" /></td></tr>
index 48f475bdf103512b5a6846a45e5d2deffa2ef1de..097c8c0c9ba928c4fba063f5d1577f1143ee32bb 100644 (file)
@@ -69,16 +69,16 @@ NAME_TEMPLATE_PLAYLIST = PathStr('playlist.tmpl')
 
 # page names
 PAGE_NAMES: PageNames = {
-    'download': PathStr('dll'),
-    'file': PathStr('fille'),
-    'files': PathStr('filles'),
+    'download': PathStr('dl'),
+    'file': PathStr('file'),
+    'files': PathStr('files'),
     'last_update': PathStr('last_playlist_update.json'),
-    'missing': PathStr('missing.jsoner'),
-    'playlist': PathStr('playlisttt'),
-    'thumbnails': PathStr('thumbnailz'),
-    'yt_result': PathStr('ytt_video'),
-    'yt_query': PathStr('ytt_query'),
-    'yt_queries': PathStr('ytt_queries')
+    'missing': PathStr('missing.json'),
+    'playlist': PathStr('playlist'),
+    'thumbnails': PathStr('thumbnails'),
+    'yt_result': PathStr('yt_video'),
+    'yt_query': PathStr('yt_query'),
+    'yt_queries': PathStr('yt_queries')
 }
 
 # yt_dlp config