Skip to content

Commit

Permalink
restore open local file function (closes #54)
Browse files Browse the repository at this point in the history
Signed-off-by: koniu <[email protected]>
  • Loading branch information
koniu committed Sep 19, 2016
1 parent cfb6564 commit 4e748d6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
4 changes: 3 additions & 1 deletion static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ body { margin: 0; font-family: sans-serif }
.search-result-url { clear:left; }
.search-result-url a { color: #5a5; font-size: 8pt; float: left; margin-right: 1em;}
.search-result-links { color: #aaf; font-size: 8pt; float: left; margin-right: 1em; visibility: hidden }
.search-result-links a { padding-right: 0.5em; }
.search-result-links a:hover { text-decoration: underline }
.search-result:hover > .search-result-links { visibility: visible }
.search-result-date { color: #777; font-size: 8pt; float: right; margin-bottom: 7px; }
.search-result-size { color: #777; font-size: 8pt; float: right; display: none; }
Expand Down Expand Up @@ -114,7 +116,7 @@ tr { vertical-align: top }
#settings-box {
padding: 1em;
position: absolute;
top: 10%;
top: 5%;
left: 30%;
right: 30%;
background: #eee;
Expand Down
18 changes: 14 additions & 4 deletions views/result.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down
6 changes: 6 additions & 0 deletions views/settings.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
<input name="timefmt" value={{timefmt}}>
<b>Folder depth</b> <small class="gray">(number of levels of the folder dropdown)</small>
<input name="dirdepth" value={{dirdepth}}>
<b>Default action</b> <small class="gray">(action to take when clicking result title)</small>
<select name="title_link">
<option value="download" {{'selected' if title_link == 'download' else ''}}>Download</option>
<option value="preview" {{'selected' if title_link == 'preview' else ''}}>Preview</option>
<option value="open" {{'selected' if title_link == 'open' else ''}}>Open</option>
</select>
<hr>
<b>Locations</b><br>
%for d in dirs:
Expand Down
1 change: 1 addition & 0 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
'maxresults': 0,
'perpage': 25,
'csvfields': 'filename title author size time mtype url',
'title_link': 'download',
}

# sort fields/labels
Expand Down

0 comments on commit 4e748d6

Please sign in to comment.