New search bar to filter listing pages.

see #238
This commit is contained in:
Antoine Nguyen
2012-04-10 13:39:47 +02:00
parent 9239dc0447
commit ccbe47bc6a
8 changed files with 58 additions and 11 deletions
+10 -1
View File
@@ -8,7 +8,16 @@
question: gettext("Delete this domain?"),
checkboxes: {keepdir: gettext("Do not delete domain directory")}
});
$("#searchquery").focus(function() {
$(this).attr("value", "");
}).blur(function() {
var $this = $(this);
if ($this.attr("value") == "") {
$this.attr("value", gettext("Search"));
}
});
});
</script>
{% endblock %}
{% block leftcol %}<div class="well sidebar-nav">{% domains_menu "domains" user %}</div>{% endblock %}
{% block leftcol %}<div class="well sidebar-nav">{% include "admin/searchform.html" %}
{% domains_menu "domains" user %}</div>{% endblock %}
+1
View File
@@ -1,4 +1,5 @@
{% extends "twocols.html" %}
{% block html_head %}
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/admin.css" />
<script type="text/javascript" src="{{ MEDIA_URL }}js/admin.js"></script>
{% endblock %}
+2 -1
View File
@@ -31,4 +31,5 @@ $(document).ready(function() {
});
</script>
{% endblock %}
{% block leftcol %}<div class="well sidebar-nav">{% identities_menu user %}</div>{% endblock %}
{% block leftcol %}<div class="well sidebar-nav">{% include "admin/searchform.html" %}
{% identities_menu user %}</div>{% endblock %}
+12
View File
@@ -3,6 +3,18 @@
{% block html_head %}
{{ block.super }}
<script type="text/javascript" src="{{ MEDIA_URL }}js/dynamic_input.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#searchquery").focus(function() {
$(this).attr("value", "");
}).blur(function() {
var $this = $(this);
if ($this.attr("value") == "") {
$this.attr("value", {% if squery %}"{{ squery }}"{% else %}gettext("Search"){% endif %});
}
});
});
</script>
{% endblock %}
{% block apparea %}
{{ table|safe }}
+6
View File
@@ -0,0 +1,6 @@
{% load i18n %}
<form id="searchform" class="form-search">
<input class="input-medium search-query" type="text"
value={% if squery %}"{{ squery }}"{% else %}"{% trans 'Search' %}"{% endif %}
id="searchquery" name="searchquery" />
</form>