|
a/views/results.tpl |
|
b/views/results.tpl |
|
... |
|
... |
17 |
<div id="results">
|
17 |
<div id="results">
|
18 |
%for i in range(0, len(res)):
|
18 |
%for i in range(0, len(res)):
|
19 |
%d = res[i]
|
19 |
%d = res[i]
|
20 |
<div class="search-result">
|
20 |
<div class="search-result">
|
21 |
<div class="search-result-number"><a href="#r{{d['sha']}}">#{{i+1}}</a></div>
|
21 |
<div class="search-result-number"><a href="#r{{d['sha']}}">#{{i+1}}</a></div>
|
|
|
22 |
%url = d['url'].replace('file://', '')
|
|
|
23 |
%for dr, prefix in config['mounts'].items():
|
|
|
24 |
%url = url.replace(dr, prefix)
|
|
|
25 |
%end
|
22 |
<div class="search-result-title" id="r{{d['sha']}}" title="{{d['abstract']}}"><a href="{{d['url']}}">{{d['label']}}</a></div>
|
26 |
<div class="search-result-title" id="r{{d['sha']}}" title="{{d['abstract']}}"><a href="{{url}}">{{d['label']}}</a></div>
|
23 |
%if len(d['ipath']) > 0:
|
27 |
%if len(d['ipath']) > 0:
|
24 |
<div class="search-result-ipath">[{{d['ipath']}}]</div>
|
28 |
<div class="search-result-ipath">[{{d['ipath']}}]</div>
|
25 |
%end
|
29 |
%end
|
26 |
%if len(d['author']) > 0:
|
30 |
%if len(d['author']) > 0:
|
27 |
<div class="search-result-author">{{d['author']}}</div>
|
31 |
<div class="search-result-author">{{d['author']}}</div>
|
28 |
%end
|
32 |
%end
|
29 |
<div class="search-result-url">
|
33 |
<div class="search-result-url">
|
30 |
<a href="{{d['url'].replace('/'+d['filename'],'')}}">
|
|
|
31 |
%urllabel = d['url'].replace('/'+d['filename'],'').replace('file://','')
|
34 |
%urllabel = d['url'].replace('/'+d['filename'],'').replace('file://','')
|
32 |
%for r in roots:
|
35 |
%for r in roots:
|
33 |
%urllabel = urllabel.replace(r.rsplit('/',1)[0] + '/' , '')
|
36 |
%urllabel = urllabel.replace(r.rsplit('/',1)[0] + '/' , '')
|
34 |
%end
|
37 |
%end
|
35 |
{{urllabel}}
|
38 |
<a href="{{url.replace('/'+d['filename'],'')}}">{{urllabel}}</a>
|
36 |
</a>
|
|
|
37 |
</div>
|
39 |
</div>
|
38 |
<div class="search-result-date">{{d['time']}}</div>
|
40 |
<div class="search-result-date">{{d['time']}}</div>
|
39 |
%for q in shlex.split(query['keywords'].replace("'","\\'")):
|
41 |
%for q in shlex.split(query['keywords'].replace("'","\\'")):
|
40 |
%if not q == "OR":
|
42 |
%if not q == "OR":
|
41 |
% w = strip_accents(q.decode('utf-8').lower()).encode('utf-8')
|
43 |
% w = strip_accents(q.decode('utf-8').lower()).encode('utf-8')
|