Ignore:
Timestamp:
23 Mar 2017, 04:02:34 (8 years ago)
Author:
Henrik Bettermann
Message:

Omit course_category column from tables if categories are not defined.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/browser
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/layout.py

    r13513 r14646  
    307307            return None         
    308308
     309    @property
     310    def course_cat_used(self):
     311        if len(getUtility(IKofaUtils).COURSE_CATEGORY_DICT):
     312            return True
     313        return False
     314
    309315    def render(self):
    310316        if self.isStudent() or self.isApplicant() or not self.isAuthenticated():
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py

    r14645 r14646  
    25612561    @property
    25622562    def course_category_title(self):
    2563         return getUtility(IKofaUtils).COURSE_CATEGORY_DICT[
    2564             self.context.course_category]
     2563        cc = self.context.course_category
     2564        if cc:
     2565            return getUtility(IKofaUtils).COURSE_CATEGORY_DICT[cc]
     2566        return
    25652567
    25662568class CertificateCourseManageFormPage(KofaEditFormPage):
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/certificatecoursepage.pt

    r14645 r14646  
    2727      <td tal:content="view/leveltitle">LEVEL</td>
    2828    </tr>
    29     <tr>
     29    <tr tal:condition="layout/course_cat_used">
    3030      <td i18n:translate="">Course Category:</td>
    3131      <td tal:content="view/course_category_title">NONE</td>
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/certificatemanagepage.pt

    r14264 r14646  
    4141            <th i18n:translate="">Dep. Course</th>
    4242            <th i18n:translate="">Title</th>
     43            <th i18n:translate="" tal:condition="layout/course_cat_used">Course Cat.</th>
    4344            <th i18n:translate="">Required</th>
    4445          </tr>
     
    7172              <span tal:content="cc/course/title">
    7273                COURSE TITLE
     74              </span>
     75            </td>
     76            <td tal:condition="layout/course_cat_used">
     77              <span tal:content="cc/course_category">
     78                   COURSE CAT
    7379              </span>
    7480            </td>
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/certificatepage.pt

    r11254 r14646  
    3131    <th i18n:translate="">Dep. Course</th>
    3232    <th i18n:translate="">Title</th>
     33    <th i18n:translate="" tal:condition="layout/course_cat_used">Course Cat.</th>
    3334    <th i18n:translate="">Required</th>
    3435  </tr>
     
    5859      </span>
    5960    </td>
     61    <td tal:condition="layout/course_cat_used">
     62      <span tal:content="cc/course_category">
     63           COURSE CAT
     64      </span>
     65    </td>
    6066    <td>
    6167      <span tal:content="cc/mandatory">
Note: See TracChangeset for help on using the changeset viewer.