From 6fb13635b6fe2e7dc11c6ad0bf53e62af4688cff Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Wed, 30 Jan 2019 23:55:59 +0100 Subject: [PATCH] Fix in list --- paramecio/citoplasma/lists.py | 2 + .../citoplasma/templates/utils/list.phtml | 43 ++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/paramecio/citoplasma/lists.py b/paramecio/citoplasma/lists.py index 966d949..5be1115 100644 --- a/paramecio/citoplasma/lists.py +++ b/paramecio/citoplasma/lists.py @@ -57,6 +57,8 @@ class SimpleList: self.initial_num_pages=20 + self.table_div=False + request.query.get('begin_page', '0') try: diff --git a/paramecio/citoplasma/templates/utils/list.phtml b/paramecio/citoplasma/templates/utils/list.phtml index 31a6ac6..8ab9f12 100644 --- a/paramecio/citoplasma/templates/utils/list.phtml +++ b/paramecio/citoplasma/templates/utils/list.phtml @@ -21,7 +21,8 @@ % endif - +% if not simplelist.table_div: +
% for field in simplelist.fields_showed: @@ -56,6 +57,46 @@ %> % endfor
${set_css_arrow(simplelist, field)}${simplelist.model.fields[field].label}
+% else: + +
+
+ % for field in simplelist.fields_showed: + ${set_css_arrow(simplelist, field)}${simplelist.model.fields[field].label} + % endfor + % for extra_field in simplelist.arr_extra_fields: + ${ extra_field } + % endfor +
+
+ <% + pos=0 + %> + % for row in list: + <% + if not 'pos' in row: + row['pos']=pos + %> + + % for field in simplelist.fields_showed: + % if simplelist.model.fields[field].escape==True: + ${simplelist.model.fields[field].show_formatted(row[field])} + % else: + ${str(simplelist.model.fields[field].show_formatted(row[field]))|n} + % endif + % endfor + + % for extra_field_func in simplelist.arr_extra_options: + ${ simplelist.set_options(extra_field_func, row)|n } + % endfor + <% + pos+=1 + %> + % endfor +
+
+ +% endif

% if pages!='': ${lang('common', 'pages', 'Pages')}: ${pages|n}