Changeset 295 for WAeUP_SRP/trunk/skins
- Timestamp:
- 13 Jul 2006, 11:37:54 (18 years ago)
- 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=None1 ##parameters=REQUEST=None 2 2 # $Id$ 3 """ 4 """ 5 request = REQUEST 6 rget = request.get 7 rset = request.set 8 fget = request.form.get 9 form = request.form 10 fhas = request.form.has_key 3 11 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."""6 12 7 member = context.portal_membership.getAuthenticatedMember() 13 lt = context.portal_layouts 14 pr = context.portal_registration 15 pm = context.portal_membership 16 items = context.contentValues() 8 17 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) 18 validate = fhas('add') or fhas('change') or fhas('delete') 19 res,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 30 if 1 or psm == 'invalid': 31 return context.academics_view_form(rendered = res, 32 psm = 'Please correct your errors', 33 ds = ds, 34 ) 35 elif psm == '': 36 return context.academics_view_form(rendered = res, 37 psm = psm, 38 ds = ds, 39 ) 40 inr = 0 41 if 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" 44 elif 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 49 elif 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 58 elif psm == 'valid': 59 psm = "Your changes have been saved." 60 61 res,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 70 return 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 1 1 <html metal:use-macro="here/content_lib_master/macros/master"> 2 3 2 <metal:block fill-slot="head_slot"> 4 <tal:block tal:define="student here/getContent">5 </tal:block>6 3 </metal:block> 7 4 8 5 <metal:block fill-slot="css_slot"> 9 6 <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" /> 11 8 </metal:block> 12 9 <metal:block fill-slot="header"> … … 14 11 15 12 <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" /> 34 26 </metal:block> 35 27 <metal:block fill-slot="sub"> -
WAeUP_SRP/trunk/skins/waeup_default/layout_row_edit.pt
r289 r295 15 15 is_flexible options/is_flexible; 16 16 cpsmcat nocall:here/translation_service; 17 results options/ schoolresults;17 results options/items; 18 18 " 19 19 > 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" 21 22 enctype='multipart/form-data' class='workflow'> 22 23 <div class=''> 23 24 <div class='documentFields'> 25 <table width="100%" cellpadding="2" cellspacing="2" summary="Form layout"> 26 <tr tal:repeat="item results" valign="top"> 27 <td> 24 28 <table width="100%" cellpadding="2" cellspacing="2" summary="Form layout"> 25 29 <tr tal:repeat="row layout/rows" valign="top"> … … 77 81 </tr> 78 82 </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"> 80 93 <tr> 81 94 <td align="left" valign="top"> … … 92 105 </td> 93 106 </tr> 94 <span tal:repeat="row results" tal: omit-tag="">107 <span tal:repeat="row results" tal:condition="python: 0" tal:omit-tag=""> 95 108 <tr tal:define="rindex repeat/row/index"> 96 109 <td align="left" valign="top"> … … 124 137 </tr> 125 138 </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%"> 127 140 <tr> 128 141 <td align="left" valign="top" colspan="2">
Note: See TracChangeset for help on using the changeset viewer.