Merge branch 'embed-widget' of git://github.com/lapilofu/philo into develop
[philo.git] / philo / contrib / sobol / templates / sobol / search / _list.html
1 {% with node.view.enable_ajax_api as ajax %}
2 {% if ajax %}
3         {% if not suppress_scripts %}<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script><script type="text/javascript" src="{{ STATIC_URL }}sobol/ajax_search.js"></script>{% endif %}
4         <script type="text/javascript">
5                 (function($){
6                         var sobol = window.sobol;
7                         sobol.favoredResults = [{% for r in favored_results %}"{{ r }}"{% if not forloop.last %}, {% endif %}{% endfor %}];
8                 }(jQuery));
9         </script>
10 {% endif %}
11 {% if favored_results %}
12         <article class="search favored{% if ajax %} loading{% endif %}">
13                 <header>
14                         <h1>Favored results</h1>
15                 </header>
16                 {% if not ajax %}
17                 <dl>
18                         {% for search in searches %}
19                         {% for result in search.results %}
20                                 {% if result.get_actual_url in favored_results %}
21                                 {{ result }}
22                                 {% endif %}
23                         {% endfor %}
24                         {% endfor %}
25                         {% if search.get_actual_more_results_url in favored_results %}
26                                 <dt><a href="{{ search.more_results_url }}">More results for {{ search }}</a></dt>
27                         {% endif %}
28                 </dl>
29                 {% endif %}
30         </article>
31 {% endif %}
32 {% for search in searches %}
33 <article {% if ajax %}class="search loading {{ search.slug }}" data-url="{{ search.ajax_api_url }}"{% else %}class="search {{ search.slug }}{% if not search.results %} empty{% endif %}"{% endif %}>
34         <header>
35                 <a name='{{ search.slug }}'></a>
36                 <h1>{{ search }}</h1>
37         </header>
38         {% if not ajax %}
39                 {% if search.results %}
40                         <dl>
41                         {% for result in search.results %}
42                                 {{ result }}
43                         {% endfor %}
44                         </dl>
45                         {% if search.has_more_results and search.more_results_url %}
46                         <footer>
47                                 <p><a href="{{ search.more_results_url }}">See more results</a></p>
48                         </footer>
49                         {% endif %}
50                 {% else %}
51                         <p>No results found.</p>
52                 {% endif %}
53         {% endif %}
54 </article>
55 {% endfor %}
56 {% endwith %}