Changeset 5942 for main/waeup.sirp/trunk
- Timestamp:
- 14 Apr 2011, 08:31:02 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/browser
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r5930 r5942 161 161 162 162 def update(self): 163 warning.need() 163 164 form = self.request.form 164 165 if 'CANCEL' in form.keys(): … … 846 847 pnav = 1 847 848 848 def update(self, code=None, edit=None, delete=None):849 warning.need()850 if delete is not None and code is not None:851 try:852 del self.context[code]853 self.flash('Faculty %s successfully removed.' % code)854 except:855 self.flash('Could not delete %s.' % code)849 #def update(self, code=None, edit=None, delete=None): 850 # warning.need() 851 # if delete is not None and code is not None: 852 # try: 853 # del self.context[code] 854 # self.flash('Faculty %s successfully removed.' % code) 855 # except: 856 # self.flash('Could not delete %s.' % code) 856 857 857 858 class AddFacultyFormPage(WAeUPAddFormPage): … … 907 908 return "%s (%s)" % (getName(self.context), self.context.code) 908 909 909 def update(self, code=None, edit=None, delete=None):910 warning.need()911 if delete is not None and code is not None:912 try:913 del self.context[code]914 self.flash('Department %s successfully removed.' % code)915 except:916 self.flash('Could not delete %s.' % code)910 #def update(self, code=None, edit=None, delete=None): 911 # warning.need() 912 # if delete is not None and code is not None: 913 # try: 914 # del self.context[code] 915 # self.flash('Department %s successfully removed.' % code) 916 # except: 917 # self.flash('Could not delete %s.' % code) 917 918 918 919 class AddDepartmentFormPage(WAeUPAddFormPage): -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/facultycontainerpage.pt
r5936 r5942 10 10 <th>Code</th> 11 11 <th>Title</th> 12 <th> </th>13 12 </tr> 14 13 </thead> 15 14 <tbody> 16 <tr tal:repeat="value context/values" 17 tal:attributes="class python: repeat['value'].odd() and 'odd' or 'even'"> 15 <tr tal:repeat="value context/values"> 18 16 <td> <a tal:attributes="href value/__name__"> <span tal:content="value/code">Name</span></a></td> 19 17 <td tal:content="value/title">Title</td> 20 <td class="text-right">21 <form method="post">22 <input type="hidden" name="code"23 tal:attributes="value value/__name__"/>24 <input type="submit" name="delete" value="remove"25 onclick="return confirmPost('All departments and courses of this faculty will be removed too. Are you sure?')">26 </form>27 28 </td>29 18 </tr> 30 19 </tbody> 31 20 </table> 32 33 <div tal:content="structure provider:subobjectlist">34 List of subobjects35 </div> -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/facultypage.pt
r5930 r5942 1 1 <h2>Departments</h2> 2 3 2 4 3 <div tal:condition="python: not len(context.keys())"> … … 11 10 <th>Code</th> 12 11 <th>Title</th> 13 <th> </th>14 12 </tr> 15 13 </thead> 16 14 <tbody> 17 <tr tal:repeat="value context/values" 18 tal:attributes="class python: repeat['value'].odd() and 'odd' or 'even'"> 15 <tr tal:repeat="value context/values"> 19 16 <td> <a tal:attributes="href value/__name__"> <span tal:content="value/code">Name</span></a></td> 20 17 <td tal:content="value/title">Title</td> 21 18 <td class="text-right"> 22 <form method="post">23 <input type="hidden" name="code"24 tal:attributes="value value/__name__"/>25 <input type="submit" name="delete" value="remove"26 onclick="return confirmPost('All courses and certificates of this faculty will be removed too. Are you sure?')">27 </form>28 19 </td> 29 20 </tr> -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/removesubobjectspage.pt
r5917 r5942 3 3 </div> 4 4 <form method="POST" tal:condition="python: len(context.keys())"> 5 <div tal:condition="python: not len(context.keys())"> 6 There are no faculties registered yet. 7 </div> 8 5 9 <table> 6 <tr tal:repeat="val context/values" 7 tal:attributes="class python: repeat['val'].odd() and 'odd' or 'even'"> 8 <td> 9 <input type="checkbox" 10 name="val_id" 11 tal:attributes="value val/code" /> 12 </td> 13 <td> 14 <a href="." 15 tal:content="val/code" 16 tal:attributes="href python:view.url(val)"> 17 Subobject Code 18 </a> 19 </td> 20 <td> 21 <a href="." 22 tal:content="val/title" 23 tal:attributes="href python:view.url(val)"> 24 Subobject Name 25 </a> 26 </td> 27 </tr> 10 <thead> 11 <tr> 12 <th> </th> 13 <th>Code</th> 14 <th>Title</th> 15 </tr> 16 </thead> 17 <tbody> 18 <tr tal:repeat="value context/values" 19 tal:attributes="class python: repeat['value'].odd() and 'odd' or 'even'"> 20 <td> 21 <input type="checkbox" 22 name="val_id" 23 tal:attributes="value value/__name__" /> 24 </td> 25 <td> <a tal:attributes="href value/__name__"> <span tal:content="value/code">Name</span></a></td> 26 <td tal:content="value/title">Title</td> 27 </tr> 28 </tbody> 28 29 </table> 29 <input type="submit" name="REMOVE" value="Remove selected" />30 <input type="submit" name="REMOVE" value="Remove selected" onclick="return confirmPost('All sububjects will be removed too. Are you sure?')"/> 30 31 <input type="submit" name="CANCEL" value="Cancel" /> 31 32 </form> -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/usercontainerpage.pt
r5927 r5942 15 15 </thead> 16 16 <tbody> 17 <tr tal:repeat="account context/values" 18 tal:attributes="class python: repeat['account'].odd() and 'odd' or 'even'"> 17 <tr tal:repeat="account context/values"> 19 18 <td tal:content="account/name">username</td> 20 19 <td tal:content="account/title">Title</td> -
main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py
r5936 r5942 392 392 393 393 394 #class RemoveFacultyActionButton(RemoveActionButton):395 #grok.context(IFacultyContainer)396 #grok.view(FacultyContainerPage)397 #text = 'Remove faculty'398 399 #class RemoveDepartmentActionButton(RemoveActionButton):400 #grok.context(IFaculty)401 #grok.view(FacultyPage)402 #text = 'Remove department'394 class RemoveFacultyActionButton(RemoveActionButton): 395 grok.context(IFacultyContainer) 396 grok.view(FacultyContainerPage) 397 text = 'Remove faculty' 398 399 class RemoveDepartmentActionButton(RemoveActionButton): 400 grok.context(IFaculty) 401 grok.view(FacultyPage) 402 text = 'Remove department' 403 403 404 404
Note: See TracChangeset for help on using the changeset viewer.