appy.gen: in the default context of any pod field, added function '_' corresponding to obj.translate; appy.gen: xhtml2odt bugfix: when a <div> was contained in <ol><li> or <ul><li>, the whole function ouput was an empty string.

This commit is contained in:
Gaetan Delannay 2011-07-07 09:43:16 +02:00
parent 02fce03143
commit 93eb16670b
5 changed files with 1770 additions and 1748 deletions

View file

@ -2101,7 +2101,7 @@ class Pod(Type):
# Define parameters to give to the appy.pod renderer # Define parameters to give to the appy.pod renderer
podContext = {'tool': tool, 'user': obj.user, 'self': obj, podContext = {'tool': tool, 'user': obj.user, 'self': obj,
'now': obj.o.getProductConfig().DateTime(), 'now': obj.o.getProductConfig().DateTime(),
'projectFolder': tool.getDiskFolder()} '_': obj.translate, 'projectFolder': tool.getDiskFolder()}
# If the POD document is related to a query, get it from the request, # If the POD document is related to a query, get it from the request,
# execute it and put the result in the context. # execute it and put the result in the context.
isQueryRelated = rq.get('queryData', None) isQueryRelated = rq.get('queryData', None)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,8 @@
xhtmlInput = '''
<ol><li>
<div style="text-align: justify;">Le Gouvernement adopte le projet darrêté modifiant l'arrêté du 9 février 1998 portant délégations de compétence et de signature aux fonctionnaires généraux et à certains autres agents des services du Gouvernement de la Communauté française - Ministère de la Communauté française.</div>
</li><li>
<div style="text-align: justify;">Il charge le Ministre de la Fonction publique de l'exécution de la présente décision.</div>
</li></ol>
<p class="pmParaKeepWithNext">&nbsp;</p>
'''

Binary file not shown.

View file

@ -106,7 +106,8 @@ class HtmlElement:
if (parentElem.elemType == 'para') and \ if (parentElem.elemType == 'para') and \
(self.elem in NOT_INSIDE_P_OR_P): (self.elem in NOT_INSIDE_P_OR_P):
# Oups, li->p wrongly considered as a conflict. # Oups, li->p wrongly considered as a conflict.
if (parentElem.elem == 'li') and (self.elem == 'p'): return () if (parentElem.elem == 'li') and (self.elem in ('p', 'div')):
return ()
return (parentElem.setConflictual(),) return (parentElem.setConflictual(),)
# Check inner paragraphs # Check inner paragraphs
if (parentElem.elem in INNER_TAGS) and (self.elemType == 'para'): if (parentElem.elem in INNER_TAGS) and (self.elemType == 'para'):