From 32b3959f8e759b8253239449155e36d1a8360c84 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Fri, 27 Apr 2012 19:21:42 +0200 Subject: [PATCH] wip: UI refactoring * Possibility to search for domain aliases (domains listing page) * Correct events binding. see #204 --- admin/views.py | 4 +++- static/js/creation_wizard.js | 7 +++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/admin/views.py b/admin/views.py index b7ed1596e..7d80d8db0 100644 --- a/admin/views.py +++ b/admin/views.py @@ -32,7 +32,9 @@ def domains(request): domains = request.user.get_domains() squery = request.GET.get("searchquery", None) if squery is not None: - domains = domains.filter(name__contains=squery) + q = Q(name__contains=squery) + q |= Q(domainalias__name__contains=squery) + domains = domains.filter(q).distinct() return render_listing(request, "domains", "admin/domains.html", objects=domains, squery=squery) diff --git a/static/js/creation_wizard.js b/static/js/creation_wizard.js index 44252a75e..e1134594e 100644 --- a/static/js/creation_wizard.js +++ b/static/js/creation_wizard.js @@ -16,9 +16,9 @@ }, listen: function() { - $(".next").one("click", $.proxy(this.next, this)); - $(".prev").one("click", $.proxy(this.prev, this)); - $(".submit").one("click", $.proxy(this.submit, this)); + $(".next").on("click", $.proxy(this.next, this)); + $(".prev").on("click", $.proxy(this.prev, this)); + $(".submit").on("click", $.proxy(this.submit, this)); }, post: function(last) { @@ -52,7 +52,6 @@ if (resp.respmsg) { $(".modal-body").prepend(build_error_alert(resp.respmsg)); } - //this.listen(); }, this)); },