Changeset 5987


Ignore:
Timestamp:
26 Apr 2011, 20:14:36 (14 years ago)
Author:
Henrik Bettermann
Message:

Derive CertificatePage? from WAeUPDisplayFormPage instead of WAeUPPage.

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

Legend:

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

    r5977 r5987  
    11591159# Certificate pages
    11601160#
    1161 class CertificatePage(WAeUPPage):
     1161class CertificatePage(WAeUPDisplayFormPage):
    11621162    """Index page for certificates.
    11631163    """
     
    11661166    grok.require('waeup.View')
    11671167    pnav = 1
     1168    form_fields = grok.AutoFields(ICertificate)
    11681169
    11691170    @property
    11701171    def title(self):
    11711172        return "Certificate: %s (%s)" % (self.context.title, self.context.code)
    1172 
     1173       
    11731174    def update(self):
    11741175        if 'delcourse' in self.request.form:
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/certificatepage.pt

    r5977 r5987  
    22
    33<table class="zebra">
    4   <thead>
    5   </thead>
    6   <tbody>
     4<thead>
     5</thead> 
     6<tbody>
     7  <tal:block repeat="widget view/widgets">
    78    <tr>
    8       <td>Code:</td>
    9       <td tal:content="context/__name__">CODE</td>
    10     </tr>   
    11     <tr>
    12       <td>Title:</td>
    13       <td tal:content="context/title">THE TITLE</td>
     9      <td tal:define="hint widget/hint">
     10        <label tal:condition="python:hint"
     11               tal:attributes="for widget/name">
     12          <span i18n:translate=""
     13                         tal:content="widget/label">label</span>
     14        </label>
     15        <label tal:condition="python:not hint"
     16               tal:attributes="for widget/name">
     17          <span i18n:translate=""
     18                         tal:content="widget/label">label</span>
     19        </label>
     20      </td>
     21      <td class="field">
     22        <div class="widget" tal:content="structure widget">
     23          <input type="text" />
     24        </div>
     25        <div class="error" tal:condition="widget/error">
     26          <span tal:replace="structure widget/error">error</span>
     27        </div>
     28      </td>
    1429    </tr>
    15     <tr>
    16       <td>Start Level:</td>
    17       <td tal:content="context/start_level">START_LEVEL</td>
    18     </tr>
    19     <tr>
    20       <td>End Level:</td>
    21       <td tal:content="context/end_level">END_LEVEL</td>
    22     </tr>
    23     <tr>
    24       <td>Study Mode:</td>
    25       <td tal:content="context/study_mode">STUDY_MODE</td>
    26     </tr>
    27     <tr>
    28       <td>Application Category:</td>
    29       <td tal:content="context/application_category">APPLICATION_CATEGORY</td>
    30     </tr>   
    31   </tbody>
     30  </tal:block>
     31</tbody>
    3232</table>
    3333
    3434<h3><span tal:content="context/__name__">Code</span> Course Referrers</h3>
    3535
    36     <table class="zebra">
    37       <thead>
    38         <tr>
    39           <th>Course Referrer</th>
    40           <th>Course</th>
    41           <th>Title</th>
    42           <th>Level</th>
    43           <th>Semester</th>
    44           <th>Mandatory</th>
    45           <th>&nbsp;</th>
    46         </tr>     
    47       </thead>   
    48       <tbody>
    49       <span tal:omit-tag="" tal:repeat="level python: sorted(view.getCourseList().items())">
    50       <span tal:omit-tag="" tal:repeat="semester python: sorted(level[1].items())">
    51       <tr tal:repeat="courseref python:semester[1]">
    52         <td> <a href="" tal:attributes="href courseref/url" tal:content="courseref/code">courseref code</a></td>
    53         <td> <a href="" tal:attributes="href courseref/course_url" tal:content="courseref/course/code">course code</a></td>
    54         <td tal:content="courseref/title">title</td>
    55         <td tal:content="python:level[0]">level</td>
    56         <td tal:content="python:semester[0]">semester</td>
    57         <td tal:content="courseref/mandatory">mandatory</td>
    58         <td>
    59             <form method="POST">
    60               <input type="hidden" name="code"
    61                  value="" tal:attributes="value courseref/course/code" />
    62               <input type="hidden" name="level"
    63                  value="" tal:attributes="value python:level[0]" />
    64               <input type="submit" name="delcourse" value="delete" />
    65              </form>       
    66         </td>
    67       </tr>
    68       </span>
    69       </span>
    70       </tbody>
    71     </table>
     36<table class="zebra">
     37  <thead>
     38    <tr>
     39      <th>Course Referrer</th>
     40      <th>Course</th>
     41      <th>Title</th>
     42      <th>Level</th>
     43      <th>Semester</th>
     44      <th>Mandatory</th>
     45      <th>&nbsp;</th>
     46    </tr>     
     47  </thead>   
     48  <tbody>
     49  <span tal:omit-tag="" tal:repeat="level python: sorted(view.getCourseList().items())">
     50  <span tal:omit-tag="" tal:repeat="semester python: sorted(level[1].items())">
     51  <tr tal:repeat="courseref python:semester[1]">
     52    <td> <a href="" tal:attributes="href courseref/url" tal:content="courseref/code">courseref code</a></td>
     53    <td> <a href="" tal:attributes="href courseref/course_url" tal:content="courseref/course/code">course code</a></td>
     54    <td tal:content="courseref/title">title</td>
     55    <td tal:content="python:level[0]">level</td>
     56    <td tal:content="python:semester[0]">semester</td>
     57    <td tal:content="courseref/mandatory">mandatory</td>
     58    <td>
     59        <form method="POST">
     60          <input type="hidden" name="code"
     61                 value="" tal:attributes="value courseref/course/code" />
     62          <input type="hidden" name="level"
     63                 value="" tal:attributes="value python:level[0]" />
     64          <input type="submit" name="delcourse" value="delete" />
     65         </form>       
     66    </td>
     67  </tr>
     68  </span>
     69  </span>
     70  </tbody>
     71</table>
    7272
Note: See TracChangeset for help on using the changeset viewer.