--- a/views/result.tpl
+++ b/views/result.tpl
@@ -7,7 +7,15 @@
%url = url.replace(dr, prefix)
%end
<div class="search-result-title" id="r{{d['sha']}}" title="{{d['abstract']}}">
- <a href="download/{{number-1}}?{{query_string}}">{{d['label']}}</a>
+ %if config.has_key('title_link') and config['title_link'] != 'download':
+ %if config['title_link'] == 'open':
+ <a href="{{url}}">{{d['label']}}</a>
+ %elif config['title_link'] == 'preview':
+ <a href="preview/{{number-1}}?{{query_string}}">{{d['label']}}</a>
+ %end
+ %else:
+ <a href="download/{{number-1}}?{{query_string}}">{{d['label']}}</a>
+ %end
</div>
%if len(d['ipath']) > 0:
<div class="search-result-ipath">[{{d['ipath']}}]</div>
@@ -22,11 +30,13 @@
%end
<a href="{{os.path.dirname(url)}}">{{urllabel}}</a>
</div>
-%if hasrclextract:
<div class="search-result-links">
- <a href="preview/{{number-1}}?{{query_string}}" target="_blank">Preview</a>
+ <a href="{{url}}">Open</a>
+ <a href="download/{{number-1}}?{{query_string}}">Download</a>
+ %if hasrclextract:
+ <a href="preview/{{number-1}}?{{query_string}}" target="_blank">Preview</a>
+ %end
</div>
-%end
<div class="search-result-date">{{d['time']}}</div>
<div class="search-result-snippet">{{!d['snippet']}}</div>
</div>