better presentation
This commit is contained in:
parent
0667774952
commit
c272634a14
2 changed files with 13 additions and 3 deletions
|
|
@ -75,8 +75,11 @@ class VideoobWeb(BaseApplication):
|
||||||
c['results'] = {}
|
c['results'] = {}
|
||||||
if q:
|
if q:
|
||||||
for backend in self.weboob.iter_backends():
|
for backend in self.weboob.iter_backends():
|
||||||
items = [(video.id, video.title, video.formatted_duration) for video in
|
items = [dict(title=video.title,
|
||||||
backend.iter_search_results(pattern=q, nsfw=nsfw)]
|
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:
|
if items:
|
||||||
c['results'][backend.name] = items
|
c['results'][backend.name] = items
|
||||||
template = template_lookup.get_template('index.mako')
|
template = template_lookup.get_template('index.mako')
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,14 @@
|
||||||
<div id="results">
|
<div id="results">
|
||||||
% for backend, items in results.iteritems():
|
% for backend, items in results.iteritems():
|
||||||
<h2>${backend}</h2>
|
<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
|
% endfor
|
||||||
</div>
|
</div>
|
||||||
</%def>
|
</%def>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue