- Timestamp:
- 10 Jul 2022, 18:21:55 (2 years ago)
- Location:
- main/kofacustom.lpng/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.lpng/trunk/layout/theme.html
r17011 r17020 7 7 <meta name="description" content=""> 8 8 <meta name="author" content=""> 9 10 <meta property="og:title" content="Labour Party of Nigeria"> 11 <meta property="og:description" content="Membership Registration Portal"> 12 <meta property="og:image" content="https://lp-nigeria.com.ng/static_custom/labour-party-icon.png"> 13 <meta property="og:url" content="https://lp-nigeria.com.ng"> 14 <meta property="og:site_name" content="LPNG.Kofa"> 15 <meta property="og:type" content="website"> 9 16 10 17 <!-- stylesheets --> -
main/kofacustom.lpng/trunk/src/kofacustom/lpng/applicants/browser.py
r17019 r17020 20 20 import grok 21 21 from zope.formlib.textwidgets import BytesDisplayWidget 22 from zope.component import getUtility 23 from waeup.kofa.widgets.datewidget import ( 24 FriendlyDateDisplayWidget, 25 FriendlyDatetimeDisplayWidget) 22 26 from waeup.kofa.applicants.pdf import PDFApplicationSlip 23 27 from waeup.kofa.applicants.browser import ( … … 26 30 ApplicantManageFormPage, 27 31 ApplicantEditFormPage, 28 BalancePaymentAddFormPage) 29 32 BalancePaymentAddFormPage, 33 ExportPDFPaymentSlipPage, 34 ApplicantBaseDisplayFormPage) 35 from waeup.kofa.students.interfaces import IStudentsUtils 36 from waeup.kofa.applicants.interfaces import IApplicantOnlinePayment 37 from kofacustom.nigeria.applicants.interfaces import INigeriaApplicantOnlinePayment 38 from kofacustom.nigeria.applicants.browser import NigeriaExportPDFPaymentSlipPage 30 39 from kofacustom.lpng.applicants.interfaces import ( 31 40 ICustomApplicant, … … 33 42 ICustomApplicantEdit, 34 43 ) 35 36 44 from kofacustom.lpng.interfaces import MessageFactory as _ 37 45 … … 93 101 """ 94 102 grok.require('waeup.payApplicant') 103 104 class CustomApplicantBaseDisplayFormPage(ApplicantBaseDisplayFormPage): 95 105 106 @property 107 def form_fields(self): 108 form_fields = grok.AutoFields(ICustomApplicant).select( 109 'applicant_id', 'reg_number', 'email') 110 return form_fields 111 112 class CustomExportPDFPaymentSlipPage(NigeriaExportPDFPaymentSlipPage): 113 """Deliver a PDF slip of the context. 114 """ 115 # use IApplicantOnlinePayment alternativly 116 form_fields = grok.AutoFields(INigeriaApplicantOnlinePayment).omit( 117 'p_item').omit('p_option').omit('p_combi') 118 form_fields['creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 119 form_fields['payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 120 121 def render(self): 122 if self.payment_slip_download_warning: 123 self.flash(self.payment_slip_download_warning, type='danger') 124 self.redirect(self.url(self.context)) 125 return 126 applicantview = CustomApplicantBaseDisplayFormPage(self.context.__parent__, 127 self.request) 128 students_utils = getUtility(IStudentsUtils) 129 return students_utils.renderPDF(self,'payment_slip.pdf', 130 self.context.__parent__, applicantview, note=self.note, 131 omit_fields=())
Note: See TracChangeset for help on using the changeset viewer.