fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dd6284e
)
search ui draft
author
Marcin Koziej
<marcin.koziej@nowoczesnapolska.org.pl>
Tue, 27 Dec 2011 12:36:18 +0000
(13:36 +0100)
committer
Marcin Koziej
<marcin.koziej@nowoczesnapolska.org.pl>
Tue, 27 Dec 2011 12:36:18 +0000
(13:36 +0100)
apps/catalogue/models.py
patch
|
blob
|
history
apps/search/views.py
patch
|
blob
|
history
wolnelektury/templates/base.html
patch
|
blob
|
history
wolnelektury/templates/catalogue/search_multiple_hits.html
patch
|
blob
|
history
diff --git
a/apps/catalogue/models.py
b/apps/catalogue/models.py
index
e69d231
..
a180c65
100644
(file)
--- a/
apps/catalogue/models.py
+++ b/
apps/catalogue/models.py
@@
-1035,7
+1035,7
@@
class Fragment(models.Model):
verbose_name_plural = _('fragments')
def get_absolute_url(self):
verbose_name_plural = _('fragments')
def get_absolute_url(self):
- return '%s#m%s' % (
self.book.get_html_url(
), self.anchor)
+ return '%s#m%s' % (
reverse('book_text', args=[self.book.slug]
), self.anchor)
def reset_short_html(self):
if self.id is None:
def reset_short_html(self):
if self.id is None:
diff --git
a/apps/search/views.py
b/apps/search/views.py
index
75cc16a
..
bfa3c9b
100644
(file)
--- a/
apps/search/views.py
+++ b/
apps/search/views.py
@@
-67,7
+67,6
@@
def hint(request):
# jezeli tagi dot tylko ksiazki, to wazne zeby te nowe byly w tej samej ksiazce
# jesli zas dotycza themes, to wazne, zeby byly w tym samym fragmencie.
# jezeli tagi dot tylko ksiazki, to wazne zeby te nowe byly w tej samej ksiazce
# jesli zas dotycza themes, to wazne, zeby byly w tym samym fragmencie.
- # import pdb; pdb.set_trace()
tags = s.hint_tags(prefix)
books = s.hint_books(prefix)
tags = s.hint_tags(prefix)
books = s.hint_books(prefix)
@@
-127,7
+126,8
@@
def main(request):
context_instance=RequestContext(request))
hint.tags(tag_list)
context_instance=RequestContext(request))
hint.tags(tag_list)
- hint.books(book)
+ if book:
+ hint.books(book)
toks = StringReader(query)
fuzzy = 'fuzzy' in request.GET
toks = StringReader(query)
fuzzy = 'fuzzy' in request.GET
diff --git
a/wolnelektury/templates/base.html
b/wolnelektury/templates/base.html
index
8440959
..
d1bf19e
100644
(file)
--- a/
wolnelektury/templates/base.html
+++ b/
wolnelektury/templates/base.html
@@
-62,7
+62,7
@@
- <form id="search">
+ <form id="search"
action="/fullsearch/"
>
<span id="search-field" class="grid-line">
<input title="np. Leśmian" name="q" autocomplete="off" data-source="/fullsearch/hint/">
<span id="search-field" class="grid-line">
<input title="np. Leśmian" name="q" autocomplete="off" data-source="/fullsearch/hint/">
diff --git
a/wolnelektury/templates/catalogue/search_multiple_hits.html
b/wolnelektury/templates/catalogue/search_multiple_hits.html
index
15c5d71
..
414dcfd
100644
(file)
--- a/
wolnelektury/templates/catalogue/search_multiple_hits.html
+++ b/
wolnelektury/templates/catalogue/search_multiple_hits.html
@@
-18,6
+18,7
@@
{% for hit in result.process_hits %}
<li>
{% if hit.fragment %}
{% for hit in result.process_hits %}
<li>
{% if hit.fragment %}
+ <a href="{{hit.fragment.get_absolute_url}}">Idź do fragmentu</a>
<div style="">Tagi/Motywy: {% for tag in hit.themes %}{{tag.name}} {% endfor %}</div>
{% endif %}
{% for snip in hit.snippets %}
<div style="">Tagi/Motywy: {% for tag in hit.themes %}{{tag.name}} {% endfor %}</div>
{% endif %}
{% for snip in hit.snippets %}