Changeset 6008


Ignore:
Timestamp:
2 May 2011, 09:21:22 (14 years ago)
Author:
Henrik Bettermann
Message:

Provide longtitle for all university instances. Use lontitle in breadcrumbs. Show faculty and department on certificatecoursepage.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
8 edited

Legend:

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

    r5988 r6008  
    127127    """
    128128    grok.context(interfaces.IDepartment)
     129   
     130class CourseBreadcrumb(FacultyBreadcrumb):
     131    """A breadcrumb for courses.
     132    """
     133    grok.context(interfaces.ICourse)   
     134   
     135class CertificateBreadcrumb(FacultyBreadcrumb):
     136    """A breadcrumb for certificates.
     137    """
     138    grok.context(interfaces.ICertificate)       
    129139
    130140class CourseContainerBreadcrumb(Breadcrumb):
     
    146156    @property
    147157    def title(self):
    148         return self.context.course.title
     158        return self.context.longtitle()
    149159
    150160def getBreadcrumb(obj, viewname=None):
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt

    r6007 r6008  
    693693  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    694694  ...<td>Level:</td>
    695   ...<td>200</td>
     695  ...<td>200 (Year 2)</td>
    696696  ...
    697697
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py

    r6007 r6008  
    4343from waeup.sirp.university.catalog import search
    4444from waeup.sirp.widgets.interfaces import ITableProvider
     45from waeup.sirp.university.vocabularies import course_levels
    4546
    4647grok.context(IWAeUPObject)
     
    15131514    @property
    15141515    def title(self):
    1515         return 'Course Referrer: %s' % (self.context.__name__)
     1516        return 'Course Referrer: %s' % (self.context.longtitle())
     1517   
     1518    @property   
     1519    def leveltitle(self):
     1520        return course_levels.getTerm(self.context.level).title
    15161521
    15171522class CertificateCourseManageFormPage(WAeUPEditFormPage):
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/certificatecoursepage.pt

    r5977 r6008  
    1 <h2 tal:content="context/__name__">TITLE</h2>
     1<h2 tal:content="context/longtitle">TITLE</h2>
    22
    3 <table class="listing">
     3<table class="zebra">
    44  <thead>
    55  </thead>
    66  <tbody>
    7     <tr class="odd">
     7    <tr>
    88      <td>Code:</td>
    99      <td tal:content="context/__name__">CODE</td>
    1010    </tr> 
    11     <tr class="even">
     11    <tr>
    1212      <td>Course Code:</td>
    1313      <td tal:content="context/getCourseCode">THE COURSE</td>
    1414    </tr>   
    15     <tr class="even">
     15    <tr>
    1616      <td>Course Title:</td>
    1717      <td tal:content="context/course/title">THE TITLE</td>
    1818    </tr>
    19     <tr class="odd">
     19    <tr>
     20      <td>Provided by:</td>
     21      <td>
     22      <span tal:content="python: context.course.__parent__.__parent__.longtitle()">DEPARTMENT</span>
     23      <br />
     24      <span tal:content="python: context.course.__parent__.__parent__.__parent__.longtitle()">FACULTY</span>
     25      </td>
     26    </tr>   
     27    <tr>
    2028      <td>Level:</td>
    21       <td tal:content="context/level">LEVEL</td>
     29      <td tal:content="view/leveltitle">LEVEL</td>
    2230    </tr>
    23     <tr class="even">
     31    <tr>
    2432      <td>Is mandatory course (not elective):</td>
    2533      <td tal:content="context/core_or_elective">MANDATORY</td>
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/certificatepage.pt

    r6007 r6008  
    1 <h2 tal:content="context/title">TITLE</h2>
     1<h2 tal:content="context/longtitle">TITLE</h2>
    22
    33<table class="zebra">
  • main/waeup.sirp/trunk/src/waeup/sirp/university/certificate.py

    r5977 r6008  
    1313from waeup.sirp.university.interfaces import (
    1414    ICertificate, ICertificateAdd, ICertificateCourse, ICourse)
     15from waeup.sirp.university.vocabularies import course_levels   
    1516
    1617class Certificate(grok.Container):
     
    5657
    5758    #review_state = property(getReviewState, setReviewState)
     59   
     60    def longtitle(self):
     61        return "%s (%s)" % (self.title,self.code) 
    5862   
    5963    def addCourseRef(self, course, level=100, core_or_elective=True):
     
    105109        """
    106110        return self.course.code
     111       
     112    def longtitle(self):
     113        return "%s in level %s" % (self.course.code,
     114                   course_levels.getTerm(self.level).title)   
    107115   
    108116class CertificateCourseFactory(grok.GlobalUtility):
  • main/waeup.sirp/trunk/src/waeup/sirp/university/course.py

    r5953 r6008  
    2424        self.semester = semester
    2525       
     26    def longtitle(self):
     27        return "%s (%s)" % (self.title,self.code)       
     28       
    2629class CourseFactory(grok.GlobalUtility):
    2730    """A factory for courses.
  • main/waeup.sirp/trunk/src/waeup/sirp/university/interfaces.py

    r5995 r6008  
    154154        required = True,
    155155        )
     156       
     157    def longtitle():
     158        """
     159        Returns the long title of a course.
     160        """       
    156161
    157162class ICourseAdd(ICourse):
     
    221226        )   
    222227
     228    def longtitle():
     229        """
     230        Returns the long title of a certificate.
     231        """       
     232
    223233class ICertificateAdd(ICertificate):
    224234    """Representation of a certificate.
     
    273283        """
    274284       
     285    def longtitle():
     286        """
     287        Returns the long title of a certificatecourse.
     288        """         
     289       
    275290       
    276291class ICertificateCourseAdd(ICertificateCourse):
Note: See TracChangeset for help on using the changeset viewer.