Changeset 16906 for main/waeup.uniben
- Timestamp:
- 25 Mar 2022, 12:12:29 (3 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/browser/pdf.py
r15425 r16906 28 28 """ 29 29 30 header_logo_path = os.path.join(31 os.path.dirname(__file__), 'static', 'pdf_logo.jpg')32 watermark_path = os.path.join(33 os.path.dirname(__file__), 'static', 'pdf_watermark.jpg')34 35 30 watermark_pos = [-25, 100] 36 31 logo_pos = [507, 720, 40] 37 32 33 header_logo_path = os.path.join( 34 os.path.dirname(__file__), 'static', 'pdf_logo.jpg') 35 36 @property 37 def watermark_path(self): 38 if self.view and self.view.__name__ == 'transcript.pdf': 39 usertype = getattr(self.view.request.principal, 'user_type', None) 40 if usertype and usertype == 'student': 41 self.watermark_pos = [95, 190] 42 return os.path.join( 43 os.path.dirname(__file__), 'static', 'pdf_stud_only.jpg') 44 return os.path.join( 45 os.path.dirname(__file__), 'static', 'pdf_watermark.jpg') 38 46 39 47 class CustomLandscapePDFCreator(LandscapePDFCreator): -
main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py
r16797 r16906 40 40 PaymentsManageFormPage, 41 41 StartClearancePage, 42 StudentFilesUploadPage) 42 StudentFilesUploadPage, 43 StudyCourseTranscriptPage) 43 44 from waeup.kofa.students.workflow import (CREATED, ADMITTED, PAID, 44 45 CLEARANCE, REQUESTED, RETURNING, CLEARED, REGISTERED, VALIDATED, … … 704 705 return 705 706 707 class CustomStudyCourseTranscriptPage(StudyCourseTranscriptPage): 708 """ Page to display the student's transcript. 709 """ 710 grok.require('waeup.viewStudent') 711 706 712 class CustomExportPDFTranscriptSlip(ExportPDFTranscriptSlip): 707 713 """Deliver a PDF slip of the context. 708 714 """ 715 grok.require('waeup.viewStudent') 709 716 710 717 def _sigsInFooter(self): -
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r16458 r16906 1009 1009 self.assertEqual(td[0][1]['tickets_1'][0].code, 'ANYCODE') 1010 1010 self.assertEqual(td[1], 3.5652173913043477) 1011 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 1011 self.browser.open(self.login_path) 1012 self.browser.getControl(name="form.login").value = self.student_id 1013 self.browser.getControl(name="form.password").value = 'spwd' 1014 self.browser.getControl("Login").click() 1012 1015 self.browser.open(self.student_path + '/studycourse/transcript') 1013 1016 self.assertEqual(self.browser.headers['Status'], '200 Ok') -
main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py
r16873 r16906 645 645 pdf_stream = creator.create_pdf( 646 646 data, None, doc_title, author=author, footer=footer_text, 647 note=note, sigs_in_footer=sigs_in_footer, topMargin=topMargin) 647 note=note, sigs_in_footer=sigs_in_footer, topMargin=topMargin, 648 view=view) 648 649 except IOError: 649 650 view.flash(_('Error in image file.')) -
main/waeup.uniben/trunk/src/waeup/uniben/students/viewlets.py
r16808 r16906 29 29 StudentBaseDisplayFormPage, OnlinePaymentDisplayFormPage) 30 30 from waeup.kofa.students.viewlets import ( 31 RequestTranscriptActionButton, StudentPassportActionButton) 31 RequestTranscriptActionButton, StudentPassportActionButton, 32 TranscriptSlipActionButton, 33 StudyCourseTranscriptActionButton) 32 34 33 35 from waeup.uniben.students.interfaces import ( … … 44 46 def target_url(self): 45 47 return '' 48 49 class TranscriptSlipActionButton(TranscriptSlipActionButton): 50 grok.require('waeup.viewStudent') 51 52 class StudyCourseTranscriptActionButton(StudyCourseTranscriptActionButton): 53 grok.require('waeup.viewStudent') 46 54 47 55 class StudentPassportActionButton(StudentPassportActionButton):
Note: See TracChangeset for help on using the changeset viewer.