Browse Source

Ajusta alguns detalhes e cria botão de acesso a pesquisa

pull/980/head
Eduardo Calil 9 years ago
committed by Edward Ribeiro
parent
commit
313e6f7e65
  1. 3
      sapl/base/search_indexes.py
  2. 4
      sapl/templates/materia/materialegislativa_filter.html
  3. 6
      sapl/templates/search/search.html

3
sapl/base/search_indexes.py

@ -16,7 +16,6 @@ class DocumentoAcessorioIndex(indexes.SearchIndex, indexes.Indexable):
return self.model
def index_queryset(self, using=None):
"""Used when the entire index for model is updated."""
return self.get_model().objects.all()
def prepare(self, obj):
@ -37,8 +36,6 @@ class DocumentoAcessorioIndex(indexes.SearchIndex, indexes.Indexable):
arquivo.path).decode(
'utf-8').replace('\n', ' ')
# Now we'll finally perform the template processing to render the
# text field with *all* of our metadata visible for templating:
t = loader.select_template((
'search/indexes/' + self.template_name, ))
data['text'] = t.render(Context({'object': obj,

4
sapl/templates/materia/materialegislativa_filter.html

@ -4,6 +4,10 @@
{% block actions %}
<div class="actions btn-group pull-right" role="group">
<a href="{% url 'sapl.base:haystack_search' %}" class="btn btn-default">
Pesquisa Textual
</a>
{% if perms.materia %}
<a href="{% url 'sapl.materia:materialegislativa_create' %}" class="btn btn-default">
{% blocktrans with verbose_name=view.verbose_name %} Adicionar Matéria Legislativa {% endblocktrans %}

6
sapl/templates/search/search.html

@ -64,7 +64,11 @@
</tr>
{% empty %}
<h3> Nenhum resultado encontrado! </h3>
<h3> Nenhum texto encontrado! </h3>
<tr>
<td>
</td>
</tr>
{% endfor %}
</table>

Loading…
Cancel
Save