Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jean-Francois Dockes
recoll-webui
Commits
51aa2f67
Commit
51aa2f67
authored
Jul 09, 2014
by
koniu
Browse files
Merge pull request #31 from medoc92/master
Remove some wrong assumptions about the filename and fmtime fields
parents
788061bd
59bc9e14
Changes
2
Hide whitespace changes
Inline
Side-by-side
views/result.tpl
View file @
51aa2f67
%import shlex, unicodedata
%import shlex, unicodedata
, os
<div
class=
"search-result"
>
%number = (query['page'] - 1)*config['perpage'] + i + 1
<div
class=
"search-result-number"
><a
href=
"#r{
{
d
[
'sha'
]
}
}"
>
#{
{
number
}
}
</a></div>
...
...
@@ -14,11 +14,11 @@
<div
class=
"search-result-author"
>
{
{
d
[
'author'
]
}
}
</div>
%end
<div
class=
"search-result-url"
>
%urllabel =
d['url'].replace('/'+d['filename'],'')
.replace('file://','')
%urllabel =
os.path.dirname(d['url']
.replace('file://',
'')
)
%for r in config['dirs']:
%urllabel = urllabel.replace(r.rsplit('/',1)[0] + '/' , '')
%end
<a
href=
"{
{
url
.
replace
(
'/'
+
d
[
'filename'
],
''
)
}
}"
>
{
{
urllabel
}
}
</a>
<a
href=
"{
{
os
.
path
.
dirname
(
url
)
}
}"
>
{
{
urllabel
}
}
</a>
</div>
%if hasrclextract:
<div
class=
"search-result-links"
>
...
...
webui.py
View file @
51aa2f67
...
...
@@ -84,6 +84,8 @@ def select(ls, invalid=[None]):
return
value
def
timestr
(
secs
,
fmt
):
if
secs
==
''
or
secs
is
None
:
secs
=
'0'
t
=
time
.
gmtime
(
int
(
secs
))
return
time
.
strftime
(
fmt
,
t
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment