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:
# 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)
context_instance=RequestContext(request))
hint.tags(tag_list)
- hint.books(book)
+ if book:
+ hint.books(book)
toks = StringReader(query)
fuzzy = 'fuzzy' in request.GET
- <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/">
{% 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 %}