Commit 751df999 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Use longtable in check_validate.

Duplicate error for a pair of ids are only shown once.
parent 7ee0d591
......@@ -90,7 +90,7 @@ def compare_latex(id1, id2):
keys.insert(0, keys.pop(i))
# build a table with difference
table = ["\\begin{tabular*}{\\textwidth}{| l | p{6cm} | p{6cm} |}"]
table = ["\\begin{longtable}{| l | p{6cm} | p{6cm} |}"]
table.append("\hline")
for key in keys:
if key in ('delete_record', 'update_record'):
......@@ -109,6 +109,6 @@ def compare_latex(id1, id2):
table.append(" \\textbf{%s} & %s & %s \\\\ \hline" % (key.replace('_', ' '), a, b))
table.append("\hline")
table.append("\end{tabular*}")
table.append("\end{longtable}")
return '\n'.join(table)
\ No newline at end of file
......@@ -79,8 +79,18 @@
response.write(BR())
response.write(myp_smallcap(T("Invalid records")))
ol = myol()
ids, ol = [], myol()
for msg in logs:
if msg.ids:
id1, id2 = int(msg.id), int(msg.ids[0])
if (id2, id1) in ids:
continue
else:
ids.append((id1, id2))
pass
pass
title = "%s, " % msg.title
txt = SPAN(', '.join(msg.txt), _style="color: red;")
id = SPAN(', id %s ' % msg.id, _style="color: green;")
......
......@@ -10,6 +10,7 @@
{hyperref}
\usepackage{breakurl}
\usepackage{color}
\usepackage{longtable}
\makeatletter
\makeatother
\begin{document}
......@@ -88,8 +89,20 @@
#--------------------------------------------------------------------------
write("\section*{%s}\n" % T("Invalid records"))
write("\\begin{enumerate}\n")
write("\\begin{enumerate}\n")
ids = []
for msg in logs:
# avoid to display twice duplicate entries
if msg.ids:
id1, id2 = int(msg.id), int(msg.ids[0])
if (id2, id1) in ids:
continue
else:
ids.append((id1, id2))
pass
pass
title = msg.title
txt = "{\color{red} %s}" % ', '.join(msg.txt)
id = "{\color{blue}id %s}" % msg.id
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment