8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-05 01:16:27 +00:00

Adapte le champs search de navbar aux nouveauté et y affiche la query

This commit is contained in:
Maël Kervella 2017-11-02 00:35:22 +00:00
parent 0df8ce4dc0
commit a2569f4cc2
2 changed files with 2 additions and 1 deletions

View file

@ -225,6 +225,7 @@ def get_results(query, request, filters={}):
results[r] = results[r].distinct()[:max_result]
results.update({'max_result': max_result})
results.update({'search_term': query})
return results

View file

@ -74,7 +74,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="col-sm-3 col-md-3 navbar-right">
<form action="{% url "search:search"%}" class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="search_field" id="search-term">
<input type="text" class="form-control" placeholder="Search" name="q" id="search-term" {% if search_term %}value="{{ search_term }}"{% endif %}>
<div class="input-group-btn">
<button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
<a href="{% url "search:searchp" %}" class="btn btn-default" role="button"><i class="glyphicon glyphicon-plus"></i></a>