Changeset 295 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
13 Jul 2006, 11:37:54 (18 years ago)
Author:
joachim
Message:

=Courses and Certificates Folder added

Location:
WAeUP_SRP/trunk/skins
Files:
1 added
1 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_academics/academics_view.py

    r280 r295  
    1 ##parameters=REQUEST=None,psm=None,groups=None
     1##parameters=REQUEST=None
    22# $Id$
     3"""
     4"""
     5request = REQUEST
     6rget = request.get
     7rset = request.set
     8fget = request.form.get
     9form = request.form
     10fhas = request.form.has_key
    311
    4 """Default view for the forum. If post_id is not None, post with id = <post_id>
    5 will be displayed, otherwise first post will be displayed."""
    612
    7 member = context.portal_membership.getAuthenticatedMember()
     13lt = context.portal_layouts
     14pr = context.portal_registration
     15pm = context.portal_membership
     16items = context.contentValues()
    817
    9 if not context.portal_membership.isAnonymousUser():
    10     if 'Manager' in member.getRoles():
    11         return context.folder_view()
    12 index = getattr(context,'documents',None)
    13 if index:
    14     fp = getattr(index,'academicsfrontpage',None)
    15     if fp:
    16         return fp()
    17 return context.academics.academics_view_all(psm=psm)
     18validate = fhas('add') or fhas('change') or fhas('delete')
     19res,psm,ds = lt.renderLayout(layout_id='faculty_row',
     20                      schema_id= 'faculty_row',
     21                      context=context,
     22                      mapping= {},#validate and request,
     23                      ob={},
     24                      layout_mode='edit',
     25                      formaction = "academics_view",
     26                      items=items,
     27                      )
     28#return res
     29
     30if 1 or psm == 'invalid':
     31    return context.academics_view_form(rendered = res,
     32                                 psm = 'Please correct your errors',
     33                                 ds = ds,
     34                                 )
     35elif psm == '':
     36    return context.academics_view_form(rendered = res,
     37                                 psm = psm,
     38                                 ds = ds,
     39                                 )
     40inr = 0
     41if fhas('add') and (fget('type') or fget('subject') or fget('result')):
     42    sr.append((fget('type'),fget('subject'),fget('result')))
     43    psm = "new result added"
     44elif fhas('change') and fget('keys'):
     45    for k in fget('keys'):
     46        sr[int(k)] = (fget('type_%s' % k),fget('subject_%s' % k),fget('result_%s' % k))
     47        inr += 1
     48    psm = "%s items changed" % inr
     49elif fhas('delete') and fget('keys'):
     50    new = []
     51    todelete = fget('keys')
     52    for k in range(len(sr)):
     53        if str(k) not in todelete:
     54            new.append(sr[k])
     55    inr = len(todelete)
     56    sr = new
     57    psm = "%s items deleted" % inr
     58elif psm == 'valid':
     59    psm = "Your changes have been saved."
     60
     61res,dummy,fds = lt.renderLayout(layout_id= 'faculty_row',
     62                      schema_id= 'faculty_row',
     63                      context=context,
     64                      mapping=request,
     65                      ob={},
     66                      layout_mode='create',
     67                      formaction = "academics_view",
     68                      )
     69
     70return context.academic_view_form(rendered = res,
     71                                 #psm = "%s <br /> %s" % (str(ds),str(lt.faculty_row.getLayoutDefinition()))
     72                                 psm = psm,
     73                                 )
  • WAeUP_SRP/trunk/skins/waeup_academics/academics_view_form.pt

    r289 r295  
    11<html metal:use-macro="here/content_lib_master/macros/master">
    2 
    32  <metal:block fill-slot="head_slot">
    4     <tal:block tal:define="student here/getContent">
    5     </tal:block>
    63  </metal:block>
    74
    85  <metal:block fill-slot="css_slot">
    96    <link rel="Stylesheet" type="text/css" href=""
    10           tal:attributes="href string:${base_url}student.css" />
     7      tal:attributes="href string:${base_url}document.css" />
    118  </metal:block>
    129  <metal:block fill-slot="header">
     
    1411
    1512  <metal:block fill-slot="main"
    16                tal:define="items here/contentValues">
    17     <h2>Academics (Faculties)</h2>
    18     <table cellspacing="0" cellpadding="0">
    19       <tal:block condition="python: len(items)">
    20         <span tal:repeat="item items">
    21           <tr tal:condition="python:item.portal_type == 'Faculty'">
    22             <td colspan="1">
    23               <a href="faculty" tal:attributes="href item/absolute_url" tal:content="item/title_or_id"></a>
    24             </td>
    25           </tr>
    26         </span>
    27       </tal:block>
    28       <tr tal:condition="python:not len(items)">
    29         <td>
    30           nothing yet !
    31         </td>
    32       </tr>
    33     </table>
     13               tal:define="roles member/getRoles;
     14               backend python:'UniversityManager' in roles or 'StudentManager' in roles;
     15               frontend python:'Student' in roles or isAnon;
     16               folder here/getContent;
     17               items here/contentValues;
     18               rendered options;"
     19               >
     20    <h1> <span tal:content="context/title_or_id" /></h1>     
     21 
     22    <p>The Acamdemic Section</p>       
     23 
     24    <p>The Faculties:</p>
     25<span tal:replace="structure rendered" /> 
    3426  </metal:block>
    3527  <metal:block fill-slot="sub">
  • WAeUP_SRP/trunk/skins/waeup_default/layout_row_edit.pt

    r289 r295  
    1515             is_flexible options/is_flexible;
    1616             cpsmcat nocall:here/translation_service;
    17              results options/schoolresults;
     17             results options/items;
    1818             "
    1919             >
    20   <form action='eligibility' method='post' tal:attributes="action formaction"
     20  <span tal:content="structure layout" tal:condition="python: 0" />
     21  <form tal:condition="python: 1" action='tobereplaced' method='post' tal:attributes="action formaction"
    2122        enctype='multipart/form-data' class='workflow'>
    2223    <div class=''>
    2324      <div class='documentFields'>
     25        <table width="100%" cellpadding="2" cellspacing="2" summary="Form layout">
     26          <tr tal:repeat="item results" valign="top">
     27            <td>
    2428        <table width="100%" cellpadding="2" cellspacing="2" summary="Form layout">
    2529          <tr tal:repeat="row layout/rows" valign="top">
     
    7781          </tr>
    7882        </table>
    79     <table cellspacing="0" cellpadding="2" border="0" width="100%" tal:condition="results|nothing">
     83            </td>
     84          </tr>
     85      <tr>
     86        <td align="left" colspan="3">
     87          <input class="standalone" type="submit" name="change" value=" Change " />
     88          <input class="standalone" type="submit" name="delete" value=" Delete " />
     89        </td>
     90      </tr>
     91        </table>
     92    <table cellspacing="0" cellpadding="2" border="0" width="100%" tal:condition="nothing">
    8093      <tr>
    8194        <td align="left" valign="top">
     
    92105        </td>
    93106      </tr>
    94       <span tal:repeat="row results" tal:omit-tag="">
     107      <span tal:repeat="row results" tal:condition="python: 0" tal:omit-tag="">
    95108        <tr tal:define="rindex repeat/row/index">
    96109          <td align="left" valign="top">
     
    124137      </tr>
    125138    </table>
    126     <table cellspacing="0" cellpadding="2" border="0" width="100%">
     139    <table tal:condition="python:0" cellspacing="0" cellpadding="2" border="0" width="100%">
    127140      <tr>
    128141        <td align="left" valign="top" colspan="2">
Note: See TracChangeset for help on using the changeset viewer.