source: main/kofacustom.pcn/trunk/src/kofacustom/pcn/applicants/browser.py @ 11843

Last change on this file since 11843 was 11843, checked in by Henrik Bettermann, 10 years ago

Adjust registration forms. Add localization.

  • Property svn:keywords set to Id
File size: 2.8 KB
Line 
1## $Id: browser.py 11843 2014-10-14 17:45:38Z henrik $
2##
3## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18"""UI components for basic applicants and related components.
19"""
20import grok
21from waeup.kofa.applicants.browser import (
22    ApplicantRegistrationPage,
23    ApplicantsContainerPage,
24    ApplicantDisplayFormPage,
25    ApplicantManageFormPage,
26    ApplicantEditFormPage)
27from waeup.kofa.applicants.viewlets import (
28    StudentCreateActionButton,
29    ApplicantsRootCreateStudentsActionButton,
30    )
31from kofacustom.pcn.applicants.interfaces import (
32    ICustomApplicant, ICustomApplicantEdit)
33from kofacustom.pcn.interfaces import MessageFactory as _
34
35class StudentCreateActionButton(StudentCreateActionButton):
36
37    @property
38    def target_url(self):
39        """Get a URL to the target...
40        """
41        return
42
43class ApplicantsRootCreateStudentsActionButton(ApplicantsRootCreateStudentsActionButton):
44
45    @property
46    def target_url(self):
47        """Get a URL to the target...
48        """
49        return
50
51class CustomApplicantDisplayFormPage(ApplicantDisplayFormPage):
52    """A display view for applicant data.
53    """
54    grok.template('applicantdisplaypage')
55
56    @property
57    def form_fields(self):
58        form_fields = grok.AutoFields(ICustomApplicant).omit(
59            'locked', 'course_admitted', 'password', 'suspended')
60        return form_fields
61
62class CustomApplicantManageFormPage(ApplicantManageFormPage):
63    """A full edit view for applicant data.
64    """
65    grok.template('applicanteditpage')
66
67    @property
68    def form_fields(self):
69        form_fields = grok.AutoFields(ICustomApplicant)
70        form_fields['applicant_id'].for_display = True
71        return form_fields
72
73class CustomApplicantEditFormPage(ApplicantEditFormPage):
74    """An applicant-centered edit view for applicant data.
75    """
76    grok.template('applicanteditpage')
77
78    @property
79    def form_fields(self):
80        form_fields = grok.AutoFields(ICustomApplicantEdit).omit(
81            'locked', 'course_admitted',
82            'suspended'
83            )
84        form_fields['applicant_id'].for_display = True
85        form_fields['reg_number'].for_display = True
86        return form_fields
Note: See TracBrowser for help on using the repository browser.