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
Files:
1 added
3 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>
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/static/waeup-base.css

    r6061 r6063  
    3131}
    3232
    33 /* Define different styles for headlines in rendered restrucrured text */
    34 
    35 #h1 h1 {
     33/* Define different styles for headlines in rendered restructured text */
     34
     35#rest h1 {
    3636  font-size:130%;
    3737}
    3838
    39 #h2 h2 {
     39#rest h2 {
    4040  font-size:100%;
    4141}
    4242
    43 #h3 h3 {
     43#rest h3 {
    4444  font-size:100%;
    4545}
    4646
    4747
    48 #h4 h4 {
     48#rest h4 {
    4949  font-size:100%;
    5050}
Note: See TracChangeset for help on using the changeset viewer.