From 9a5bda6142360dfc02d08e2251e55abdd7a561a0 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 27 Dec 2018 16:11:49 +0100 Subject: Table gallery: manage hover caption --- ishtar_common/views_item.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'ishtar_common/views_item.py') diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index 73569d4cb..c2fab5bde 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -1289,6 +1289,7 @@ def get_item(model, func_name, default_name, extra_request_keys=None, table_cols = settings.TABLE_COLS[tb_key] else: table_cols = model.TABLE_COLS + table_cols = table_cols[:] query_table_cols = [] for cols in table_cols: if type(cols) not in (list, tuple): @@ -1304,18 +1305,24 @@ def get_item(model, func_name, default_name, extra_request_keys=None, if col in model.CONTEXTUAL_TABLE_COLS[contxt]: query_table_cols[idx] = \ model.CONTEXTUAL_TABLE_COLS[contxt][col] - if full == 'shortcut' or data_type == 'json-image': + if full == 'shortcut': if model.SLUG == "warehouse": query_table_cols = ['name'] table_cols = ['name'] else: query_table_cols = ['cached_label'] table_cols = ['cached_label'] - if data_type == 'json-image': - query_table_cols.append('main_image__image') - query_table_cols.append('main_image__thumbnail') - table_cols.append('main_image__image') - table_cols.append('main_image__thumbnail') + if data_type == 'json-image': + if model.SLUG == "warehouse": + query_table_cols.append('name') + table_cols.append('name') + else: + query_table_cols.append('cached_label') + table_cols.append('cached_label') + query_table_cols.append('main_image__image') + query_table_cols.append('main_image__thumbnail') + table_cols.append('main_image__image') + table_cols.append('main_image__thumbnail') # manage sort tables manual_sort_key = None @@ -1530,6 +1537,7 @@ def get_item(model, func_name, default_name, extra_request_keys=None, "recordsTotal": items_nb, "recordsFiltered": items_nb, "rows": rows, + "table-cols": table_cols, "pinned-search": pinned_search, "page": page_nb, "total": (items_nb / row_nb + 1) if row_nb else items_nb, -- cgit v1.2.3