improving layout of search results
[mygpo.git] / mygpo / web / templates / search / search.html
blob6cdc7c3e0ca9c3edd972f27d6bfad1b7131ea508
1 {% extends 'base.html' %}
3 {% load i18n %}
4 {% load podcasts %}
6 {% block content %}
7 <h2>{% trans "Search" %}</h2>
9 <form method="get" action="." class="search">
11 {% for field in form %}
12 {{ field.errors }}
13 {{ field }}
14 {% endfor %}
16 <input type="submit" value="Search">
17 </form>
19 {% if query %}
20 <h3>{% trans "Results" %}</h3>
22 {% for result in page.object_list %}
23 <div class="result">
24 {% ifequal result.model_name "podcast" %}
25 <a class="podcast" href="/podcast/{{ result.pk }}">{{ result.object }}</a>
26 <span class="description">{{ result.object.description|default:""|truncatewords:"15" }}</span>
27 {% endifequal %}
29 {% ifequal result.model_name "episode" %}
30 {% ifchanged result.object.podcast %}
31 <a class="podcast" href="/podcast/{{ result.object.podcast.id }}">{{ result.object.podcast }}</a>
32 {% endifchanged %}
33 <span class="episode">
34 <a class="episode" href="/episode/{{ result.pk }}">{{ result.object.title }}</a>
35 <span class="description">{{ result.object.description|default:""|truncatewords:"15" }}</span>
36 </span>
37 {% endifequal %}
38 </div>
39 {% endfor %}
40 {% endif %}
41 {% endblock %}