From efd918f175bbd68f15bac6a5c4c7bb3b570631e9 Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Sat, 20 Jul 2013 19:56:17 +0200 Subject: [PATCH] [gen] Replaced, in PXs, function 'img' by function 'url', that returns the URL of an external resource to be included in the XHTML, like an image, a Javascript file or a CSS file. --- fields/action.py | 4 +- fields/calendar.py | 8 ++-- fields/date.py | 6 +-- fields/list.py | 4 +- fields/ogone.py | 2 +- fields/pod.py | 2 +- fields/ref.py | 18 ++++---- gen/mixins/ToolMixin.py | 12 ++--- gen/utils.py | 8 ++-- gen/wrappers/ToolWrapper.py | 14 +++--- gen/wrappers/__init__.py | 90 ++++++++++++++++++------------------- 11 files changed, 83 insertions(+), 85 deletions(-) diff --git a/fields/action.py b/fields/action.py index 849f40e..41e1b2f 100644 --- a/fields/action.py +++ b/fields/action.py @@ -36,12 +36,12 @@ class Action(Field): + style=":url('buttonAction', bg=True)"/> ''') # It is not possible to edit an action, not to search it. diff --git a/fields/calendar.py b/fields/calendar.py index 73b4ce8..71235d9 100644 --- a/fields/calendar.py +++ b/fields/calendar.py @@ -47,7 +47,7 @@ class Calendar(Field): goForward=not endDate or (endDate.strftime(fmt) > \ grid[-1][-1].strftime(fmt))"> - @@ -60,7 +60,7 @@ class Calendar(Field): q(objUrl), q(field.name), q(defaultDateMonth))" disabled=":defaultDate.strftime(fmt)==monthDayOne.strftime(fmt)"/> - :_('month_%s' % monthDayOne.aMonth()) @@ -107,14 +107,14 @@ class Calendar(Field): diff --git a/fields/date.py b/fields/date.py index e60bd72..2247047 100644 --- a/fields/date.py +++ b/fields/date.py @@ -56,7 +56,7 @@ class Date(Field): - + @@ -111,7 +111,7 @@ class Date(Field): - + @@ -144,7 +144,7 @@ class Date(Field): - + diff --git a/fields/list.py b/fields/list.py index 78ad9f9..716f81c 100644 --- a/fields/list.py +++ b/fields/list.py @@ -33,7 +33,7 @@ class List(Field): widgetName='%s*%d' % (field.name, rowIndex)">:field.pxView - ''') @@ -47,7 +47,7 @@ class List(Field): ::_(info[1].labelId) - diff --git a/fields/ogone.py b/fields/ogone.py index a45eec3..bc27ba6 100644 --- a/fields/ogone.py +++ b/fields/ogone.py @@ -38,7 +38,7 @@ class Ogone(Field): - ''') diff --git a/fields/pod.py b/fields/pod.py index 3369377..8f614b5 100644 --- a/fields/pod.py +++ b/fields/pod.py @@ -43,7 +43,7 @@ class Pod(Field): - diff --git a/fields/ref.py b/fields/ref.py index 431af5f..58584e0 100644 --- a/fields/ref.py +++ b/fields/ref.py @@ -61,11 +61,11 @@ class Ref(Field): ajaxBaseCall=navBaseCall.replace('**v**','%s,%s,{%s:%s,%s:%s}'%\ (q(startNumber), q('ChangeRefOrder'), q('refObjectUid'), q(obj.UID()), q('move'), q('**v**')))"> - @@ -76,16 +76,16 @@ class Ref(Field): - + + src=":url('delete')" onclick=":'onDeleteObject(%s)'%q(obj.UID())"/> - @@ -109,7 +109,7 @@ class Ref(Field): noFormCall=not field.addConfirm and noFormCall or \ 'askConfirm(%s, %s, %s)' % (q('script'), q(noFormCall), \ q(addConfirmMsg))" - style=":img('buttonAdd', bg=True)" value=":_('add_ref')" + style=":url('buttonAdd', bg=True)" value=":_('add_ref')" onclick=":field.noForm and noFormCall or formCall"/>''') # This PX displays, in a cell header from a ref table, icons for sorting the @@ -120,9 +120,9 @@ class Ref(Field): var2="ajaxBaseCall=navBaseCall.replace('**v**', '%s,%s,{%s:%s,%s:%s}'% \ (q(startNumber), q('SortReference'), q('sortKey'), \ q(field.name), q('reverse'), q('**v**')))"> - - ''') @@ -180,7 +180,7 @@ class Ref(Field): :field.pxAdd :_(field.labelId) :field.translated @@ -174,16 +174,16 @@ class PhaseDescr(Descr): editable=mayEdit and phase['pagesInfo'][aPage]['showOnEdit']"> - + + src=":url('locked')" title=":lockMsg"/> - diff --git a/gen/wrappers/ToolWrapper.py b/gen/wrappers/ToolWrapper.py index d12dbac..b2f6607 100644 --- a/gen/wrappers/ToolWrapper.py +++ b/gen/wrappers/ToolWrapper.py @@ -49,8 +49,8 @@ class ToolWrapper(AbstractWrapper): (className, searchName, loop.obj.nb+1+startNumber, totalNumber)" href=":obj.getUrl(mode='edit', page=obj.getDefaultEditPage(), \ nav=navInfo)"> - - + @@ -206,9 +206,9 @@ class ToolWrapper(AbstractWrapper): + href=":url(cssFile)"/> + src=":url(jsFile)">

:_('%s_plural'%className) – @@ -238,7 +238,7 @@ class ToolWrapper(AbstractWrapper):


+ style=":url('buttonSearch', bg=True)"/>

''', template=AbstractWrapper.pxTemplate, hook='content') @@ -305,13 +305,13 @@ class ToolWrapper(AbstractWrapper): - ''') # Displays up/down arrows in a table header column for sorting a given @@ -43,18 +43,18 @@ class AbstractWrapper(object): + src=":url('sortDown.gif')" class="clickable"/> + src=":url('sortUp.gif')" class="clickable"/> + src=":url('funnel')" class="clickable"/> ''') # Buttons for navigating among a list of elements: next,back,first,last... @@ -67,27 +67,27 @@ class AbstractWrapper(object): @@ -99,7 +99,7 @@ class AbstractWrapper(object): sNumber= nbOfCountedPages * batchSize" if="(startNumber != sNumber) and \ (startNumber != sNumber-batchSize)"> @@ -125,15 +125,15 @@ class AbstractWrapper(object): var="gotoSource=_('goto_source'); goBack=backText and ('%s - %s' % (backText, gotoSource)) \ or gotoSource" - src=":img('gotoSource')" title=":goBack"/> + src=":url('gotoSource')" title=":goBack"/> + src=":url('arrowLeftDouble')"/> + src=":url('arrowLeftSimple')"/>  @@ -143,11 +143,11 @@ class AbstractWrapper(object): + src=":url('arrowRightSimple')"/> + src=":url('arrowRightDouble')"/> ''') pxNavigationStrip = Px(''' @@ -156,7 +156,7 @@ class AbstractWrapper(object):
- :columnHeader
  - :startNumber + 1 + :startNumber + 1 :startNumber + len(objs) // :totalNumber  
+ style=":url('%s.jpg' % bannerName, bg=True)">
- - + + @@ -508,18 +506,18 @@ class AbstractWrapper(object): - + :self.pxIcons - +
:userInfo[0] + href=":userInfo[1]">
@@ -588,7 +586,7 @@ class AbstractWrapper(object): :_('data_change') @@ -637,7 +635,7 @@ class AbstractWrapper(object): @@ -668,7 +666,7 @@ class AbstractWrapper(object): :_('object_history') || @@ -725,13 +723,13 @@ class AbstractWrapper(object): + style=":url('buttonPrevious', bg=True)"/> @@ -739,13 +737,13 @@ class AbstractWrapper(object): + style=":url(buttonSave', bg=True)" value=":_('object_save')"/> + style=":url('buttonCancel', bg=True)" value=":_('object_cancel')"/> @@ -764,7 +762,7 @@ class AbstractWrapper(object): var="lockDate=tool.formatDate(locked[1]); lockMap={'user':tool.getUserName(locked[0]),'date':lockDate}; lockMsg=_('page_locked', mapping=lockMap)" - src=":img('lockedBig')" title=":lockMsg"/> + src=":url('lockedBig')" title=":lockMsg"/> @@ -772,12 +770,12 @@ class AbstractWrapper(object): + style=":url('buttonNext', bg=True)" value=":_('page_next')"/> @@ -789,7 +787,7 @@ class AbstractWrapper(object): - +