Commit c272634a authored by Christophe Benz's avatar Christophe Benz Committed by Romain Bignon

better presentation

parent 06677749
......@@ -75,8 +75,11 @@ class VideoobWeb(BaseApplication):
c['results'] = {}
if q:
for backend in self.weboob.iter_backends():
items = [(video.id, video.title, video.formatted_duration) for video in
backend.iter_search_results(pattern=q, nsfw=nsfw)]
items = [dict(title=video.title,
page_url=video.page_url,
url=video.url if video.url else '/download?id=%s' % video.id
) \
for video in backend.iter_search_results(pattern=q, nsfw=nsfw)]
if items:
c['results'][backend.name] = items
template = template_lookup.get_template('index.mako')
......
......@@ -14,7 +14,14 @@
<div id="results">
% for backend, items in results.iteritems():
<h2>${backend}</h2>
${items}
<ul>
% for item in items:
<li>
<a href="${item['page_url']}">${item['title']}</a>
## (<a href="${item['url']}"><em>download</em></a>)
</li>
% endfor
</ul>
% endfor
</div>
</%def>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment