- Timestamp:
- 18 Feb 2016, 11:52:18 (9 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r13702 r13711 4 4 1.4.2.dev0 (unreleased) 5 5 ======================= 6 7 * Add `flash_notice` field. 6 8 7 9 * Documentation updates. -
main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_browser.py
r13495 r13711 411 411 self.assertEqual(self.browser.contents, 412 412 'adm_code,clr_code,date_of_birth,email,' 413 'employer,firstname, lastname,matric_number,middlename,'413 'employer,firstname,flash_notice,lastname,matric_number,middlename,' 414 414 'nationality,officer_comment,perm_address,personal_updated,' 415 415 'phone,reg_number,sex,student_id,suspended,suspended_comment,' -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r13610 r13711 414 414 grok.template('basepage') 415 415 form_fields = grok.AutoFields(IStudentBase).omit( 416 'password', 'suspended', 'suspended_comment' )416 'password', 'suspended', 'suspended_comment', 'flash_notice') 417 417 pnav = 4 418 418 … … 430 430 return _('set') 431 431 return _('unset') 432 433 def update(self): 434 if self.context.flash_notice: 435 self.flash(self.context.flash_notice, type="warning") 436 super(StudentBaseDisplayFormPage, self).update() 437 return 432 438 433 439 class StudentBasePDFFormPage(KofaDisplayFormPage): … … 492 498 prefix = 'form' 493 499 494 omit_fields = ('date_of_birth', 'current_level' )500 omit_fields = ('date_of_birth', 'current_level', 'flash_notice') 495 501 496 502 form_fields = grok.AutoFields(IStudentBase).select('student_id', 'reg_number') … … 664 670 'suspended', 'phone', 665 671 'adm_code', 'suspended_comment', 666 'date_of_birth', 'current_level') 672 'date_of_birth', 'current_level', 673 'flash_notice') 667 674 668 675 @property … … 1206 1213 'department', 'faculty', 'current_mode', 'entry_session', 'certificate', 1207 1214 'password', 'suspended', 'phone', 'email', 1208 'adm_code', 'suspended_comment', 'current_level' )1215 'adm_code', 'suspended_comment', 'current_level', 'flash_notice') 1209 1216 1210 1217 def update(self): … … 1356 1363 omit_fields = ( 1357 1364 'password', 'suspended', 'phone', 'date_of_birth', 1358 'adm_code', 'sex', 'suspended_comment', 'current_level') 1365 'adm_code', 'sex', 'suspended_comment', 'current_level', 1366 'flash_notice') 1359 1367 1360 1368 @property … … 1919 1927 omit_fields = ( 1920 1928 'password', 'suspended', 'phone', 'date_of_birth', 1921 'adm_code', 'sex', 'suspended_comment', 'current_level') 1929 'adm_code', 'sex', 'suspended_comment', 'current_level', 1930 'flash_notice') 1922 1931 1923 1932 @property … … 2203 2212 omit_fields = ( 2204 2213 'password', 'suspended', 'phone', 'adm_code', 2205 'suspended_comment', 'date_of_birth', 'current_level') 2214 'suspended_comment', 'date_of_birth', 'current_level', 2215 'flash_notice') 2206 2216 2207 2217 @property -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r13457 r13711 198 198 ) 199 199 200 flash_notice = schema.TextLine( 201 title = _(u'Flash Notice'), 202 required = False, 203 readonly = False, 204 description = _( 205 u'This single-line message will be shown in a flash box.'), 206 ) 207 200 208 student_id = schema.TextLine( 201 209 title = _(u'Student Id'), -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r13700 r13711 544 544 # Only the Application Slip does not exist 545 545 self.assertFalse('Application Slip' in self.browser.contents) 546 return 547 548 def test_flash_notice(self): 549 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 550 self.browser.open(self.student_path) 551 self.assertFalse('alert alert-warning' in self.browser.contents) 552 self.student.flash_notice = u'Happy Birthday!' 553 self.browser.open(self.student_path) 554 self.assertTrue( 555 '<div><div class="alert alert-warning">Happy Birthday!</div>' 556 in self.browser.contents) 546 557 return 547 558 … … 3522 3533 self.assertTrue( 3523 3534 'adm_code,clr_code,date_of_birth,email,employer,' 3524 'firstname, lastname,matric_number,middlename,nationality,'3535 'firstname,flash_notice,lastname,matric_number,middlename,nationality,' 3525 3536 'officer_comment,perm_address,personal_updated,phone,reg_number,' 3526 3537 'sex,student_id,suspended,suspended_comment,transcript_comment,' 3527 3538 'password,state,history,certcode,is_postgrad,current_level,' 3528 3539 'current_session\r\n' 3529 ',,1981-02-04#,aa@aa.ng,,Anna, Tester,234,,,,,,'3540 ',,1981-02-04#,aa@aa.ng,,Anna,,Tester,234,,,,,,' 3530 3541 '1234#,123,m,K1000000,0,,,{SSHA}' in self.browser.contents) 3531 3542 … … 3622 3633 self.assertTrue( 3623 3634 'adm_code,clr_code,date_of_birth,email,employer,' 3624 'firstname, lastname,matric_number,middlename,nationality,'3635 'firstname,flash_notice,lastname,matric_number,middlename,nationality,' 3625 3636 'officer_comment,perm_address,personal_updated,phone,reg_number,' 3626 3637 'sex,student_id,suspended,suspended_comment,transcript_comment,' 3627 3638 'password,state,history,certcode,is_postgrad,current_level,' 3628 3639 'current_session\r\n' 3629 ',,1981-02-04#,aa@aa.ng,,Anna, Tester,234,,,,,,'3640 ',,1981-02-04#,aa@aa.ng,,Anna,,Tester,234,,,,,,' 3630 3641 '1234#,123,m,K1000000,0,,,{SSHA}' in self.browser.contents) 3631 3642 self.assertEqual(len(self.app['datacenter'].running_exports), 1) -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r13641 r13711 126 126 std_csv_entry = ( 127 127 'my adm code,my clr code,1981-02-04#,anna@sample.com,,' 128 'Anna, Tester,234,M.,NG,,"Studentroad 21\nLagos 123456\n",,'128 'Anna,,Tester,234,M.,NG,,"Studentroad 21\nLagos 123456\n",,' 129 129 '+234-123-12345#,123,f,A111111,0,,,,created' 130 130 ) … … 157 157 self.assertTrue( 158 158 'adm_code,clr_code,date_of_birth,email,' 159 'employer,firstname, lastname,matric_number,middlename,'159 'employer,firstname,flash_notice,lastname,matric_number,middlename,' 160 160 'nationality,officer_comment,perm_address,personal_updated,' 161 161 'phone,reg_number,sex,student_id,suspended,suspended_comment,' … … 163 163 'current_level,current_session\r\n' 164 164 'my adm code,my clr code,' 165 '1981-02-04#,anna@sample.com,,Anna, Tester,234,M.,NG,,'165 '1981-02-04#,anna@sample.com,,Anna,,Tester,234,M.,NG,,' 166 166 '"Studentroad 21\nLagos 123456\n",,+234-123-12345#,123,f,' 167 167 'A111111,0,,,,created' … … 179 179 self.assertTrue( 180 180 'adm_code,clr_code,date_of_birth,email,' 181 'employer,firstname, lastname,matric_number,middlename,'181 'employer,firstname,flash_notice,lastname,matric_number,middlename,' 182 182 'nationality,officer_comment,perm_address,personal_updated,' 183 183 'phone,reg_number,sex,student_id,suspended,suspended_comment,' … … 185 185 'is_postgrad,current_level,current_session\r\n' 186 186 'my adm code,my clr code,1981-02-04#,anna@sample.com,,' 187 'Anna, Tester,234,M.,NG,,"Studentroad 21\nLagos 123456\n"'187 'Anna,,Tester,234,M.,NG,,"Studentroad 21\nLagos 123456\n"' 188 188 ',,+234-123-12345#,123,f,A111111,0,,,,created' 189 189 in result … … 199 199 self.assertTrue( 200 200 'adm_code,clr_code,date_of_birth,email,' 201 'employer,firstname, lastname,matric_number,middlename,'201 'employer,firstname,flash_notice,lastname,matric_number,middlename,' 202 202 'nationality,officer_comment,perm_address,personal_updated,' 203 203 'phone,reg_number,sex,student_id,suspended,suspended_comment,' … … 205 205 'is_postgrad,current_level,current_session\r\n' 206 206 'my adm code,my clr code,1981-02-04#,anna@sample.com,,' 207 'Anna, Tester,234,M.,NG,,"Studentroad 21\nLagos 123456\n"'207 'Anna,,Tester,234,M.,NG,,"Studentroad 21\nLagos 123456\n"' 208 208 ',,+234-123-12345#,123,f,A111111,0,,,,created' 209 209 in result
Note: See TracChangeset for help on using the changeset viewer.