fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minimal allauth support
[wolnelektury.git]
/
apps
/
search
/
templatetags
/
search_tags.py
diff --git
a/apps/search/templatetags/search_tags.py
b/apps/search/templatetags/search_tags.py
index
06631b2
..
97deb9d
100644
(file)
--- a/
apps/search/templatetags/search_tags.py
+++ b/
apps/search/templatetags/search_tags.py
@@
-36,7
+36,7
@@
def book_searched(context, result):
# We don't need hits which lead to sections but do not have
# snippets.
hits = filter(lambda h: 'fragment' in h or
# We don't need hits which lead to sections but do not have
# snippets.
hits = filter(lambda h: 'fragment' in h or
- h['snippets'], result.hits)
+ h['snippets'], result.hits)
[0:5]
for hit in hits:
hit['snippets'] = map(lambda s: s.replace("\n", "<br />").replace('---', '—'), hit['snippets'])
for hit in hits:
hit['snippets'] = map(lambda s: s.replace("\n", "<br />").replace('---', '—'), hit['snippets'])
@@
-44,7
+44,9
@@
def book_searched(context, result):
return {
'related': book.related_info(),
'book': book,
return {
'related': book.related_info(),
'book': book,
+ 'main_link': book.get_absolute_url(),
'request': context.get('request'),
'hits': hits,
'main_link': book.get_absolute_url(),
}
'request': context.get('request'),
'hits': hits,
'main_link': book.get_absolute_url(),
}
+