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'] = {}
|
||||
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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue