- Timestamp:
- 11 Aug 2024, 19:29:13 (5 months ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py
r17880 r17885 1167 1167 grok.require('waeup.uploadStudentFile') 1168 1168 grok.template('affidavituploadpage') 1169 label = _('Upload affidavit of good behavior')1169 label = _('Upload affidavit of good conduct') 1170 1170 deletion_warning = _('Are you sure?') 1171 1171 pnav = 4 1172 1173 class ExportPDFAffidavitSlip(UtilityView, grok.View): 1174 """Deliver a affidavit PDF template. 1175 """ 1176 grok.context(ICustomStudent) 1177 grok.name('affidavit_good_conduct.pdf') 1178 grok.require('waeup.viewStudent') 1179 prefix = 'form' 1180 1181 omit_fields = ('date_of_birth', 'current_level', 'certificate', 1182 'current_mode', 'entry_session') 1183 1184 form_fields = grok.AutoFields(ICustomStudentBase).select('student_id', 'matric_number') 1185 1186 pre_text = ' ' 1187 1188 post_text = ''' 1189 To undertake as follows: 1190 1191 (i) to abide by the arrangement(s) put in place by the University Management for the 1192 supply, distribution and utilization of electricity on the campuses of the 1193 University of Benin; 1194 1195 (ii) to pay outstanding school charges upon resumption as eligibility for examinations 1196 will henceforth be strictly based on presentation of evidence of payment of approved 1197 school charges; 1198 1199 (iii) not to bring any prohibited appliances, such as hot plate, ring boiler, 1200 gas cooker etc into the Halls of Residence, as violation of this rule shall attract 1201 rustication of such a Student; 1202 1203 (iv) not to be involved in any unruly conduct that is against the Rules and 1204 Regulations of the University; and 1205 1206 (v) to be of good conduct, and not to sponsor or participate in any unauthorized 1207 assembly or demonstration within the campuses and their precincts. 1208 1209 1210 1211 1212 1213 ________________________________ 1214 Student Signature 1215 1216 ''' 1217 1218 @property 1219 def label(self): 1220 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 1221 return 'Affidavit of Undertaking to be of Good Conduct' 1222 1223 def render(self): 1224 students_utils = getUtility(IStudentsUtils) 1225 letterhead_path = os.path.join( 1226 os.path.dirname(__file__), 'static', 'letterhead.jpg') 1227 if not os.path.exists(letterhead_path): 1228 letterhead_path = None 1229 return students_utils.renderPDFAdmissionLetter(self, 1230 self.context.student, omit_fields=self.omit_fields, 1231 letterhead_path=letterhead_path, 1232 pre_text=self.pre_text, post_text=self.post_text) -
main/waeup.uniben/trunk/src/waeup/uniben/students/browser_templates/affidavituploadpage.pt
r17883 r17885 1 1 <form action="." tal:attributes="action request/URL" method="post" 2 2 enctype="multipart/form-data" i18n:domain="waeup.kofa"> 3 <p></p> 3 <p>Download your personal 'Affidavit of Good Conduct' form, 4 scan the signed form into a pdf file and re-upload here.</p> 4 5 <table class="form-table"> 5 6 <tbody> -
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r17845 r17885 1298 1298 print "Sample PDF fee_payment_history.pdf written to %s" % path 1299 1299 return 1300 1301 def test_affidavit_slip(self): 1302 self.browser.open(self.login_path) 1303 self.browser.getControl(name="form.login").value = self.student_id 1304 self.browser.getControl(name="form.password").value = 'spwd' 1305 self.browser.getControl("Login").click() 1306 self.browser.getLink("Base Data").click() 1307 self.browser.getLink("Upload affidavit of good conduct").click() 1308 self.browser.getLink("Download affidavit of good conduct form").click() 1309 self.assertEqual(self.browser.headers['Status'], '200 Ok') 1310 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 1311 path = os.path.join(samples_dir(), 'affidavit_good_conduct.pdf') 1312 open(path, 'wb').write(self.browser.contents) 1313 print "Sample PDF affidavit_good_conduct.pdf written to %s" % path -
main/waeup.uniben/trunk/src/waeup/uniben/students/viewlets.py
r17881 r17885 39 39 40 40 from waeup.uniben.students.browser import ( 41 StudentMedicalHistoryEditFormPage, StudentAffidavitUploadPage) 41 StudentMedicalHistoryEditFormPage, StudentAffidavitUploadPage, 42 StudentAffidavitUploadPage) 42 43 43 44 from kofacustom.nigeria.interfaces import MessageFactory as _ … … 271 272 grok.require('waeup.handleStudent') 272 273 icon = 'actionicon_signature.png' 273 text = _('Upload affidavit of good behavior')274 text = _('Upload affidavit of good conduct') 274 275 target = 'affidavit_upload' 275 276 … … 281 282 grok.view(StudentBaseDisplayFormPage) 282 283 grok.require('waeup.viewStudent') 283 label = _(u'Scanned Affidavit of Good Behavior')284 label = _(u'Scanned Affidavit of Good Conduct') 284 285 download_name = u'affidavit.pdf' 286 287 class AffidavitSlipActionButton(ManageActionButton): 288 grok.order(1) 289 grok.context(ICustomStudent) 290 grok.view(StudentAffidavitUploadPage) 291 grok.require('waeup.viewStudent') 292 icon = 'actionicon_pdf.png' 293 text = _('Download affidavit of good conduct form') 294 target = 'affidavit_good_conduct.pdf' 285 295 286 296 class AffidavitUploadManage(StudentFileUpload): … … 291 301 grok.view(StudentBaseManageFormPage) 292 302 grok.require('waeup.manageStudent') 293 label = _(u'Scanned Affidavit of Good Behavior(pdf only)')303 label = _(u'Scanned Affidavit of Good Conduct (pdf only)') 294 304 download_name = u'affidavit.pdf' 295 305 296 306 class AffidavitUploadEdit(AffidavitUploadManage): 297 """Affidavit of Good Behaviorupload viewlet for students.307 """Affidavit of Good Conduct upload viewlet for students. 298 308 """ 299 309 grok.view(StudentAffidavitUploadPage) 300 310 grok.require('waeup.uploadStudentFile') 301 311 302 class AffidavitGood Behavior(StudentImage):312 class AffidavitGoodConduct(StudentImage): 303 313 """Renders pdf slip. 304 314 """
Note: See TracChangeset for help on using the changeset viewer.