From 2f390838f180a67c95ce8670be6ca27db2b91182 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 16 Apr 2013 20:51:57 +0200 Subject: Fix duplicate in research --- ishtar_common/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 641ca8046..42e826103 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -242,7 +242,7 @@ def get_item(model, func_name, default_name, extra_request_keys=[], query = Q(**dct) for or_req in or_reqs: query = query & or_req - items = model.objects.filter(query) + items = model.objects.filter(query).distinct() q = request_items.get('sidx') # manage sort tables -- cgit v1.2.3 From 451e8410e0b50b25527f20595cf971af41b160b1 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 16 Apr 2013 21:26:30 +0200 Subject: Add a progress visual for research - improve CSS --- ishtar_common/static/media/style.css | 70 +++++++++++++++++++++++++++++------- ishtar_common/templates/base.html | 4 +++ ishtar_common/widgets.py | 8 ++++- 3 files changed, 68 insertions(+), 14 deletions(-) diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index fe078fa3c..957619f4c 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -3,11 +3,47 @@ background-color:#ff6e6e; } +a.add-button, a.remove, +#progress-content{ + background-color:#fff; +} + +div.form { + background-color: #EEE; +} + /* color */ -a { +a, a.remove { color:#D14; } +a.add-button{ + color:#61615C; +} +/* borders */ +a.add-button, a.remove, +#progress-content, +div.form { + border:2px solid #CCC; +} + +/* shadows */ +#progress-content, +.sheet{ + -webkit-box-shadow: 0px 0px 20px #444; + -moz-box-shadow: 0px 0px 20px #444; + box-shadow: 0px 0px 20px #444; +} + +/* radius */ +a.add-button, a.remove, +.sheet, +#progress-content, +div.form { + -moz-border-radius:8px; + -webkit-border-radius:8px; + border-radius:8px; +} body{ font-family:Arial, Helvetica, sans-serif; @@ -214,11 +250,6 @@ div.form { padding:1em; display:block; width:740px; - background-color: #EEE; - border:2px solid #CCC; - -moz-border-radius:8px; - -webkit-border-radius:8px; - border-radius:8px; text-align:center; } @@ -506,17 +537,10 @@ td.submit_button{ } a.add-button, a.remove{ - background-color:#FFF; - border:2px solid #CCC; - -moz-border-radius:8px; - -webkit-border-radius:8px; - border-radius:8px; padding:0 4px; - color:#61615C; } a.remove{ - color:#D14; margin:0 6px; } @@ -544,3 +568,23 @@ a.remove{ .widget-parcel{ width:60px; } + +#progress{ + display:none; + position:fixed; + height:50px; + width:100%; + top:40%; + z-index:42000; +} + +#progress-content{ + background-image:url(images/ajax-loader.gif); + background-repeat: no-repeat; + background-position:center center; + margin-left:auto; + margin-right:auto; + width:50px; + height:50px; + padding:10px; +} diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html index 6e44e8729..007314892 100644 --- a/ishtar_common/templates/base.html +++ b/ishtar_common/templates/base.html @@ -84,6 +84,10 @@ {% block footer %} {% endblock %} +
+
+
+
diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 3ecdad310..af638aba7 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2010-2011 Étienne Loks +# Copyright (C) 2010-2013 Étienne Loks # Copyright (C) 2007 skam # (http://djangosnippets.org/snippets/233/) @@ -281,6 +281,9 @@ class JQueryJqGrid(forms.RadioSelect): var selItems_%(sname)s = new Array(); jQuery(document).ready(function(){ jQuery("#search_%(name)s").click(function (){ + if ($("#progress").length > 0){ + $("#progress").show(); + } var data = ""; for (idx in query_vars) { @@ -295,6 +298,9 @@ class JQueryJqGrid(forms.RadioSelect): var url = "%(source)s?submited=1&" + data; mygrid.setGridParam({url:url}); mygrid.trigger("reloadGrid"); + if ($("#progress").length > 0){ + $("#progress").hide(); + } return false; }); -- cgit v1.2.3