1 {% extends "base.html.j2" %}
2 {% import 'macros.imp.j2' as macros %}
5 {% if rows is not none %}{{ query | e }} — Search results
6 {% else %}Search Youtube Videos{% endif %}
11 [name=q]::placeholder{
21 box-sizing:border-box;
28 <form method=get action=/search>
29 <input name=q placeholder="Search" value="{{ query | e if query }}">
30 <!--input type=submit value="?"-->
33 {% if rows is not none %}
36 {# TODO: this is mostly copy-pasted (changed video infobar) from watch.j2's info/endcard section -- dedup! #}
37 <!-- not implemented warning:--><div style="background:red">{%for x in rows|selectattr('content.error')%}{{x.content.error}}{%endfor%}</div>
39 {% for card in rows %}
40 {% set c = card.content %}
41 {% if card.type == 'VIDEO' %}
42 {% call macros.card(c.video_id, c.title, c.length) %}
43 {{ macros.infobar_subscriptions(c.video_id, c.channel_id, c.author) }}
44 <small>{{ c.published if c.published }} </small>
46 {% elif card.type == 'CHANNEL' and c.channel_id != channel_id %}
47 {% call macros.card_generic("/channel/"~c.channel_id, c.icons[c.icons.largest] if 'icons' in c else '', c.title) %}
48 <span class=channel>Channel</span>
49 <span class=advanced>{{ c.subscribers }}</span>
51 {% elif card.type == 'PLAYLIST' %}
52 {% call macros.card_generic("/playlist?list="~c.playlist_id, "https://i.ytimg.com/vi/"~c.video_id~"/mqdefault.jpg", c.title) %}
53 <span class=channel>{{ c.author }}</span>
54 <span class=advanced>{{ c.n_videos }} videos</span>
56 {% elif card.type == 'WEBSITE' %}
57 {% call macros.card_generic(c.url, c.icons[250] if 'icons' in c else '', c.title) %}
58 <span class=channel>{{ c.domain }}</span>
62 {{ macros.dummycard() }}
65 <div class="pagination-container">
67 {{ macros.pagination("previous", {'page':(-1,1)}, -1) }}
69 {{ macros.pagination("next", {'page':(+1,1)}, +1) }}
72 please type a search query.