- Timestamp:
- 30 Jan 2014, 18:10:06 (11 years ago)
- Location:
- main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/students/browser.py
r11013 r11014 107 107 """Flash a lock message. 108 108 """ 109 view.flash(_('The requested form is locked (read-only).') )109 view.flash(_('The requested form is locked (read-only).'), type="warning") 110 110 view.redirect(view.url(view.context)) 111 111 return … … 155 155 view.flash(_( 156 156 'Total credits exceed ${a}.', 157 mapping = {'a': max_credits}) )157 mapping = {'a': max_credits}), type="warning") 158 158 return False 159 159 try: 160 160 view.context.addCourseTicket(ticket, course) 161 161 except KeyError: 162 view.flash(_('The ticket exists.') )162 view.flash(_('The ticket exists.'), type="warning") 163 163 return False 164 164 view.flash(_('Successfully added ${a}.', … … 279 279 else: 280 280 if 'search' in form: 281 self.flash(_('Empty search string') )281 self.flash(_('Empty search string'), type="warning") 282 282 return 283 283 if self.searchtype == 'current_session': … … 285 285 self.searchterm = int(self.searchterm) 286 286 except ValueError: 287 self.flash(_('Only year dates allowed (e.g. 2011).')) 287 self.flash(_('Only year dates allowed (e.g. 2011).'), 288 type="danger") 288 289 return 289 290 self.hitlist = search(query=self.searchterm, 290 291 searchtype=self.searchtype, view=self) 291 292 if not self.hitlist: 292 self.flash(_('No student found.') )293 self.flash(_('No student found.'), type="warning") 293 294 return 294 295 … … 321 322 else: 322 323 if 'search' in form: 323 self.flash(_('Empty search string') )324 self.flash(_('Empty search string'), type="warning") 324 325 return 325 326 if self.searchtype == 'current_session': … … 327 328 self.searchterm = int(self.searchterm) 328 329 except ValueError: 329 self.flash('Only year dates allowed (e.g. 2011).') 330 self.flash(_('Only year dates allowed (e.g. 2011).'), 331 type="danger") 330 332 return 331 333 if not 'entries' in form: … … 333 335 searchtype=self.searchtype, view=self) 334 336 if not self.hitlist: 335 self.flash(_('No student found.') )337 self.flash(_('No student found.'), type="warning") 336 338 if 'remove' in form: 337 self.flash(_('No item selected.') )339 self.flash(_('No item selected.'), type="warning") 338 340 return 339 341 entries = form['entries'] … … 493 495 self.flash(_('Your message has been sent.')) 494 496 else: 495 self.flash(_('An smtp server error occurred.') )497 self.flash(_('An smtp server error occurred.'), type="danger") 496 498 return 497 499 … … 534 536 def update(self): 535 537 datepicker.need() # Enable jQuery datepicker in date fields. 536 self.tab1 = self.tab2 = ''537 qs = self.request.get('QUERY_STRING', '')538 if not qs:539 qs = 'tab1'540 setattr(self, qs, 'active')541 538 super(StudentBaseManageFormPage, self).update() 542 539 self.wf_info = IWorkflowInfo(self.context) … … 552 549 errors = validator.validate_password(password, password_ctl) 553 550 if errors: 554 self.flash( ' '.join(errors) )551 self.flash( ' '.join(errors), type="danger") 555 552 return 556 553 changed_fields = self.applyData(self.context, **data) … … 763 760 def update(self): 764 761 datepicker.need() # Enable jQuery datepicker in date fields. 765 self.tab1 = self.tab2 = ''766 qs = self.request.get('QUERY_STRING', '')767 if not qs:768 qs = 'tab1'769 setattr(self, qs, 'active')770 762 return super(StudentClearanceManageFormPage, self).update() 771 763 … … 791 783 self.flash(_('Student has been cleared.')) 792 784 else: 793 self.flash(_('Student is in wrong state.') )785 self.flash(_('Student is in wrong state.'), type="warning") 794 786 self.redirect(self.url(self.context,'view_clearance')) 795 787 return … … 810 802 def update(self): 811 803 if clearance_disabled_message(self.context): 812 self.flash(clearance_disabled_message(self.context) )804 self.flash(clearance_disabled_message(self.context), type="warning") 813 805 self.redirect(self.url(self.context,'view_clearance')) 814 806 return … … 820 812 IWorkflowInfo(self.context).fireTransition('reset4') 821 813 message = _('Clearance has been annulled.') 822 self.flash(message )814 self.flash(message, type="warning") 823 815 elif self.context.state == REQUESTED: 824 816 IWorkflowInfo(self.context).fireTransition('reset3') 825 817 message = _('Clearance request has been rejected.') 826 self.flash(message )827 else: 828 self.flash(_('Student is in wrong state.') )818 self.flash(message, type="warning") 819 else: 820 self.flash(_('Student is in wrong state.'), type="warning") 829 821 self.redirect(self.url(self.context,'view_clearance')) 830 822 return … … 983 975 return 984 976 super(StudyCourseManageFormPage, self).update() 985 self.tab1 = self.tab2 = ''986 qs = self.request.get('QUERY_STRING', '')987 if not qs:988 qs = 'tab1'989 setattr(self, qs, 'active')990 977 warning.need() 991 978 return … … 997 984 except ConstraintNotSatisfied: 998 985 # The selected level might not exist in certificate 999 self.flash(_('Current level not available for certificate.')) 986 self.flash(_('Current level not available for certificate.'), 987 type="warning") 1000 988 return 1001 989 notify(grok.ObjectModifiedEvent(self.context.__parent__)) … … 1022 1010 level_session = self.request.form.get('level_session', None) 1023 1011 if not level_session: 1024 self.flash(_('You must select a session for the level.')) 1025 self.redirect(self.url(self.context, u'@@manage')+'?tab2') 1012 self.flash(_('You must select a session for the level.'), 1013 type="warning") 1014 self.redirect(self.url(self.context, u'@@manage')+'#tab2') 1026 1015 return 1027 1016 studylevel = createObject(u'waeup.StudentStudyLevel') … … 1033 1022 self.flash(_('Study level has been added.')) 1034 1023 except KeyError: 1035 self.flash(_('This level exists.') )1036 self.redirect(self.url(self.context, u'@@manage')+' ?tab2')1024 self.flash(_('This level exists.'), type="warning") 1025 self.redirect(self.url(self.context, u'@@manage')+'#tab2') 1037 1026 return 1038 1027 … … 1043 1032 child_id = form['val_id'] 1044 1033 else: 1045 self.flash(_('No study level selected.') )1046 self.redirect(self.url(self.context, '@@manage')+' ?tab2')1034 self.flash(_('No study level selected.'), type="warning") 1035 self.redirect(self.url(self.context, '@@manage')+'#tab2') 1047 1036 return 1048 1037 if not isinstance(child_id, list): … … 1057 1046 self.context.writeLogMessage( 1058 1047 self,'removed: %s' % ', '.join(deleted)) 1059 self.redirect(self.url(self.context, u'@@manage')+' ?tab2')1048 self.redirect(self.url(self.context, u'@@manage')+'#tab2') 1060 1049 return 1061 1050 … … 1076 1065 def update(self, SUBMIT=None): 1077 1066 super(StudentTranscriptRequestPage, self).update() 1078 self.tab1 = self.tab2 = ''1079 qs = self.request.get('QUERY_STRING', '')1080 if not qs:1081 qs = 'tab1'1082 setattr(self, qs, 'active')1083 1067 if not self.context.state == GRADUATED: 1084 self.flash(_("Wrong state") )1068 self.flash(_("Wrong state"), type="danger") 1085 1069 self.redirect(self.url(self.context)) 1086 1070 return … … 1099 1083 code = get_access_code(pin) 1100 1084 if not code: 1101 self.flash(_('Activation code is invalid.') )1085 self.flash(_('Activation code is invalid.'), type="warning") 1102 1086 return 1103 1087 if code.state == USED: 1104 self.flash(_('Activation code has already been used.')) 1088 self.flash(_('Activation code has already been used.'), 1089 type="warning") 1105 1090 return 1106 1091 # Mark pin as used (this also fires a pin related transition) … … 1110 1095 # expect an exception, but the owner might be different 1111 1096 if not invalidate_accesscode(pin, comment, self.context.student_id): 1112 self.flash(_('You are not the owner of this access code.')) 1097 self.flash(_('You are not the owner of this access code.'), 1098 type="warning") 1113 1099 return 1114 1100 self.context.clr_code = pin … … 1150 1136 def update(self, SUBMIT=None): 1151 1137 super(StudentTranscriptRequestProcessFormPage, self).update() 1152 self.tab1 = self.tab2 = ''1153 qs = self.request.get('QUERY_STRING', '')1154 if not qs:1155 qs = 'tab1'1156 setattr(self, qs, 'active')1157 1138 if self.context.state != TRANSCRIPT: 1158 self.flash(_('Student is in wrong state.') )1139 self.flash(_('Student is in wrong state.'), type="warning") 1159 1140 self.redirect(self.url(self.context)) 1160 1141 return … … 1214 1195 def update(self): 1215 1196 if not self.context.student.transcript_enabled: 1216 self.flash(_('You are not allowed to view the transcript.')) 1197 self.flash(_('You are not allowed to view the transcript.'), 1198 type="warning") 1217 1199 self.redirect(self.url(self.context)) 1218 1200 return … … 1247 1229 def update(self): 1248 1230 if not self.context.student.transcript_enabled: 1249 self.flash(_('You are not allowed to download the transcript.')) 1231 self.flash(_('You are not allowed to download the transcript.'), 1232 type="warning") 1250 1233 self.redirect(self.url(self.context)) 1251 1234 return … … 1320 1303 error = self.context.transfer(**data) 1321 1304 if error == -1: 1322 self.flash(_('Current level does not match certificate levels.')) 1305 self.flash(_('Current level does not match certificate levels.'), 1306 type="warning") 1323 1307 elif error == -2: 1324 self.flash(_('Former study course record incomplete.')) 1308 self.flash(_('Former study course record incomplete.'), 1309 type="warning") 1325 1310 elif error == -3: 1326 self.flash(_('Maximum number of transfers exceeded.')) 1311 self.flash(_('Maximum number of transfers exceeded.'), 1312 type="warning") 1327 1313 else: 1328 1314 self.flash(_('Successfully transferred.')) … … 1341 1327 warning.need() 1342 1328 if not self.context.has_key('studycourse_1'): 1343 self.flash(_('No previous transfer.') )1329 self.flash(_('No previous transfer.'), type="warning") 1344 1330 self.redirect(self.url(self.context)) 1345 1331 return … … 1484 1470 return 1485 1471 super(StudyLevelManageFormPage, self).update() 1486 self.tab1 = self.tab2 = ''1487 qs = self.request.get('QUERY_STRING', '')1488 if not qs:1489 qs = 'tab1'1490 setattr(self, qs, 'active')1491 1472 warning.need() 1492 1473 if ADD is not None: 1493 1474 if not course: 1494 self.flash(_('No valid course code entered.') )1495 self.redirect(self.url(self.context, u'@@manage')+' ?tab2')1475 self.flash(_('No valid course code entered.'), type="warning") 1476 self.redirect(self.url(self.context, u'@@manage')+'#tab2') 1496 1477 return 1497 1478 cat = queryUtility(ICatalog, name='courses_catalog') 1498 1479 result = cat.searchResults(code=(course, course)) 1499 1480 if len(result) != 1: 1500 self.flash(_('Course not found.') )1481 self.flash(_('Course not found.'), type="warning") 1501 1482 else: 1502 1483 course = list(result)[0] 1503 1484 addCourseTicket(self, course) 1504 self.redirect(self.url(self.context, u'@@manage')+' ?tab2')1485 self.redirect(self.url(self.context, u'@@manage')+'#tab2') 1505 1486 return 1506 1487 … … 1529 1510 child_id = form['val_id'] 1530 1511 else: 1531 self.flash(_('No ticket selected.') )1532 self.redirect(self.url(self.context, '@@manage')+' ?tab2')1512 self.flash(_('No ticket selected.'), type="warning") 1513 self.redirect(self.url(self.context, '@@manage')+'#tab2') 1533 1514 return 1534 1515 if not isinstance(child_id, list): … … 1544 1525 self,'removed: %s at %s' % 1545 1526 (', '.join(deleted), self.context.level)) 1546 self.redirect(self.url(self.context, u'@@manage')+' ?tab2')1527 self.redirect(self.url(self.context, u'@@manage')+'#tab2') 1547 1528 return 1548 1529 … … 1559 1540 return 1560 1541 if str(self.context.__parent__.current_level) != self.context.__name__: 1561 self.flash(_('This level does not correspond current level.')) 1542 self.flash(_('This level does not correspond current level.'), 1543 type="danger") 1562 1544 elif self.context.student.state == REGISTERED: 1563 1545 IWorkflowInfo(self.context.student).fireTransition( … … 1565 1547 self.flash(_('Course list has been validated.')) 1566 1548 else: 1567 self.flash(_('Student is in the wrong state.') )1549 self.flash(_('Student is in the wrong state.'), type="warning") 1568 1550 self.redirect(self.url(self.context)) 1569 1551 return … … 1584 1566 return 1585 1567 if str(self.context.__parent__.current_level) != self.context.__name__: 1586 self.flash(_('This level does not correspond current level.')) 1568 self.flash(_('This level does not correspond current level.'), 1569 type="danger") 1587 1570 self.redirect(self.url(self.context)) 1588 1571 return … … 1596 1579 self.flash(message) 1597 1580 else: 1598 self.flash(_('Student is in the wrong state.') )1581 self.flash(_('Student is in the wrong state.'), type="warning") 1599 1582 self.redirect(self.url(self.context)) 1600 1583 return … … 1624 1607 return 1625 1608 1626 @action(_('Add course ticket') )1609 @action(_('Add course ticket'), style='primary') 1627 1610 def addCourseTicket(self, **data): 1628 1611 course = data['course'] 1629 1612 success = addCourseTicket(self, course) 1630 1613 if success: 1631 self.redirect(self.url(self.context, u'@@manage')+' ?tab2')1614 self.redirect(self.url(self.context, u'@@manage')+'#tab2') 1632 1615 return 1633 1616 … … 1720 1703 child_id = form['val_id'] 1721 1704 else: 1722 self.flash(_('No payment selected.') )1705 self.flash(_('No payment selected.'), type="warning") 1723 1706 self.redirect(self.url(self.context)) 1724 1707 return … … 1772 1755 self.flash( 1773 1756 _('Your current session does not match ' + \ 1774 'accommodation session.') )1757 'accommodation session.'), type="danger") 1775 1758 return 1776 1759 if 'maintenance' in p_category: 1777 1760 current_session = str(student['studycourse'].current_session) 1778 1761 if not current_session in student['accommodation']: 1779 self.flash(_('You have not yet booked accommodation.')) 1762 self.flash(_('You have not yet booked accommodation.'), 1763 type="warning") 1780 1764 return 1781 1765 students_utils = getUtility(IStudentsUtils) … … 1783 1767 p_category, student, previous_session, previous_level) 1784 1768 if error is not None: 1785 self.flash(error )1769 self.flash(error, type="danger") 1786 1770 return 1787 1771 self.context[payment.p_id] = payment … … 1806 1790 def update(self): 1807 1791 if self.context.student.before_payment: 1808 self.flash(_("No previous payment to be made.") )1792 self.flash(_("No previous payment to be made."), type="warning") 1809 1793 self.redirect(self.url(self.context)) 1810 1794 super(PreviousPaymentAddFormPage, self).update() … … 1821 1805 p_category, student, previous_session, previous_level) 1822 1806 if error is not None: 1823 self.flash(error )1807 self.flash(error, type="danger") 1824 1808 return 1825 1809 self.context[payment.p_id] = payment … … 1854 1838 balance_level, balance_amount) 1855 1839 if error is not None: 1856 self.flash(error )1840 self.flash(error, type="danger") 1857 1841 return 1858 1842 self.context[payment.p_id] = payment … … 1986 1970 def delBedTickets(self, **data): 1987 1971 if getattr(self.request.principal, 'user_type', None) == 'student': 1988 self.flash(_('You are not allowed to remove bed tickets.')) 1972 self.flash(_('You are not allowed to remove bed tickets.'), 1973 type="warning") 1989 1974 self.redirect(self.url(self.context)) 1990 1975 return … … 1993 1978 child_id = form['val_id'] 1994 1979 else: 1995 self.flash(_('No bed ticket selected.') )1980 self.flash(_('No bed ticket selected.'), type="warning") 1996 1981 self.redirect(self.url(self.context)) 1997 1982 return … … 2045 2030 enddate, tz).strftime("%d/%m/%Y %H:%M:%S") 2046 2031 self.flash(_("Outside booking period: ${a} - ${b}", 2047 mapping = {'a': startdate, 'b': enddate}) )2032 mapping = {'a': startdate, 'b': enddate}), type="warning") 2048 2033 else: 2049 self.flash(_("Outside booking period.") )2034 self.flash(_("Outside booking period."), type="warning") 2050 2035 self.redirect(self.url(self.context)) 2051 2036 return 2052 2037 if not acc_details: 2053 self.flash(_("Your data are incomplete.") )2038 self.flash(_("Your data are incomplete."), type="warning") 2054 2039 self.redirect(self.url(self.context)) 2055 2040 return 2056 2041 if not student.state in acc_details['allowed_states']: 2057 self.flash(_("You are in the wrong registration state.")) 2042 self.flash(_("You are in the wrong registration state."), 2043 type="warning") 2058 2044 self.redirect(self.url(self.context)) 2059 2045 return … … 2061 2047 'booking_session']: 2062 2048 self.flash( 2063 _('Your current session does not match accommodation session.')) 2049 _('Your current session does not match accommodation session.'), 2050 type="warning") 2064 2051 self.redirect(self.url(self.context)) 2065 2052 return … … 2067 2054 self.flash( 2068 2055 _('You already booked a bed space in current ' \ 2069 + 'accommodation session.') )2056 + 'accommodation session.'), type="warning") 2070 2057 self.redirect(self.url(self.context)) 2071 2058 return … … 2079 2066 code = get_access_code(pin) 2080 2067 if not code: 2081 self.flash(_('Activation code is invalid.') )2068 self.flash(_('Activation code is invalid.'), type="warning") 2082 2069 return 2083 2070 # Search and book bed … … 2091 2078 # XXX: Can be remove if nobody complains. 2092 2079 if bed.__parent__.__parent__ is None: 2093 self.flash(_('System error: Please contact the adminsitrator.')) 2080 self.flash(_('System error: Please contact the adminsitrator.'), 2081 type="danger") 2094 2082 self.context.writeLogMessage(self, 'fatal error: %s' % bed.bed_id) 2095 2083 return … … 2106 2094 # XXX: Can be remove if nobody complains. 2107 2095 if bed.__parent__.__parent__ is None: 2108 self.flash(_('System error: Please contact the adminsitrator.')) 2096 self.flash(_('System error: Please contact the adminsitrator.'), 2097 type="warning") 2109 2098 self.context.writeLogMessage(self, 'fatal error: %s' % bed.bed_id) 2110 2099 return … … 2112 2101 else: 2113 2102 self.flash(_('There is no free bed in your category ${a}.', 2114 mapping = {'a':acc_details['bt']}) )2103 mapping = {'a':acc_details['bt']}), type="warning") 2115 2104 return 2116 2105 if self.with_ac: 2117 2106 # Mark pin as used (this also fires a pin related transition) 2118 2107 if code.state == USED: 2119 self.flash(_('Activation code has already been used.')) 2108 self.flash(_('Activation code has already been used.'), 2109 type="warning") 2120 2110 return 2121 2111 else: … … 2125 2115 if not invalidate_accesscode( 2126 2116 pin,comment,self.context.student.student_id): 2127 self.flash(_('You are not the owner of this access code.')) 2117 self.flash(_('You are not the owner of this access code.'), 2118 type="warning") 2128 2119 return 2129 2120 # Create bed ticket … … 2219 2210 if self.context.bed != None and \ 2220 2211 'reserved' in self.context.bed.bed_type: 2221 self.flash(_("Students in reserved beds can't be relocated.")) 2212 self.flash(_("Students in reserved beds can't be relocated."), 2213 type="warning") 2222 2214 self.redirect(self.url(self.context)) 2223 2215 return … … 2225 2217 self.context.bed != None and \ 2226 2218 self.context.bed.bed_type == self.context.bed_type: 2227 self.flash(_("Student can't be relocated.") )2219 self.flash(_("Student can't be relocated."), type="warning") 2228 2220 self.redirect(self.url(self.context)) 2229 2221 return … … 2248 2240 else: 2249 2241 self.flash(_('There is no free bed in your category ${a}.', 2250 mapping = {'a':acc_details['bt']}) )2242 mapping = {'a':acc_details['bt']}), type="warning") 2251 2243 self.redirect(self.url(self.context)) 2252 2244 return … … 2331 2323 self.flash(_('Password changed.')) 2332 2324 else: 2333 self.flash( ' '.join(errors) )2325 self.flash( ' '.join(errors), type="warning") 2334 2326 return 2335 2327 … … 2379 2371 def update(self, SUBMIT=None): 2380 2372 if not self.context.state == ADMITTED: 2381 self.flash(_("Wrong state") )2373 self.flash(_("Wrong state"), type="warning") 2382 2374 self.redirect(self.url(self.context)) 2383 2375 return 2384 2376 if not self.portrait_uploaded: 2385 self.flash(_("No portrait uploaded.") )2377 self.flash(_("No portrait uploaded."), type="warning") 2386 2378 self.redirect(self.url(self.context, 'change_portrait')) 2387 2379 return 2388 2380 if not self.all_required_fields_filled: 2389 self.flash(_("Not all required fields filled.") )2381 self.flash(_("Not all required fields filled."), type="warning") 2390 2382 self.redirect(self.url(self.context, 'edit_base')) 2391 2383 return … … 2399 2391 code = get_access_code(pin) 2400 2392 if not code: 2401 self.flash(_('Activation code is invalid.') )2393 self.flash(_('Activation code is invalid.'), type="warning") 2402 2394 return 2403 2395 if code.state == USED: 2404 self.flash(_('Activation code has already been used.')) 2396 self.flash(_('Activation code has already been used.'), 2397 type="warning") 2405 2398 return 2406 2399 # Mark pin as used (this also fires a pin related transition) … … 2410 2403 # expect an exception, but the owner might be different 2411 2404 if not invalidate_accesscode(pin, comment, self.context.student_id): 2412 self.flash(_('You are not the owner of this access code.')) 2405 self.flash(_('You are not the owner of this access code.'), 2406 type="warning") 2413 2407 return 2414 2408 self.context.clr_code = pin … … 2457 2451 self.applyData(self.context, **data) 2458 2452 if self.dataNotComplete(): 2459 self.flash(self.dataNotComplete() )2453 self.flash(self.dataNotComplete(), type="warning") 2460 2454 return 2461 2455 self.flash(_('Clearance form has been saved.')) … … 2470 2464 # This shouldn't happen, but the application officer 2471 2465 # might have forgotten to lock the form after changing the state 2472 self.flash(_('This form cannot be submitted. Wrong state!')) 2466 self.flash(_('This form cannot be submitted. Wrong state!'), 2467 type="danger") 2473 2468 return 2474 2469 IWorkflowInfo(self.context).fireTransition('request_clearance') … … 2498 2493 pin = '%s-%s-%s' % (self.ac_prefix, self.ac_series, self.ac_number) 2499 2494 if self.context.clr_code and self.context.clr_code != pin: 2500 self.flash(_("This isn't your CLR access code.") )2495 self.flash(_("This isn't your CLR access code."), type="danger") 2501 2496 return 2502 2497 state = IWorkflowState(self.context).getState() … … 2504 2499 # This shouldn't happen, but the application officer 2505 2500 # might have forgotten to lock the form after changing the state 2506 self.flash(_('This form cannot be submitted. Wrong state!')) 2501 self.flash(_('This form cannot be submitted. Wrong state!'), 2502 type="danger") 2507 2503 return 2508 2504 IWorkflowInfo(self.context).fireTransition('request_clearance') … … 2529 2525 super(StartSessionPage, self).update() 2530 2526 if not self.context.next_session_allowed: 2531 self.flash(_("You are not entitled to start session.")) 2527 self.flash(_("You are not entitled to start session."), 2528 type="warning") 2532 2529 self.redirect(self.url(self.context)) 2533 2530 return … … 2541 2538 code = get_access_code(pin) 2542 2539 if not code: 2543 self.flash(_('Activation code is invalid.') )2540 self.flash(_('Activation code is invalid.'), type="warning") 2544 2541 return 2545 2542 # Mark pin as used (this also fires a pin related transition) 2546 2543 if code.state == USED: 2547 self.flash(_('Activation code has already been used.')) 2544 self.flash(_('Activation code has already been used.'), 2545 type="warning") 2548 2546 return 2549 2547 else: … … 2553 2551 if not invalidate_accesscode( 2554 2552 pin,comment,self.context.student.student_id): 2555 self.flash(_('You are not the owner of this access code.')) 2553 self.flash(_('You are not the owner of this access code.'), 2554 type="warning") 2556 2555 return 2557 2556 try: … … 2566 2565 'pay_pg_fee') 2567 2566 except ConstraintNotSatisfied: 2568 self.flash(_('An error occurred, please contact the system administrator.')) 2567 self.flash(_('An error occurred, please contact the system administrator.'), 2568 type="danger") 2569 2569 return 2570 2570 self.flash(_('Session started.')) … … 2608 2608 self.context.certificate,studylevel) 2609 2609 except KeyError: 2610 self.flash(_('This level exists.') )2610 self.flash(_('This level exists.'), type="warning") 2611 2611 except RequiredMissing: 2612 self.flash(_('Your data are incomplete') )2612 self.flash(_('Your data are incomplete'), type="warning") 2613 2613 self.redirect(self.url(self.context)) 2614 2614 return … … 2637 2637 if ADD is not None: 2638 2638 if not course: 2639 self.flash(_('No valid course code entered.') )2639 self.flash(_('No valid course code entered.'), type="warning") 2640 2640 return 2641 2641 cat = queryUtility(ICatalog, name='courses_catalog') 2642 2642 result = cat.searchResults(code=(course, course)) 2643 2643 if len(result) != 1: 2644 self.flash(_('Course not found.') )2644 self.flash(_('Course not found.'), type="warning") 2645 2645 return 2646 2646 course = list(result)[0] … … 2666 2666 child_id = form['val_id'] 2667 2667 else: 2668 self.flash(_('No ticket selected.') )2668 self.flash(_('No ticket selected.'), type="warning") 2669 2669 self.redirect(self.url(self.context, '@@edit')) 2670 2670 return … … 2697 2697 self.flash(_( 2698 2698 "You are a postgraduate student, " 2699 "your course list can't bee registered.") )2699 "your course list can't bee registered."), type="warning") 2700 2700 self.redirect(self.url(self.context)) 2701 2701 return … … 2704 2704 if self.context.total_credits > max_credits: 2705 2705 self.flash(_('Maximum credits of ${a} exceeded.', 2706 mapping = {'a':max_credits}) )2706 mapping = {'a':max_credits}), type="warning") 2707 2707 return 2708 2708 IWorkflowInfo(self.context.student).fireTransition( … … 2763 2763 searchtype='reg_number', view=self) 2764 2764 if not hitlist: 2765 self.flash(_('No student found.') )2765 self.flash(_('No student found.'), type="warning") 2766 2766 return 2767 2767 if len(hitlist) != 1: # Cannot happen but anyway 2768 self.flash(_('More than one student found.') )2768 self.flash(_('More than one student found.'), type="warning") 2769 2769 return 2770 2770 student = hitlist[0].context … … 2774 2774 code = get_access_code(pin) 2775 2775 if not code: 2776 self.flash(_('Access code is invalid.') )2776 self.flash(_('Access code is invalid.'), type="warning") 2777 2777 return 2778 2778 if student_pw and pin == student.adm_code: … … 2784 2784 self.flash( 2785 2785 _('Password has already been set. You are using the ' + 2786 'wrong Access Code.') )2786 'wrong Access Code.'), type="warning") 2787 2787 return 2788 2788 # Mark pin as used (this also fires a pin related transition) 2789 2789 # and set student password 2790 2790 if code.state == USED: 2791 self.flash(_('Access code has already been used.') )2791 self.flash(_('Access code has already been used.'), type="warning") 2792 2792 return 2793 2793 else: … … 2847 2847 student = results[0] 2848 2848 if getattr(student,'firstname',None) is None: 2849 self.flash(_('An error occurred.') )2849 self.flash(_('An error occurred.'), type="danger") 2850 2850 return 2851 2851 elif student.firstname.lower() != firstname.lower(): … … 2853 2853 # know that a record was found and only the firstname 2854 2854 # verification failed. 2855 self.flash(_('No student record found.') )2855 self.flash(_('No student record found.'), type="warning") 2856 2856 return 2857 2857 elif student.password is not None and self._pw_used: 2858 2858 self.flash(_('Your password has already been set and used. ' 2859 'Please proceed to the login page.')) 2859 'Please proceed to the login page.'), 2860 type="warning") 2860 2861 return 2861 2862 # Store email address but nothing else. … … 2864 2865 else: 2865 2866 # No record found, this is the truth. 2866 self.flash(_('No student record found.') )2867 self.flash(_('No student record found.'), type="warning") 2867 2868 return 2868 2869 … … 2974 2975 self.hitlist = self._searchCatalog(self.session, self.level) 2975 2976 if not self.hitlist: 2976 self.flash(_('No student found.') )2977 self.flash(_('No student found.'), type="warning") 2977 2978 return 2978 2979 … … 3059 3060 'configuration'].current_academic_session 3060 3061 if self.context.__parent__.__parent__.score_editing_disabled: 3061 self.flash(_('Score editing disabled.') )3062 self.flash(_('Score editing disabled.'), type="warning") 3062 3063 self.redirect(self.url(self.context)) 3063 3064 return 3064 3065 if not self.current_academic_session: 3065 self.flash(_('Current academic session not set.') )3066 self.flash(_('Current academic session not set.'), type="warning") 3066 3067 self.redirect(self.url(self.context)) 3067 3068 return … … 3070 3071 ticket for ticket in self.tickets if ticket.editable_by_lecturer] 3071 3072 if not self.tickets: 3072 self.flash(_('No student found.') )3073 self.flash(_('No student found.'), type="warning") 3073 3074 self.redirect(self.url(self.context)) 3074 3075 return … … 3100 3101 if error: 3101 3102 self.flash(_('Error: Score(s) of %s have not be updated. ' 3102 'Only integers are allowed.' % error.strip(', '))) 3103 'Only integers are allowed.' % error.strip(', ')), 3104 type="danger") 3103 3105 return 3104 3106 -
main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/students/browser_templates/transcriptprocess.pt
r10459 r11014 1 1 <form method="POST" i18n:domain="waeup.kofa"> 2 2 3 <ul class="tabs" data-tabs="tabs"> 4 <li tal:attributes="class view/tab1"><a href="#tab-1"> 5 <span i18n:translate="">Process request</span></a></li> 6 <li tal:attributes="class view/tab2"><a href="#tab-2"> 7 <span i18n:translate="">View correspondence</span></a></li> 3 <ul class="tabs nav nav-tabs" data-tabs="tabs"> 4 <li class="active"> 5 <a href="#tab1" data-toggle="tab"> 6 <span i18n:translate="">Process request</span> 7 </a> 8 </li> 9 <li> 10 <a href="#tab2" data-toggle="tab"> 11 <span i18n:translate="">View correspondence</span> 12 </a> 13 </li> 8 14 </ul> 9 15 10 16 <div class="tab-content"> 11 <div id="tab -1" tal:attributes="class view/tab1">17 <div id="tab1" class="active tab-pane"> 12 18 13 19 <table class="form-table"> … … 32 38 </div> 33 39 34 <div id="tab -2" tal:attributes="class view/tab2">40 <div id="tab2" class="tab-pane"> 35 41 <p tal:content="structure view/correspondence"></p> 36 42 </div> -
main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/students/browser_templates/transcriptrequest.pt
r10472 r11014 1 1 <form method="POST" i18n:domain="waeup.kofa"> 2 2 3 <ul class="tabs" data-tabs="tabs"> 4 <li tal:attributes="class view/tab1"><a href="#tab-1"> 5 <span i18n:translate="">Send new request</span></a></li> 6 <li tal:attributes="class view/tab2"><a href="#tab-2"> 7 <span i18n:translate="">View correspondence</span></a></li> 3 <ul class="tabs nav nav-tabs" data-tabs="tabs"> 4 <li class="active"> 5 <a href="#tab1" data-toggle="tab"> 6 <span i18n:translate="">Send new request</span> 7 </a></li> 8 <li> 9 <a href="#tab2" data-toggle="tab"> 10 <span i18n:translate="">View correspondence</span> 11 </a> 12 </li> 8 13 </ul> 9 14 10 15 <div class="tab-content"> 11 <div id="tab -1" tal:attributes="class view/tab1">16 <div id="tab1" class="active tab-pane"> 12 17 13 18 <p i18n:translate="transcript_request"></p> … … 65 70 </div> 66 71 67 <div id="tab -2" tal:attributes="class view/tab2">72 <div id="tab2" class="tab-pane"> 68 73 <p tal:content="structure view/correspondence"></p> 69 74 </div>
Note: See TracChangeset for help on using the changeset viewer.