Changeset 7736


Ignore:
Timestamp:
1 Mar 2012, 06:50:40 (13 years ago)
Author:
Henrik Bettermann
Message:

Add viewletmanager which renders widgets in forms.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/browser
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/certificatemanagepage.pt

    r7705 r7736  
    1010  <div class="tab-content">
    1111    <div id="tab-1" tal:attributes="class view/tab1">
    12           <table class="form-table">
    13           <tbody>
    14           <tal:block repeat="widget view/widgets">
    15             <tr>
    16               <td class="fieldname">
    17                 <span tal:condition="widget/required">*</span>
    18                 <span tal:content="widget/label">label</span>:
    19               </td>
    20               <td>
    21                 <span tal:content="structure widget">
    22                   <input type="text" />
    23                 </span>
    24                 <tal:error tal:condition="widget/error">
    25                   <span tal:replace="structure widget/error">error</span>
    26                 </tal:error>
    27                 <tal:hint tal:condition="widget/hint">
    28                   <span tal:content="structure widget/hint">hint</span>
    29                 </tal:hint>
    30               </td>
    31             </tr>
    32           </tal:block>
    33           </tbody>
    34           </table>
    35           <div tal:condition="view/availableActions">
    36             <span tal:repeat="action view/actions"
    37                   tal:omit-tag="">
    38               <input tal:condition="python:action.label in view.taboneactions"
    39                      tal:replace="structure action/render"/>
    40             </span>
    41           </div>
     12    <table class="form-table">
     13      <tbody>
     14        <tal:widgets tal:content="structure provider:widgets" />
     15      </tbody>
     16    </table>
     17    <div tal:condition="view/availableActions">
     18      <span tal:repeat="action view/actions"
     19            tal:omit-tag="">
     20        <input tal:condition="python:action.label in view.taboneactions"
     21               tal:replace="structure action/render"/>
     22      </span>
     23    </div>
    4224    </div>
    4325    <div id="tab-2" tal:attributes="class view/tab2">
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/facultymanagepage.pt

    r7707 r7736  
    2222      <table class="form-table">
    2323        <tbody>
    24           <tal:block repeat="widget view/widgets">
    25             <tr>
    26               <td class="fieldname">
    27                 <span tal:condition="widget/required">*
    28                 </span>
    29                 <span tal:content="widget/label">LABEL
    30                 </span>:
    31               </td>
    32               <td>
    33                 <span tal:content="structure widget">
    34                   <input type="text" />
    35                 </span>
    36                 <tal:error tal:condition="widget/error">
    37                   <span tal:replace="structure widget/error">ERROR
    38                   </span>
    39                 </tal:error>
    40                 <tal:hint tal:condition="widget/hint">
    41                   <span tal:content="structure widget/hint">HINT
    42                   </span>
    43                 </tal:hint> </td>
    44             </tr>
    45           </tal:block>
     24          <tal:widgets tal:content="structure provider:widgets" />
    4625        </tbody>
    4726      </table>
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/usereditformpage.pt

    r7707 r7736  
    44  <table class="form-table">
    55    <tbody>
    6       <tal:block repeat="widget view/widgets">
    7         <tr>
    8           <td class="fieldname">
    9             <span tal:condition="widget/required">*</span>
    10             <span tal:content="widget/label">LABEL</span>:
    11           </td>
    12           <td>
    13             <span tal:content="structure widget">
    14               <input type="text" />
    15             </span>
    16             <tal:error tal:condition="widget/error">
    17               <span tal:replace="structure widget/error">ERROR</span>
    18             </tal:error>
    19             <tal:hint tal:condition="widget/hint">
    20               <span tal:content="structure widget/hint">HINT</span>
    21             </tal:hint>
    22           </td>
    23         </tr>
    24       </tal:block>
     6      <tal:widgets tal:content="structure provider:widgets" />
    257      <tr>
    268        <td i18n:translate="" class="fieldname">Password:</td>
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py

    r7705 r7736  
    5656    grok.name('admintasks')
    5757
     58class WidgetsSlot(grok.ViewletManager):
     59    grok.name('widgets')
     60
    5861
    5962#
     
    298301        else:
    299302            return ''
    300            
     303
     304class WidgetsTableRows(grok.Viewlet):
     305    """A base for action buttons without image
     306    """
     307    template = grok.PageTemplateFile('templates/widgets.pt')
     308    grok.viewletmanager(WidgetsSlot)
     309
     310
    301311#
    302312# waeup.sirp.app.University viewlets...
Note: See TracChangeset for help on using the changeset viewer.