Ignore:
Timestamp:
12 May 2011, 15:50:57 (14 years ago)
Author:
Henrik Bettermann
Message:

Implement ReSTWidget.

This widget must only be used once per page because it renders h1 .. h4 tags inside an id.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/applicants
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py

    r6054 r6063  
    55## $Id$
    66##
    7 ## Copyright (C) 2010 Uli Fouquet
     7## Copyright (C) 2010 Uli Fouquet & Henrik Bettermann
    88## This program is free software; you can redistribute it and/or modify
    99## it under the terms of the GNU General Public License as published by
     
    5050from waeup.sirp.widgets.datewidget import (
    5151    FriendlyDateWidget, FriendlyDateDisplayWidget)
     52   
     53from waeup.sirp.widgets.restwidget import ReSTWidget   
    5254
    5355#from zope.formlib.objectwidget import ObjectWidget
     
    235237    form_fields['startdate'].custom_widget = FriendlyDateDisplayWidget('le')
    236238    form_fields['enddate'].custom_widget = FriendlyDateDisplayWidget('le')
     239    form_fields['description'].custom_widget = ReSTWidget
    237240
    238241    @property
     
    245248        return self.title
    246249
    247     def descriptionToHTML(self):
    248         if self.context.description:
    249             return ReST2HTML(self.context.description)
    250         else:
    251             return
     250    #def descriptionToHTML(self):
     251    #    if self.context.description:
     252    #        return ReST2HTML(self.context.description)
     253    #    else:
     254    #        return
    252255
    253256class ManageApplicantsContainerActionButton(ManageActionButton):
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/applicantscontainerpage.pt

    r6031 r6063  
    11<h2 tal:content="context/title">Title</h2>
    22
    3 <div tal:content="structure view/descriptionToHTML">
    4   Description
    5 </div>
     3<span tal:replace="structure view/widgets/description">Title</span>
     4
     5<br />
    66
    77<table class="zebra">
     
    1919      <tr>
    2020        <td class="fieldname">
    21           <tal:block content="python:widget.label"/>:
     21          <tal:block replace="python:widget.label"/>:
    2222        </td>
    2323        <td class="field">
    24           <input tal:replace="structure widget" />
     24          <tal:block tal:replace="structure widget" />
    2525        </td>
    2626      </tr>
Note: See TracChangeset for help on using the changeset viewer.