[gen] Optimized PXs. [px] added tag 'var2', similar to 'var', but that is executed after tags 'for' and 'if'.
This commit is contained in:
parent
73c3cfb2c7
commit
1810373304
18 changed files with 834 additions and 956 deletions
|
@ -105,6 +105,17 @@ class ToolMixin(BaseMixin):
|
|||
podField = self.getAppyType(name, className=obj.meta_type)
|
||||
return podField.getToolInfo(obj.appy())
|
||||
|
||||
def getImageUrl(self, name, bg=False):
|
||||
'''Gets the full URL of an image named p_name. If p_bg is False, the URL
|
||||
is meant to be used as content for an img's "src" attribute. If p_bg
|
||||
is True, the URL is meant to be used in a "style" attribute for
|
||||
defining the background image of the current tag.'''
|
||||
# If not extension is found in the image p_name, suppose it is a png.
|
||||
if '.' not in name: name += '.png'
|
||||
url = '%s/ui/%s' % (self.getPhysicalRoot(),absolute_url(), name)
|
||||
if not bg: return url
|
||||
return 'background-image: url(%s)' % url
|
||||
|
||||
def generateDocument(self):
|
||||
'''Generates the document from field-related info. UID of object that
|
||||
is the template target is given in the request.'''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue