Changeset 6029 for main/waeup.sirp/trunk


Ignore:
Timestamp:
6 May 2011, 07:16:31 (13 years ago)
Author:
Henrik Bettermann
Message:

Use WAuPDisplayFormPage for ApplicantsContainerPage?.

Fix traceback if description field is empty.

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

Legend:

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

    r6015 r6029  
    226226        return self.view.application_url('applicants')
    227227
    228 class ApplicantsContainerPage(WAeUPPage):
     228class ApplicantsContainerPage(WAeUPDisplayFormPage):
    229229    """The standard view for regular applicant containers.
    230230    """
    231231    grok.context(IApplicantsContainer)
    232232    grok.name('index')
     233    grok.template('applicantscontainerpage')
    233234    pnav = 3
    234235   
     
    243244
    244245    def descriptionToHTML(self):
    245         return ReST2HTML(self.context.description)
     246        if self.context.description:
     247            return ReST2HTML(self.context.description)
     248        else:
     249            return
    246250
    247251class ManageApplicantsContainerActionButton(ManageActionButton):
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/applicantscontainerpage.pt

    r5863 r6029  
    1 <div>
     1<h2>
    22  <span tal:content="context/title">Title</span>
    3 </div>
     3</h2>
     4
    45<div tal:content="structure view/descriptionToHTML">
    56  Description
    67</div>
     8
     9<table class="zebra">
     10  <tbody>
     11    <tal:block repeat="widget view/widgets">
     12      <tal:condition condition="python:widget.name not in ['form.description','form.title']">
     13      <tr>
     14        <td class="fieldname">
     15          <tal:block content="python:widget.label"/>:
     16        </td>
     17        <td class="field">
     18          <input tal:replace="structure widget" />
     19        </td>
     20      </tr>
     21      </tal:condition>
     22    </tal:block>
     23  </tbody>
     24</table>
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py

    r5980 r6029  
    104104    """
    105105    title = schema.TextLine(
    106         title = u'Short description of the type of applicants stored here.',
     106        title = u'Title of the type of applicants stored here.',
    107107        required = True,
    108108        default = u'Untitled',
Note: See TracChangeset for help on using the changeset viewer.