From a182b1c190020f1204cd0cb3918c5d1e9d2ce8c4 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 29 Aug 2013 00:19:42 +0200 Subject: Browse sheets (refs #1219) --- ishtar_common/static/js/ishtar.js | 3 ++- ishtar_common/static/media/style.css | 13 ++++++++++ ishtar_common/templates/blocks/JQueryJqGrid.html | 28 +++++++++++++++++++++- ishtar_common/templates/ishtar/sheet.html | 30 +++++++++++++++++++++--- ishtar_common/views.py | 3 +++ ishtar_common/widgets.py | 6 ++--- 6 files changed, 75 insertions(+), 8 deletions(-) diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js index caa28089c..c26c8a7d9 100644 --- a/ishtar_common/static/js/ishtar.js +++ b/ishtar_common/static/js/ishtar.js @@ -56,7 +56,7 @@ $(".help_display").live("click", function(){ var last_window; -function load_window(url, speed){ +function load_window(url, speed, on_success){ $.ajax({ url: url, cache: false, @@ -64,6 +64,7 @@ function load_window(url, speed){ $("#window").append(html); $("#"+last_window).show(); $("a[rel^='prettyPhoto']").prettyPhoto({'social_tools':''}); + if (on_success) on_success(); }, error:function(XMLHttpRequest, textStatus, errorThrows){ } diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index a957e0794..f622fcb0d 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -372,6 +372,19 @@ table.confirm tr.spacer td:last-child{ border-radius:8px; } +.previous_page, .next_page{ + position:absolute; + top:1px; +} + +.previous_page{ + left:135px; +} + +.next_page{ + right:135px; +} + .dashboard > div, .dashboard h3{ width:760px; diff --git a/ishtar_common/templates/blocks/JQueryJqGrid.html b/ishtar_common/templates/blocks/JQueryJqGrid.html index 26855f4ea..d21fa8276 100644 --- a/ishtar_common/templates/blocks/JQueryJqGrid.html +++ b/ishtar_common/templates/blocks/JQueryJqGrid.html @@ -29,7 +29,8 @@ - diff --git a/ishtar_common/templates/ishtar/sheet.html b/ishtar_common/templates/ishtar/sheet.html index 9ce038ae9..915376938 100644 --- a/ishtar_common/templates/ishtar/sheet.html +++ b/ishtar_common/templates/ishtar/sheet.html @@ -15,11 +15,35 @@
{% block head_sheet %} + {% endblock %} +{% trans "Close all windows" %} +{% trans "Next" %} + +
+ + +{% endblock %}
{% block content %}{% endblock %}
diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 2278cf47a..3ebb20569 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -371,6 +371,9 @@ def show_item(model, name): except ObjectDoesNotExist: return HttpResponse(None) doc_type = 'type' in dct and dct.pop('type') + url_name = u"/".join(reverse('show-'+name, args=['0', ''] + ).split('/')[:-2]) + u"/" + dct['current_window_url'] = url_name date = 'date' in dct and dct.pop('date') dct['window_id'] = "%s-%d-%s" % (name, item.pk, datetime.datetime.now().strftime('%M%s')) diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index e94353ec7..c10bc7d34 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -238,9 +238,9 @@ class JQueryJqGrid(forms.RadioSelect): continue col_names.append(u'"%s"' % field_verbose_name) extra_cols.append(self.COL_TPL % {'idx':field_name}) - col_names = col_names and ",\n".join(col_names) or "" - col_idx = col_idx and ",\n".join(col_idx) or "" - extra_cols = extra_cols and ",\n".join(extra_cols) or "" + col_names = col_names and ", ".join(col_names) or "" + col_idx = col_idx and ", ".join(col_idx) or "" + extra_cols = extra_cols and ", ".join(extra_cols) or "" dct['encoding'] = settings.ENCODING or 'utf-8' dct['source'] = unicode(self.source) if unicode(self.source_full) and unicode(self.source_full) != 'None': -- cgit v1.2.3