From 116c0fb85dcc35986316b16aa1835467ff7cf609 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 1 Oct 2015 16:51:44 +0200 Subject: UI: load jqgrid lib on main page --- ishtar_common/context_processors.py | 1 + ishtar_common/templates/base.html | 4 ++++ .../ishtar/blocks/window_tables/dynamic_documents.html | 2 +- ishtar_common/widgets.py | 10 +++++----- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ishtar_common/context_processors.py b/ishtar_common/context_processors.py index f69ea4d26..c288f9899 100644 --- a/ishtar_common/context_processors.py +++ b/ishtar_common/context_processors.py @@ -66,6 +66,7 @@ def get_base_context(request): dct['MENU'] = request.session['MENU'] dct['JQUERY_URL'] = settings.JQUERY_URL dct['JQUERY_UI_URL'] = settings.JQUERY_UI_URL + dct['COUNTRY'] = settings.COUNTRY dct['current_menu'] = [] for lbl, model in CURRENT_ITEMS: model_name = model.__name__.lower() diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html index 37b8c4a05..f6b4cd414 100644 --- a/ishtar_common/templates/base.html +++ b/ishtar_common/templates/base.html @@ -15,10 +15,14 @@ + + + + {% for url_css in JQGRID_CSS %}{% endfor %} {% include "blocks/extra_head.html" %} {% block extra_head %} {% endblock %} diff --git a/ishtar_common/templates/ishtar/blocks/window_tables/dynamic_documents.html b/ishtar_common/templates/ishtar/blocks/window_tables/dynamic_documents.html index dce0a2c2e..27e1d3f82 100644 --- a/ishtar_common/templates/ishtar/blocks/window_tables/dynamic_documents.html +++ b/ishtar_common/templates/ishtar/blocks/window_tables/dynamic_documents.html @@ -18,7 +18,7 @@ setTimeout( function(){ - jQuery("#grid_{{name}}").jqGrid({ + $("#grid_{{name}}").jqGrid({ url:'{{source}}', datatype: "json", mtype: 'GET', diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 66380db8b..6ffb84084 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -505,11 +505,11 @@ class JQueryPersonOrganization(forms.TextInput): class JQueryJqGrid(forms.RadioSelect): COL_TPL = "{name:'%(idx)s', index:'%(idx)s', sortable:true}" - class Media: - js = ['%s/js/i18n/grid.locale-%s.js' % (settings.STATIC_URL, - settings.COUNTRY), - '%s/js/jquery.jqGrid.min.js' % settings.STATIC_URL] - css = {'all': ['%s/media/ui.jqgrid.css' % settings.STATIC_URL]} + # class Media: + # js = ['%s/js/i18n/grid.locale-%s.js' % (settings.STATIC_URL, + # settings.COUNTRY), + # '%s/js/jquery.jqGrid.min.js' % settings.STATIC_URL] + # css = {'all': ['%s/media/ui.jqgrid.css' % settings.STATIC_URL]} def __init__(self, source, form, associated_model, attrs={}, table_cols='TABLE_COLS', multiple=False, multiple_cols=[2], -- cgit v1.2.3