appy.gen: allow to define several layoutTypes (ie: ('edit', 'result')) as a tuple/list in 'show' attributes of fields.
This commit is contained in:
		
							parent
							
								
									431511026c
								
							
						
					
					
						commit
						7b0b7e147d
					
				
					 8 changed files with 34 additions and 15 deletions
				
			
		| 
						 | 
				
			
			@ -185,6 +185,7 @@
 | 
			
		|||
                 hasHistory contextObj/hasHistory;
 | 
			
		||||
                 historyMaxPerPage options/maxPerPage|python: 5;
 | 
			
		||||
                 historyExpanded python: request.get('appyHistory', 'collapsed') == 'expanded';
 | 
			
		||||
                 _ python: tool.translate;
 | 
			
		||||
                 creator contextObj/Creator"
 | 
			
		||||
     tal:condition="not: contextObj/isTemporary">
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -106,7 +106,7 @@
 | 
			
		|||
        <tal:field define="contextObj python:obj;
 | 
			
		||||
                           layoutType python:'cell';
 | 
			
		||||
                           innerRef python:True"
 | 
			
		||||
                   condition="python: contextObj.showField(widget['name'], 'view')">
 | 
			
		||||
                   condition="python: contextObj.showField(widget['name'], 'result')">
 | 
			
		||||
           <metal:field use-macro="context/ui/widgets/show/macros/field"/>
 | 
			
		||||
         </tal:field>
 | 
			
		||||
      </td>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -120,7 +120,7 @@
 | 
			
		|||
         </a>
 | 
			
		||||
         <!-- Config -->
 | 
			
		||||
         <a tal:condition="python: user.has_role('Manager')"
 | 
			
		||||
            tal:attributes="href python: tool.getUrl(page='main', nav='');
 | 
			
		||||
            tal:attributes="href python: tool.getUrl(nav='');
 | 
			
		||||
                            title python: _('%sTool' % appName)">
 | 
			
		||||
          <img tal:attributes="src string:$appUrl/ui/appyConfig.gif"/>
 | 
			
		||||
         </a>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -26,17 +26,17 @@
 | 
			
		|||
<tal:comment replace="nothing">Search macro for an Boolean.</tal:comment>
 | 
			
		||||
<metal:search define-macro="search"
 | 
			
		||||
              tal:define="typedWidget python:'%s*bool' % widgetName">
 | 
			
		||||
  <label tal:attributes="for widgetName" tal:content="python: tool.translate(widget['labelId'])"></label><br>  
 | 
			
		||||
  <label tal:attributes="for widgetName" tal:content="python: _(widget['labelId'])"></label><br>  
 | 
			
		||||
  <tal:yes define="valueId python:'%s_yes' % name">
 | 
			
		||||
    <input type="radio" value="True" tal:attributes="name typedWidget; id valueId"/>
 | 
			
		||||
    <label tal:attributes="for valueId">Yes</label>
 | 
			
		||||
    <label tal:attributes="for valueId" tal:content="python: _('yes')"></label>
 | 
			
		||||
  </tal:yes>
 | 
			
		||||
  <tal:no define="valueId python:'%s_no' % name">
 | 
			
		||||
    <input type="radio" value="False" tal:attributes="name typedWidget; id valueId"/>
 | 
			
		||||
    <label tal:attributes="for valueId">No</label>
 | 
			
		||||
    <label tal:attributes="for valueId" tal:content="python: _('no')"></label>
 | 
			
		||||
  </tal:no>
 | 
			
		||||
  <tal:whatever define="valueId python:'%s_whatever' % name">
 | 
			
		||||
    <input type="radio" value="" tal:attributes="name typedWidget; id valueId" checked="checked"/>
 | 
			
		||||
    <label tal:attributes="for valueId" tal:content="python: tool.translate('whatever')"></label>
 | 
			
		||||
    <label tal:attributes="for valueId" tal:content="python: _('whatever')"></label>
 | 
			
		||||
  </tal:whatever><br/>
 | 
			
		||||
</metal:search>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue