Ignore:
Timestamp:
20 Jul 2023, 13:38:29 (17 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/students
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.