Changeset 4717


Ignore:
Timestamp:
8 Jan 2010, 00:37:33 (15 years ago)
Author:
uli
Message:
  • Fix some permissions.
  • Add department index page.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-layout/src/waeup/browser/pages.py

    r4713 r4717  
    55import os
    66import sys
     7from hurry import yui
    78from hurry.query import Eq
    89from hurry.query.query import Query, Text
     
    344345    """
    345346    grok.context(IFacultyContainer)
     347    grok.require('waeup.View')
    346348    grok.name('index')
    347349    title = 'Faculties'
     
    426428    """
    427429    grok.context(IFaculty)
     430    grok.require('waeup.View')
    428431    grok.name('index')
    429432    pnav = 1
     
    483486        self.redirect(self.url(self.context))
    484487        return
     488
     489#
     490# Department pages
     491#
     492class DepartmentPage(WAeUPPage):
     493    grok.context(IDepartment)
     494    grok.require('waeup.View')
     495    grok.name('index')
     496    pnav = 1
     497
     498    @property
     499    def title(self):
     500        return "%s (%s)" % (getName(self.context), self.context.code)
     501   
     502    def update(self):
     503        yui.tabview.need()
     504
     505        if 'delcourse' in self.request.form:
     506            code = self.request.form['code']
     507            del self.context.courses[code]
     508        if 'delcert' in self.request.form:
     509            code = self.request.form['code']
     510            del self.context.certificates[code]
     511        self.tables = ITableProvider(self.context).getTables(view=self)
     512        self.coursetable = self.tables[0]
     513        self.certificatetable = self.tables[1]
     514        self.coursetable.need()
Note: See TracChangeset for help on using the changeset viewer.