Browse Source

Redesign search_form to use bootstrap button addon with icon

based on django_admin_bootstrapped/bootstrap3/templates/admin/search_form.html
producao
Marcio Mazza 10 years ago
parent
commit
c98c8c9afb
  1. 10
      sigiStatic/css/base_site.css
  2. 25
      templates/admin/search_form.html

10
sigiStatic/css/base_site.css

@ -208,3 +208,13 @@ div#footer a {
h1 { h1 {
margin-bottom: 20px; margin-bottom: 20px;
} }
.form-group button {
/* TODO:
consider undoing change done to '.form-group input[type="text"]'
in dajngo_admin_bootstraped overrides.css
instead of adujsting this */
height: 28px;
padding-top: 4px;
}

25
templates/admin/search_form.html

@ -0,0 +1,25 @@
{% load i18n admin_static %}
{% if cl.search_fields %}
<form class="navbar-form navbar-right" role="search" id="changelist-search" action="" method="get">
<div class="form-group"><!-- DIV needed for valid HTML -->
<div class="input-group">
<input type="text" class="form-control search-query" placeholder="{% trans 'Search' %}" size="40" name="{{ search_var }}" value="{{ cl.query }}" id="searchbar" />
<span class="input-group-btn">
<button class="btn btn-default" type="submit">
<span class="glyphicon glyphicon-search"></span>
</button>
</span>
</div>
</div>
{% if show_result_count %}
<span class="small quiet">{% blocktrans count counter=cl.result_count %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktrans %} (<a href="?{% if cl.is_popup %}pop=1{% endif %}">{% blocktrans with full_result_count=cl.full_result_count %}{{ full_result_count }} total{% endblocktrans %}</a>)</span>
{% endif %}
{% for pair in cl.params.items %}
{% ifnotequal pair.0 search_var %}<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}"/>{% endifnotequal %}
{% endfor %}
</form>
<script type="text/javascript">document.getElementById("searchbar").focus();</script>
{% endif %}
Loading…
Cancel
Save