Ignore:
Timestamp:
14 May 2015, 13:11:55 (10 years ago)
Author:
Henrik Bettermann
Message:

Implement public page to view all (customizable) sources, vocabularies and dicts (work in progress).

File:
1 edited

Legend:

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

    r12919 r12932  
    5959    grok.name('widgets')
    6060
     61class SourcesLeft(grok.ViewletManager):
     62    grok.name('sources_left')
     63
     64class SourcesRight(grok.ViewletManager):
     65    grok.name('sources_right')
     66
    6167
    6268#
     
    853859            '<input class="text-right" type="submit" value="remove" />' + \
    854860            '</form></div>'
     861
     862class InstTypesSource(grok.Viewlet):
     863    """Avalable institution types for the sources overview page.
     864    """
     865    grok.order(1)
     866    grok.viewletmanager(SourcesLeft)
     867    grok.require('waeup.Public')
     868    grok.template('source')
     869    column = 'left'
     870    name = 'InstTypes'
     871    source_name = 'inst_types'
     872    title = _('Institution Types')
     873
     874    def heading(self):
     875        return 'heading%s' % self.name
     876
     877    def accordion(self):
     878        return '#accordion-%s' % self.column
     879
     880    def collapse(self):
     881        return 'collapse%s' % self.name
     882
     883    def hash_collapse(self):
     884        return '#collapse%s' % self.name
     885
     886    def source(self):
     887        return getattr(self.view, self.source_name)
     888
     889class SessionSource(InstTypesSource):
     890    """Avalable sessions for the sources overview page.
     891    """
     892    grok.order(2)
     893    name = 'Sessions'
     894    source_name = 'sessions'
     895    title = _('Academic Sessions')
     896
     897class StudyLevelSource(InstTypesSource):
     898    """Avalable study levels for the sources overview page.
     899    """
     900    grok.order(3)
     901    name = 'Levels'
     902    source_name = 'levels'
     903    title = _('Study Levels')
     904
     905class StudyModeSource(InstTypesSource):
     906    """Avalable study modes for the sources overview page.
     907    """
     908    grok.order(4)
     909    name = 'StudyModes'
     910    source_name = 'study_modes'
     911    title = _('Study Modes')
     912
     913class AppCatsSource(InstTypesSource):
     914    """Avalable application categories for the sources overview page.
     915    """
     916    grok.order(5)
     917    name = 'AppCats'
     918    source_name = 'app_cats'
     919    title = _('Application Categories')
     920
     921class StudentStatesSource(InstTypesSource):
     922    """Avalable student sates for the sources overview page.
     923    """
     924    grok.order(1)
     925    grok.viewletmanager(SourcesRight)
     926    column = 'right'
     927    name = 'StudentStates'
     928    source_name = 'student_states'
     929    title = _('Student Registration States')
     930
     931class VerdictsSource(InstTypesSource):
     932    """Avalable verdicts for the sources overview page.
     933    """
     934    grok.order(2)
     935    grok.viewletmanager(SourcesRight)
     936    column = 'right'
     937    name = 'Verdicts'
     938    source_name = 'verdicts'
     939    title = _('Verdicts')
     940
     941class PaymentCatsSource(InstTypesSource):
     942    """Avalable payment categories for the sources overview page.
     943    """
     944    grok.order(3)
     945    grok.viewletmanager(SourcesRight)
     946    column = 'right'
     947    name = 'PaymentCats'
     948    source_name = 'payment_cats'
     949    title = _('Payment Categories')
     950
     951class ExamSubjectsSource(InstTypesSource):
     952    """Avalable exam subjects for the sources overview page.
     953    """
     954    grok.order(4)
     955    grok.viewletmanager(SourcesRight)
     956    column = 'right'
     957    name = 'ExamSubjects'
     958    source_name = 'exam_subjects'
     959    title = _('Exam Subjects')
     960
     961class ExamGradesSource(InstTypesSource):
     962    """Avalable exam grades for the sources overview page.
     963    """
     964    grok.order(5)
     965    grok.viewletmanager(SourcesRight)
     966    column = 'right'
     967    name = 'ExamGrades'
     968    source_name = 'exam_grades'
     969    title = _('Exam Grades')
     970
Note: See TracChangeset for help on using the changeset viewer.