[[if 'table' in item and 'actions' in item['table']:]] [[table = item['table'] ]] [[if 'long' in table: long = table['long'] else: long = None pass]] [[if 'actions_bulk' in table and table['actions_bulk']: table_class = "actions_bulk" else: table_class = "actions" pass]] [[if 'object_col' in table: object_col = table['object_col'] url_object = True else: object_col = 0 url_object = True pass]] [[if 'second_col' in table: second_col = table['second_col'] use_second_col = True else: use_second_col = False pass]] [[if 'show_sub' in table: dosub = True old = table['show_sub'][0] new = table['show_sub'][1] else: dosub = False pass]] [[ if 'cell_newline' in table: newline_replace=table['cell_newline'] else: newline_replace=False pass]] [[if 'title' in table:]]

[[ =table['title'] ]]

[[pass]]
[[if 'header' in table:]] [[for i in range(0,len(table['header'])): ]] [[ col = table['header'][i] ]] [[ col_show = "show_" + str(table['column_show'][i]) ]] [[ if col[-1] == '*': ]] [[ else: ]] [[ pass ]] [[pass]] [[else:]] [[pass]] [[if not 'actions_bulk' in table:]] [[pass]] [[for row in table['data']:]] [[if len(row[0].strip()) > 0:]] [[ for i in range(0,len(row)-1): ]] [[ col = row[i] ]] [[ col_show = "show_" + str(table['column_show'][i]) ]] [[ if re.match(r'.*\*[\w]+$',col): # if * used and only alphanumeric characters follow then probably a # class tag, this is not a perfect test and may need refining for some # table situations v, c = col.split('*') c = c + " status" else: v = col c = '' pass]] [[if dosub: v = re.sub(old,new,v) pass]] [[if newline_replace: v = v.replace(newline_replace,'
') pass]] [[pass]] [[if not 'actions_bulk' in table:]] [[pass]] [[pass]] [[pass]]
[[ =col[0:-1] ]][[=col]]Item
[[=XML(v.replace('~','   '))]]   [[if url_object: row_action = form_action + '/' + row[object_col] else: row_action = form_action pass]] [[for act in row[-1]:]] [[if long: vars = {'1':act.replace('!',''),'2':row[0].replace('~',''),'long': long } else: vars = {'1':act.replace('!',''),'2':row[0].replace('~','') } pass]] [[if act and act[0] == "!": aClass="action double_check" act=act[1:] else: aClass="action" pass]] [[ show_act = re.sub('^[!?~]*([^+]*\+)?','',act) ]] [[if act:]] [[ if act == '~download': ]] download [[ elif act[0] == '~': ]] [[ =show_act.replace('_',' ') ]] [[ elif act[0] == '?': ]] [[ if use_second_col:]] [[ =show_act.replace('_',' ') ]] [[ else: ]] [[ =show_act.replace('_',' ').replace('+','_') ]] [[ pass ]] [[ else: ]]
[[ if use_second_col: ]] [[ pass ]]
[[ pass ]] [[pass]] [[pass]]
[[if 'actions_bulk' in table:]]
[[if long:]] [[pass]] [[for act in table['actions_bulk']:]] [[if act[0] == "!": aClass="double_check" act=act[1:] else: aClass="" pass]] [[pass]]
[[pass]] [[elif 'table' in item:]] [[table = item['table'] ]] [[if 'show_sub' in table: dosub = True old = table['show_sub'][0] new = table['show_sub'][1] else: dosub = False pass]] [[ if 'last_right' in table: table_class="last_right" else: table_class="" pass ]] [[ if 'cell_newline' in table: newline_replace=table['cell_newline'] else: newline_replace=False pass]] [[if 'title' in table:]]

[[ =table['title'] ]]

[[pass]]
[[for i in range(0,len(table['header'])): ]] [[ col = table['header'][i] ]] [[ col_show = "show_" + str(table['column_show'][i]) ]] [[ if col[-1] == '*': ]] [[ else: ]] [[ pass ]] [[pass]] [[for row in table['data']:]] [[if len(row)>0:]] [[ for i in range(0,len(row)): ]] [[ col = row[i] ]] [[ col_show = "show_" + str(table['column_show'][i]) ]] [[ if re.match(r'.*\*[\w]+$',col): # if * used and only alphanumeric characters follow then probably a # class tag, this is not a perfect test and may need refining for some # table situations v, c = col.split('*') c = c + " status" else: v = col c = '' pass]] [[if dosub: v = re.sub(old,new,v) pass]] [[if newline_replace: v = v.replace(newline_replace,'
') pass]] [[pass]] [[pass]] [[pass]]
[[ =col[0:-1] ]][[ =col ]]
[[=XML(v)]]
[[pass]]