Changeset 6806 for main/waeup.sirp/trunk/src
- Timestamp:
- 20 Sep 2011, 14:11:34 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/static/waeup-base.css
r6716 r6806 70 70 71 71 .studentmenu { 72 text-align: center;72 text-align: right; 73 73 line-height: 2; 74 74 } -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r6803 r6806 486 486 target = 'manage' 487 487 488 class AddStudyLevelActionButton(AddActionButton): 489 grok.order(1) 490 grok.context(IStudentStudyCourse) 491 grok.view(StudyCourseDisplayFormPage) 492 grok.require('waeup.handleStudent') 493 text = 'Add course list' 494 target = 'add' 495 496 @property 497 def target_url(self): 498 student = self.view.context.getStudent() 499 condition1 = student.state != 'school fee paid' 500 condition2 = str(student['studycourse'].current_level) in \ 501 self.view.context.keys() 502 if condition1 or condition2: 503 return '' 504 return self.view.url(self.view.context, self.target) 505 488 506 class StudyCourseManageFormPage(WAeUPEditFormPage): 489 507 """ Page to edit the student study course data … … 1002 1020 self.redirect(self.url(self.context)) 1003 1021 return 1022 1023 class AddStudyLevelFormPage(WAeUPEditFormPage): 1024 """ Page for students to add current study levels 1025 """ 1026 grok.context(IStudentStudyCourse) 1027 grok.name('add') 1028 grok.require('waeup.handleStudent') 1029 grok.template('studyleveladdpage') 1030 form_fields = grok.AutoFields(IStudentStudyCourse) 1031 title = 'Study Course' 1032 pnav = 4 1033 1034 @property 1035 def label(self): 1036 studylevelsource = StudyLevelSource().factory 1037 code = self.context.current_level 1038 title = studylevelsource.getTitle(self.context, code) 1039 return 'Add current level %s' % title 1040 1041 def emitLockMessage(self): 1042 self.flash('The requested form is locked (read-only).') 1043 self.redirect(self.url(self.context)) 1044 return 1045 1046 def update(self): 1047 if self.context.getStudent().state != 'school fee paid': 1048 self.emitLockMessage() 1049 return 1050 super(AddStudyLevelFormPage, self).update() 1051 return 1052 1053 @grok.action('Create course list now') 1054 def addStudyLevel(self, **data): 1055 studylevel = StudentStudyLevel() 1056 studylevel.level = self.context.current_level 1057 studylevel.level_session = self.context.current_session 1058 try: 1059 self.context.addStudentStudyLevel( 1060 self.context.certificate,studylevel) 1061 except KeyError: 1062 self.flash('This level exists.') 1063 self.redirect(self.url(self.context)) 1064 return -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studycoursepage.pt
r6775 r6806 44 44 45 45 <div tal:condition="python: not len(context.keys())"> 46 There no levels registered yet.46 There are no levels registered yet. 47 47 </div> -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studylevelmanagepage.pt
r6802 r6806 69 69 <th>Mandatory</th> 70 70 <th>Score</th> 71 <th>Auto matic</th>71 <th>Auto</th> 72 72 </tr> 73 73 </thead> … … 87 87 <td tal:content="value/core_or_elective">MANDATORY</td> 88 88 <td tal:content="value/score">SCORE</td> 89 <td tal:content="value/automatic">AUTO MATIC</td>89 <td tal:content="value/automatic">AUTO</td> 90 90 </tr> 91 91 </tbody> -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studylevelpage.pt
r6803 r6806 43 43 <th>Mandatory</th> 44 44 <th>Score</th> 45 <th>Auto matic</th>45 <th>Auto</th> 46 46 </tr> 47 47 </thead> … … 57 57 <td tal:content="value/core_or_elective">MANDATORY</td> 58 58 <td tal:content="value/score">SCORE</td> 59 <td tal:content="value/automatic">AUTO MATIC</td>59 <td tal:content="value/automatic">AUTO</td> 60 60 </tr> 61 61 </tbody> -
main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
r6805 r6806 238 238 faculty = Attribute('faculty of the original course') 239 239 department = Attribute('department of the original course') 240 automatic = Attribute('automatical creation of ticket')241 240 242 241 core_or_elective = schema.Bool( … … 254 253 ) 255 254 255 automatic = schema.Bool( 256 title = u'Automatical Creation', 257 default = False, 258 required = False, 259 readonly = True, 260 ) 261 256 262 class ICourseTicketAdd(ICourseTicket): 257 263 """An interface for adding course tickets -
main/waeup.sirp/trunk/src/waeup/sirp/students/studylevel.py
r6802 r6806 74 74 super(CourseTicket, self).__init__() 75 75 self.code = None 76 self.automatic = None77 76 self.title = None 78 77 self.faculty = None
Note: See TracChangeset for help on using the changeset viewer.