Changeset 696


Ignore:
Timestamp:
13 Oct 2006, 21:41:18 (18 years ago)
Author:
joachim
Message:

added link to student also to used Pins

Location:
WAeUP_SRP/trunk/skins/waeup_pins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_pins/batch_view.pt

    r695 r696  
    3434            <td tal:content="pin/serial" />
    3535            <td tal:content="pin/pin" />
    36             <td tal:content="pin/student" />
     36            <td>
     37              <a href="" tal:content="pin/student"
     38                 tal:attributes="href pin/student_url"></a>
     39            </td>
    3740          </tr>
    3841        </table>
  • WAeUP_SRP/trunk/skins/waeup_pins/getBatchInfo.py

    r688 r696  
    1919    else:
    2020        return None
    21 info['batch_doc'] = batch.getContent()
     21bd = batch.getContent()
     22info['batch_doc'] = bd
    2223info['id'] = batch.getId()
    2324info['title'] = batch.Title or 'empty Title'
    24 info['unused'],info['used'] = batch.getContent().getUnusedPins()
     25info['unused'],used = batch.getContent().getUnusedPins()
     26l = []
     27students_rpath = context.portal_catalog(meta_type = "StudentsFolder")[-1].relative_path
     28students_url = "%s/%s" % (context.portal_url(),students_rpath)
     29
     30for item in used:
     31    if bd.prefix == "APP":
     32        jno = item['student']
     33        item['student_url'] = "%s/%s" % (context.portal_url(),
     34                                         context.portal_catalog(SearchableText=jno,
     35                                                                portal_type='StudentApplication')[0].relative_path
     36                                        )                       
     37    else:
     38        item['student_url'] = '%s/%s' % (students_url,item['student'])
     39info['used'] = used
    2540return info
Note: See TracChangeset for help on using the changeset viewer.