Commit 8a1a0db1 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Polish the check & compare view.

parent 6fbd8e96
......@@ -81,7 +81,7 @@ def compare_publications():
The arguments of the URL are id1 and id2.
data = []
data, idrow = [], []
if 'id1' not in request.vars or 'id2' not in request.vars:
return INLINE_ALERT % (T('Error'), T('Specify id1 and id2 in the URL'))
......@@ -119,7 +119,9 @@ def compare_publications():
data.append([T(field.label), value1, value2])
# add the ids as the first data
data.insert(0, idrow)
# the protection covers the case in which id1=id2
if idrow:
data.insert(0, idrow)
# delegate the rendering to the view
return dict(data=data, title=row1.title)
......@@ -100,7 +100,7 @@
'Colonnes': 'Colonnes',
'Columns': 'Colonnes',
'COM': 'COM',
'Compare publications': 'Compare des publications',
'Compare publications %s and %s': 'Compare les publications %s et %s',
'Comparison took %s seconds': 'La comparaison à durée %s secondes',
'Conditions': 'Conditions',
'Conference': 'Conférence',
......@@ -167,6 +167,7 @@
'Enter an integer between %(min)g and %(max)g': 'Enter an integer between %(min)g and %(max)g',
'enter an integer between %(min)g and %(max)g': 'entrez un entier entre %(min)g et %(max)g',
'enter an integer greater than or equal to %(min)g': 'entrez un entier plus grand ou égual à %(min)g',
'Entries with duplicate origin': 'Enregistrements avec la même origine',
'Entries with duplicate origin [%s]': 'Enregistrements avec la même origine [%s]',
'Error': 'Erreur',
'Error !!!': 'Erreur !!!',
......@@ -90,7 +90,7 @@ def check_publication(row):
# duplicate by origin
ids = duplicate_origin(row.publications)
if len(ids) > 1:
if len(ids):
idset = idset.union(ids)
text = T("Entries with duplicate origin")
......@@ -304,8 +304,10 @@ def duplicate_origin(publication):
return ids
# look for publication with the same origin field
query = db.publications.origin == publication['origin']
query = != publication['id']
query = ((query) & (db.publications.origin == publication['origin']))
set = db(query)
if set.count():
for row in
......@@ -83,7 +83,7 @@
store: Ext.create('', cfgStore),
columns: [
{xtype: 'rownumberer'},
{text: trField, dataIndex: 'field', flex: 1},
{text: trField.concat(' (*)'), dataIndex: 'field', flex: 1},
{text: trReference, dataIndex: 'value1', flex: 1.5},
{text: trDuplicate, dataIndex: 'value2', flex: 1.5}
......@@ -105,13 +105,13 @@
<p style="font-size: 12px; font-variant: small-caps; margin-left: 10px; margin-bottom: 3ex; margin-top: 2ex;">
{{=T("Compare publications")}}
{{=T("Compare publications %s and %s") % (request.vars.id1, request.vars.id2)}}
<div id="grid-{{=divgrid}}" style="padding: 10px 0px 0px 40px"></div>
<p style="font-size: 8px; margin-top: 0px; margin-left: 40px; margin-bottom: 30px;">
{{=T("Fields with identical value are not listed.")}}
(*) {{=T("Fields with identical value are not listed.")}}
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