Ignore:
Timestamp:
10 Aug 2024, 07:01:52 (5 months ago)
Author:
Henrik Bettermann
Message:

Add an id to download filenames if necessary. Enable this feature for Final Year Clearance Routing Slip.

Location:
main/waeup.kofa/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r17867 r17877  
    441.8.2.dev0 (unreleased)
    55=======================
     6
     7* Add an id to download filenames if necessary. Enable this feature for
     8  Final Year Clearance Routing Slip.
    69
    710* Implement Final Year Clearance Routing Slip upload (not active in base package).
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/fileviewlets.py

    r12448 r17877  
    179179
    180180    @property
     181    def add_id(self):
     182        return
     183
     184    @property
    181185    def download_filename(self):
     186        if self.add_id:
     187            return self.download_name + '_%s' % self.add_id
    182188        return self.download_name
    183189
  • main/waeup.kofa/trunk/src/waeup/kofa/students/fileviewlets.py

    r17867 r17877  
    164164    grok.require('waeup.viewStudent')
    165165    label = _(u'Scanned Final Clearance Routing Slip ')
    166     download_name = u'routingslip'
    167 
     166    download_name = u'routingslip.pdf'
    168167
    169168class FinalClearanceUploadManage(StudentFileUpload):
     
    174173    grok.view(StudentBaseManageFormPage)
    175174    grok.require('waeup.manageStudent')
    176     label = _(u'Scanned Final Clearance Routing Slip (pdf preferred)')
    177     download_name = u'routingslip'
     175    label = _(u'Scanned Final Clearance Routing Slip (pdf only)')
     176    download_name = u'routingslip.pdf'
    178177
    179178class FinalClearanceUploadEdit(FinalClearanceUploadManage):
     
    223222    """Renders pdf slip.
    224223    """
    225     grok.name('routingslip')
     224    grok.name('routingslip.pdf')
    226225    download_name = u'routingslip'
     226
     227    @property
     228    def add_id(self):
     229        return self.context.student_id
    227230
    228231class ApplicationSlipImage(StudentImage):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r17867 r17877  
    719719        self.browser.getControl(
    720720            name='upload_finalclearanceuploadmanage').click()
    721         self.assertTrue(
    722             'href="http://localhost/app/students/K1000000/routingslip"'
     721        print self.browser.contents
     722        self.assertTrue(
     723            'href="http://localhost/app/students/K1000000/routingslip.pdf"'
    723724            in self.browser.contents)
    724725        return
Note: See TracChangeset for help on using the changeset viewer.