Changeset 17497 for main


Ignore:
Timestamp:
20 Jul 2023, 13:38:29 (16 months ago)
Author:
Henrik Bettermann
Message:

Remove redundant ‚key‘ field from exports.
Adjust tests and code.
Add columns to transcript officers landing page.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/mytranscriptrequests.pt

    r17411 r17497  
    1010    <th i18n:translate="">Full Name</th>
    1111    <th i18n:translate="">Course Studied</th>
     12    <th i18n:translate="">End Session</th>
     13    <th i18n:translate="">Entry Mode</th>
    1214    <th i18n:translate="">Submission Date</th>
    1315  </tr>
     
    2224    </td>
    2325    <td tal:content="python:item[0].display_fullname">Bob</td>
    24     <td tal:content="python:getattr(item[0].course_studied,'title',None)">Bob</td>
    25     <td tal:content="python:item[1]">Bob</td>
     26    <td tal:content="python:getattr(item[0].course_studied,'title',None)">CERT</td>
     27    <td tal:content="python:getattr(item[0],'end_session',None)">2012</td>
     28    <td tal:content="python:getattr(item[0],'entry_mode',None)">UG</td>
     29    <td tal:content="python:item[1]">date</td>
    2630  </tr>
    2731  </tbody>
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r17458 r17497  
    16021602            self.redirect(self.url(self.context))
    16031603            return
     1604        self.tdata = self.context.getTranscriptData()
     1605        #if not self.tdata[1]:
     1606        #    self.flash(_('No results yet!'), type="warning")
     1607        #    self.redirect(self.url(self.context))
     1608        #    return
    16041609        super(StudyCourseTranscriptPage, self).update()
    16051610        self.semester_dict = getUtility(IKofaUtils).SEMESTER_DICT
     
    16361641            self.redirect(self.url(self.context))
    16371642            return
     1643        tdata = self.context.getTranscriptData()
     1644        #if not tdata[1]:
     1645        #    self.flash(_('No results yet!'), type="warning")
     1646        #    self.redirect(self.url(self.context))
     1647        #    return
    16381648        super(ExportPDFTranscriptSlip, self).update()
    16391649        self.semester_dict = getUtility(IKofaUtils).SEMESTER_DICT
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/transcript.pt

    r16046 r17497  
    1 <tal:def define="tdata python:context.getTranscriptData()">
    21<table class="form-table" i18n:domain="waeup.kofa">
    32  <thead>
     
    1615      </tr>
    1716    </tal:block>
    18     <tr>
     17    <tr tal:condition="python:view.tdata[1]">
    1918      <td>
    2019        <span i18n:translate="">Cumulative GPA</span>:
    2120      </td>
    2221      <td>
    23         <div tal:content="python:view.format_float(tdata[1], 3)">CGPA</div>
     22        <div tal:content="python:view.format_float(view.tdata[1], 3)">CGPA</div>
    2423      </td>
    2524    </tr>
     
    2726</table>
    2827
    29 <h3 i18n:domain="waeup.kofa" i18n:translate="">Subjects/Courses</h3>
     28<tal:block condition=python:view.tdata[1]>
     29  <h3 i18n:domain="waeup.kofa" i18n:translate="">Subjects/Courses</h3>
     30  <table i18n:domain="waeup.kofa" class="form-table" >
     31    <thead>
     32      <tr>
     33        <th i18n:translate="">Level</th>
     34        <th i18n:translate="">Session</th>
     35        <th i18n:translate="">Term</th>
     36        <th i18n:translate="">Course</th>
     37        <th i18n:translate="">Title</th>
     38        <th i18n:translate="">Credits</th>
     39        <th i18n:translate="">Grade</th>
     40      </tr>
     41    </thead>
     42    <tbody>
     43      <tal:levels tal:repeat="level python:view.tdata[0]">
     44        <tal:semesters tal:repeat="semester_tickets python:(level['tickets_1'],
     45                                        level['tickets_2'], level['tickets_3'])">
     46        <tr tal:repeat="ticket semester_tickets">
     47          <td tal:content="python: view.level_dict.get('ticket.level', ticket.level)">LEVEL</td>
     48          <td tal:content="python: view.session_dict[ticket.level_session]">SESSION</td>
     49          <td tal:content="python: view.semester_dict[ticket.semester]">SEMESTER</td>
     50          <td tal:content="ticket/code">CODE</td>
     51          <td tal:content="ticket/title">TITLE</td>
     52          <td tal:content="ticket/credits">CREDITS</td>
     53          <td tal:content="ticket/grade|nothing">GRADE</td>
     54        </tr>
     55        </tal:semesters>
     56      </tal:levels>
     57    </tbody>
     58  </table>
     59  <br />
     60</tal:block>
    3061
    31 <table i18n:domain="waeup.kofa" class="form-table" >
    32   <thead>
    33     <tr>
    34       <th i18n:translate="">Level</th>
    35       <th i18n:translate="">Session</th>
    36       <th i18n:translate="">Term</th>
    37       <th i18n:translate="">Course</th>
    38       <th i18n:translate="">Title</th>
    39       <th i18n:translate="">Credits</th>
    40       <th i18n:translate="">Grade</th>
    41     </tr>
    42   </thead>
    43   <tbody>
    44     <tal:levels tal:repeat="level python:tdata[0]">
    45       <tal:semesters tal:repeat="semester_tickets python:(level['tickets_1'],
    46                                       level['tickets_2'], level['tickets_3'])">
    47       <tr tal:repeat="ticket semester_tickets">
    48         <td tal:content="python: view.level_dict.get('ticket.level', ticket.level)">LEVEL</td>
    49         <td tal:content="python: view.session_dict[ticket.level_session]">SESSION</td>
    50         <td tal:content="python: view.semester_dict[ticket.semester]">SEMESTER</td>
    51         <td tal:content="ticket/code">CODE</td>
    52         <td tal:content="ticket/title">TITLE</td>
    53         <td tal:content="ticket/credits">CREDITS</td>
    54         <td tal:content="ticket/grade|nothing">GRADE</td>
    55       </tr>
    56       </tal:semesters>
    57     </tal:levels>
    58   </tbody>
    59 </table>
    60 <br />
    6162<div tal:content="python:getattr(context, 'transcript_signees', '')">SIGNEES</div>
    62 </tal:def>
     63
     64<p tal:condition="not: python:view.tdata[1]">
     65  <br />
     66  <strong>No results yet!</strong>
     67</p>
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r17182 r17497  
    10891089        else:
    10901090            f_text = formatted_text('%s' % cgpa)
     1091            if not transcript_data[1]:
     1092                f_text = formatted_text('No results yet!')
    10911093        f_text = Paragraph(f_text, ENTRY1_STYLE)
    10921094        contextdata.append([f_label,f_text])
     
    10951097        data.append(contexttable)
    10961098
    1097         transcripttables = render_transcript_data(
    1098             view, tableheader, levels_data, lang=portal_language)
    1099         data.extend(transcripttables)
     1099        if transcript_data[1]:
     1100            transcripttables = render_transcript_data(
     1101                view, tableheader, levels_data, lang=portal_language)
     1102            data.extend(transcripttables)
    11001103
    11011104        # Insert signatures
  • main/waeup.kofa/trunk/src/waeup/kofa/university/export.py

    r16450 r17497  
    123123
    124124    def mangle_value(self, value, name, context=None):
    125         """The mangler additionally computes the department_code value
    126         which is the code of the department that offers the course.
     125        """The mangler additionally computes the department_code
     126        and faculty_code values.
    127127        """
    128128        if name == 'users_with_local_roles':
     
    166166
    167167    fields = ('code', 'faculty_code', 'department_code', 'title', 'study_mode',
    168               'degree','key',
     168              'degree',
    169169              'start_level', 'end_level', 'application_category', 'ratio',
    170170              'school_fee_1', 'school_fee_2', 'school_fee_3', 'school_fee_4',
     
    174174
    175175    title = _(u'Certificates')
    176 
    177     def mangle_value(self, value, name, context=None):
    178         """The mangler additionally computes the department_code value
    179         which is the code of the department that offers the certificate.
    180         """
    181         if name == 'key':
    182             value = context.__name__
    183         return super(CertificateExporter, self).mangle_value(
    184             value, name, context)
    185176
    186177    def export_all(self, site, filepath=None):
  • main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_export.py

    r16450 r17497  
    400400            result,
    401401            'code,faculty_code,department_code,title,study_mode,'
    402             'degree,key,start_level,'
     402            'degree,start_level,'
    403403            'end_level,application_category,ratio,school_fee_1,'
    404404            'school_fee_2,school_fee_3,school_fee_4,'
     
    406406            'custom_float_1,custom_float_2,'
    407407            'users_with_local_roles\r\n'
    408             'CERT1,F1,D1,Master of Cheese,ct_ft,,CERT1,100,300,basic,,,,,,,,,,'
     408            'CERT1,F1,D1,Master of Cheese,ct_ft,,100,300,basic,,,,,,,,,,'
    409409            '"[{\'user_name\': u\'bob\', \'local_role\': u\'bobsrole\'}]"\r\n'
    410410            )
     
    418418            result,
    419419            'code,faculty_code,department_code,title,study_mode,'
    420             'degree,key,start_level,'
     420            'degree,start_level,'
    421421            'end_level,application_category,ratio,school_fee_1,'
    422422            'school_fee_2,school_fee_3,school_fee_4,'
     
    424424            'custom_float_1,custom_float_2,'
    425425            'users_with_local_roles\r\n'
    426             'CERT1,F1,D1,Master of Cheese,ct_ft,,CERT1,100,300,basic,,,,,,,,,,'
     426            'CERT1,F1,D1,Master of Cheese,ct_ft,,100,300,basic,,,,,,,,,,'
    427427            '"[{\'user_name\': u\'bob\', \'local_role\': u\'bobsrole\'}]"\r\n'
    428             'CERT2,F1,D1,Master of Cheddar,ct_ft,,CERT2,400,700,cest,,,,,,,,,,[]\r\n'
     428            'CERT2,F1,D1,Master of Cheddar,ct_ft,,400,700,cest,,,,,,,,,,[]\r\n'
    429429            )
    430430        return
     
    438438            result,
    439439            'code,faculty_code,department_code,title,study_mode,'
    440             'degree,key,start_level,'
     440            'degree,start_level,'
    441441            'end_level,application_category,ratio,'
    442442            'school_fee_1,school_fee_2,school_fee_3,school_fee_4,'
     
    444444            'custom_float_1,custom_float_2,'
    445445            'users_with_local_roles\r\n'
    446             'CERT1,F1,D1,Master of Cheese,ct_ft,,CERT1,100,300,basic,,,,,,,,,,'
     446            'CERT1,F1,D1,Master of Cheese,ct_ft,,100,300,basic,,,,,,,,,,'
    447447            '"[{\'user_name\': u\'bob\', \'local_role\': u\'bobsrole\'}]"\r\n'
    448             'CERT2,F1,D1,Master of Cheddar,ct_ft,,CERT2,400,700,cest,,,,,,,,,,[]\r\n'
    449             'CERT3,F1,D2,Cert. of Rubbish,dp_pt,,CERT3,100,200,no,,,,,,,,,,[]\r\n'
     448            'CERT2,F1,D1,Master of Cheddar,ct_ft,,400,700,cest,,,,,,,,,,[]\r\n'
     449            'CERT3,F1,D2,Cert. of Rubbish,dp_pt,,100,200,no,,,,,,,,,,[]\r\n'
    450450            )
    451451        return
     
    458458            result,
    459459            'code,faculty_code,department_code,title,study_mode,'
    460             'degree,key,start_level,'
     460            'degree,start_level,'
    461461            'end_level,application_category,ratio,'
    462462            'school_fee_1,school_fee_2,school_fee_3,school_fee_4,'
     
    464464            'custom_float_1,custom_float_2,'
    465465            'users_with_local_roles\r\n'
    466             'CERT1,F1,D1,Master of Cheese,ct_ft,,CERT1,100,300,basic,,,,,,,,,,'
     466            'CERT1,F1,D1,Master of Cheese,ct_ft,,100,300,basic,,,,,,,,,,'
    467467            '"[{\'user_name\': u\'bob\', \'local_role\': u\'bobsrole\'}]"\r\n'
    468             'CERT2,F1,D1,Master of Cheddar,ct_ft,,CERT2,400,700,cest,,,,,,,,,,[]\r\n'
    469             'CERT3,F1,D2,Cert. of Rubbish,dp_pt,,CERT3,100,200,no,,,,,,,,,,[]\r\n'
     468            'CERT2,F1,D1,Master of Cheddar,ct_ft,,400,700,cest,,,,,,,,,,[]\r\n'
     469            'CERT3,F1,D2,Cert. of Rubbish,dp_pt,,100,200,no,,,,,,,,,,[]\r\n'
    470470            )
    471471        return
Note: See TracChangeset for help on using the changeset viewer.