add merge option and some sorting

This commit is contained in:
Christophe Benz 2010-04-27 15:19:51 +02:00 committed by Romain Bignon
commit c89ba43d07
2 changed files with 30 additions and 12 deletions

View file

@ -2,6 +2,11 @@
<%inherit file="base.mako"/>
<%def name="video_link(item)">
<a href="${item['page_url']}">${item['title']}</a>
## (<a href="${item['url']}"><em>download</em></a>)
</%def>
<%def name="body()">
<h1>Videoob Web</h1>
<div id="search">
@ -12,16 +17,21 @@
</form>
</div>
<div id="results">
% for backend, items in results.iteritems():
<h2>${backend}</h2>
% if merge:
<ul>
% for item in items:
<li>
<a href="${item['page_url']}">${item['title']}</a>
## (<a href="${item['url']}"><em>download</em></a>)
</li>
% for item in results:
<li>${video_link(item)}</li>
% endfor
</ul>
% endfor
% else:
% for backend, items in sorted(results.iteritems()):
<h2>${backend}</h2>
<ul>
% for item in items:
<li>${video_link(item)}</li>
% endfor
</ul>
% endfor
% endif
</div>
</%def>