[Profile] fix sorting podcasts
[mygpo.git] / mygpo / directory / templates / search.html
blob565ce33be5c904c1cf0300d84dfbd2d20074b08d
1 {% extends 'base.html' %}
3 {% load i18n %}
4 {% load podcasts %}
5 {% load charts %}
7 {% load menu %}
8 {% block mainmenu %}{{ "/search/"|main_menu }}{% endblock %}
9 {% block sectionmenu %}{{ "/search/"|section_menu }}{% endblock %}
11 {% block title %}{% trans "Search" %}{% endblock %}
13 {% block header %}
14 <h1>{% trans "Search" %}</h1>
15 {% endblock %}
18 {% block content %}
20 <form class="form-inline" method="get" action="{% url "search" %}" class="search">
21 <div class="input-group">
22 <span class="input-group-addon"><i class="icon-search"></i></span>
23 <input class="form-control" type="text" name="q" {% if q %}value="{{ q }}"{% endif %} placeholder="{% trans "Search term or feed URL" %}" autofocus="autofocus">
24 <span class="input-group-btn">
25 <button class="btn btn-primary" type="submit">{% trans "Search" %}</button>
26 </span>
27 </div>
28 </form>
30 {% if q %}
31 {% if results %}
32 <table class="list">
33 <tr>
34 <th></th>
35 <th>{% trans "Podcast" %}</th>
36 <th>{% trans "Subscribers" %}</th>
37 </tr>
39 {% for podcast in results %}
40 <tr>
41 <td class="logo">{{ podcast|podcast_logo }}</td>
42 <td>{% podcast_group_link podcast %}</td>
43 <td>{% vertical_bar podcast.subscribers max_subscribers %}</td>
44 </tr>
45 {% endfor %}
46 </table>
48 <ul class="pagination">
49 {% if results.has_previous %}
50 <li>
51 <a href="{% url "search" %}?q={{ q }}&page={{ results.previous_page_number }}">«</a>
52 </li>
53 {% endif %}
55 {% for page in page_list %}
56 <li>
57 {% if page == "..." %}
58 <span>{{ page }}</span>
59 {% else %}
61 {% if page == results.number %}
62 <strong>{{ page }}</strong>
63 {% else %}
64 <a href="{% url "search" %}?q={{ q }}&page={{ page }}">{{ page }}</a>
65 {% endif %}
66 {% endif %}
67 </li>
68 {% endfor %}
70 {% if results.has_next %}
71 <li>
72 <a href="{% url "search" %}?q={{ q }}&page={{ results.next_page_number }}">»</a>
73 </li>
74 {% endif %}
75 </ul>
77 {% else %}
79 <div>{% trans "Nothing found" %}</div>
81 {% endif %}
83 {% endif %}
85 {% endblock %}
88 {% block sidebar %}
90 <div class="well">
91 <h4>{% trans "Search API" %}</h4>
92 <p>{% trans "Access the following address to search for <em>tech</em> podcasts." %}</p>
93 <a href="/search.opml?q=tech">
94 <pre>http://{{domain}}/search.opml?q=tech</pre>
95 </a>
96 </div>
97 {% endblock %}