Ignore:
Timestamp:
26 Apr 2018, 08:50:56 (7 years ago)
Author:
Henrik Bettermann
Message:

Allow lecturer role assignment also at department level.

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

Legend:

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

    r14939 r14992  
    6161    IPasswordValidator, IContactForm, IKofaUtils, ICSVExporter,
    6262    academic_sessions_vocab, DOCLINK, registration_states_vocab)
     63from waeup.kofa.university.department import Department
     64from waeup.kofa.university.course import Course
    6365from waeup.kofa.permissions import (
    6466    get_users_with_local_roles, get_all_roles, get_all_users,
     
    10111013    @property
    10121014    def getCourses(self):
     1015        courses = []
    10131016        local_roles = get_user_account(self.request).getLocalRoles()
    1014         return local_roles['waeup.local.Lecturer']
     1017        for item in local_roles.get('waeup.local.Lecturer', []):
     1018            if isinstance(item, Course):
     1019                courses.append(item)
     1020            elif isinstance(item, Department):
     1021                courses += [i for i in item.courses.values()]
     1022        return courses
    10151023
    10161024#
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/mycourses.pt

    r13908 r14992  
    55<div tal:repeat="course view/getCourses">
    66    <a tal:attributes="href python:view.url(course)">
    7       <span tal:content="course/title">ROLE</span>
    8       (<span tal:content="course/code">ROLE</span>)
     7      <span tal:content="python:course.__parent__.__parent__.__parent__.code">FAC</span> /
     8      <span tal:content="python:course.__parent__.__parent__.code">DEP</span> /
     9      <span tal:content="course/longtitle">COURSE</span>
    910    </a>
    1011</div>
Note: See TracChangeset for help on using the changeset viewer.