[gen] Pod fields can now be configured with several templates.
This commit is contained in:
		
							parent
							
								
									889289407f
								
							
						
					
					
						commit
						ecc3a8c39b
					
				
					 10 changed files with 175 additions and 122 deletions
				
			
		| 
						 | 
				
			
			@ -93,7 +93,7 @@ class ToolWrapper(AbstractWrapper):
 | 
			
		|||
    # PXs for graphical elements shown on every page
 | 
			
		||||
    # --------------------------------------------------------------------------
 | 
			
		||||
    # Global elements included in every page.
 | 
			
		||||
    pxPagePrologue = Px('''<x>
 | 
			
		||||
    pxPagePrologue = Px('''
 | 
			
		||||
     <!-- Include type-specific CSS and JS. -->
 | 
			
		||||
     <x if="cssJs">
 | 
			
		||||
      <link for="cssFile in cssJs['css']" rel="stylesheet" type="text/css"
 | 
			
		||||
| 
						 | 
				
			
			@ -133,12 +133,11 @@ class ToolWrapper(AbstractWrapper):
 | 
			
		|||
           action=":ztool.absolute_url() + '/generateDocument'">
 | 
			
		||||
      <input type="hidden" name="objectUid"/>
 | 
			
		||||
      <input type="hidden" name="fieldName"/>
 | 
			
		||||
      <input type="hidden" name="template"/>
 | 
			
		||||
      <input type="hidden" name="podFormat"/>
 | 
			
		||||
      <input type="hidden" name="askAction"/>
 | 
			
		||||
      <input type="hidden" name="queryData"/>
 | 
			
		||||
      <input type="hidden" name="customParams"/>
 | 
			
		||||
     </form>
 | 
			
		||||
    </x>''')
 | 
			
		||||
     </form>''')
 | 
			
		||||
 | 
			
		||||
    pxPageBottom = Px('''
 | 
			
		||||
     <script var="info=zobj.getSlavesRequestInfo(page)"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -797,14 +797,12 @@ class AbstractWrapper(object):
 | 
			
		|||
        zopeObj.reindex()
 | 
			
		||||
        return appyObj
 | 
			
		||||
 | 
			
		||||
    def freeze(self, fieldName, doAction=False):
 | 
			
		||||
    def freeze(self, fieldName):
 | 
			
		||||
        '''This method freezes a POD document. TODO: allow to freeze Computed
 | 
			
		||||
           fields.'''
 | 
			
		||||
        rq = self.request
 | 
			
		||||
        field = self.o.getAppyType(fieldName)
 | 
			
		||||
        if field.type != 'Pod': raise 'Cannot freeze non-Pod field.'
 | 
			
		||||
        # Perform the related action if required.
 | 
			
		||||
        if doAction: self.request.set('askAction', True)
 | 
			
		||||
        # Set the freeze format
 | 
			
		||||
        rq.set('podFormat', field.freezeFormat)
 | 
			
		||||
        # Generate the document.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue