Changeset 6642
- Timestamp:
- 28 Aug 2011, 08:41:05 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/layout.py
r6465 r6642 14 14 from waeup.sirp.browser.interfaces import ITheme 15 15 from waeup.sirp.browser.theming import get_all_themes, WAeUPThemeGray1 16 from waeup.sirp.students.interfaces import IStudentNavigation 16 17 17 18 grok.templatedir('templates') … … 152 153 return userid 153 154 155 def getStudentName(self): 156 """Return the student name. 157 """ 158 if IStudentNavigation.providedBy(self.context): 159 return self.context.getStudent().name 160 return 161 154 162 def update(self): 155 163 """Include the resources required by the chosen skin/theme. -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/sitelayout.pt
r6639 r6642 73 73 </div> 74 74 <div class="yui-b"> 75 <div class="block" tal:condition="layout/getStudentName"> 76 <div class="hd"> 77 <h2 tal:content="layout/getStudentName">Student name</h2> 78 </div> 79 <div class="bd"> 80 <tal:left content="structure provider:left_student" /> 81 </div> 82 </div> 75 83 <div class="block"> 76 84 <div class="hd"> -
main/waeup.sirp/trunk/src/waeup/sirp/students/accommodation.py
r6635 r6642 20 20 from grok import index 21 21 from zope.component.interfaces import IFactory 22 from zope.interface import implementedBy23 from waeup.sirp.students.interfaces import IStudentAccommodation 22 from waeup.sirp.students.interfaces import ( 23 IStudentAccommodation, IStudentNavigation) 24 24 from waeup.sirp.utils.helpers import attrs_to_fields 25 25 … … 27 27 """This is a container for accommodation objects. 28 28 """ 29 grok.implements(IStudentAccommodation )29 grok.implements(IStudentAccommodation, IStudentNavigation) 30 30 grok.provides(IStudentAccommodation) 31 31 … … 34 34 return 35 35 36 def getStudent(self): 37 return self.__parent__ 38 36 39 StudentAccommodation = attrs_to_fields(StudentAccommodation) -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r6638 r6642 45 45 from waeup.sirp.browser.resources import datepicker, tabs, datatable 46 46 from waeup.sirp.browser.viewlets import ( 47 ManageActionButton, PrimaryNavTab, LeftSidebarLink,47 ManageActionButton, PrimaryNavTab, 48 48 AddActionButton, ActionButton, PlainActionButton, 49 49 ) … … 65 65 IStudentsContainer, IStudent, IStudentClearance, 66 66 IStudentPersonal, IStudentBase, IStudentStudyCourse, 67 IStudentPayments, IStudentAccommodation 67 IStudentPayments, IStudentAccommodation, IStudentNavigation 68 68 ) 69 69 from waeup.sirp.students.student import ( … … 119 119 grok.require('waeup.viewStudents') 120 120 grok.template('studentscontainerpage') 121 pnav = 4 121 122 122 123 @property … … 163 164 grok.require('waeup.manageStudents') 164 165 grok.template('studentscontainermanagepage') 166 pnav = 4 165 167 166 168 @property … … 225 227 title = 'Students' 226 228 label = 'Add student' 229 pnav = 4 227 230 228 231 @grok.action('Create student record') … … 250 253 grok.template('studentpage') 251 254 form_fields = grok.AutoFields(IStudentBase) 252 253 @property 254 def title(self): 255 return 'Student: %s' % self.context.name 255 pnav = 4 256 title = 'Base Data' 256 257 257 258 @property … … 266 267 text = 'Edit' 267 268 target = 'edit_base' 268 269 class StudentClearanceViewActionButton(PlainActionButton):270 grok.order(2)271 grok.context(IStudent)272 grok.view(StudentBaseDisplayFormPage)273 grok.require('waeup.viewStudents')274 text = 'Clearance Data'275 target = 'view_clearance'276 277 class StudentPersonalViewActionButton(PlainActionButton):278 grok.order(3)279 grok.context(IStudent)280 grok.view(StudentBaseDisplayFormPage)281 grok.require('waeup.viewStudents')282 text = 'Personal Data'283 target = 'view_personal'284 285 class StudyCourseViewActionButton(PlainActionButton):286 grok.order(4)287 grok.context(IStudent)288 grok.view(StudentBaseDisplayFormPage)289 grok.require('waeup.viewStudents')290 text = 'Study Course'291 target = 'studycourse'292 293 class PaymentsViewActionButton(PlainActionButton):294 grok.order(5)295 grok.context(IStudent)296 grok.view(StudentBaseDisplayFormPage)297 grok.require('waeup.viewStudents')298 text = 'Payments'299 target = 'payments'300 301 class AccommodationViewActionButton(PlainActionButton):302 grok.order(6)303 grok.context(IStudent)304 grok.view(StudentBaseDisplayFormPage)305 grok.require('waeup.viewStudents')306 text = 'Accommodation'307 target = 'accommodation'308 309 class HistoryViewActionButton(PlainActionButton):310 grok.order(7)311 grok.context(IStudent)312 grok.view(StudentBaseDisplayFormPage)313 grok.require('waeup.viewStudents')314 text = 'History'315 target = 'history'316 269 317 270 class StudentBaseManageFormPage(WAeUPEditFormPage): … … 324 277 grok.template('studentbasemanagepage') 325 278 label = 'Edit base data' 279 title = 'Base Data' 280 pnav = 4 326 281 327 282 def update(self): … … 330 285 self.wf_info = IWorkflowInfo(self.context) 331 286 return 332 333 @property334 def title(self):335 return 'Student: %s' % self.context.name336 287 337 288 def getTransitions(self): … … 368 319 grok.require('waeup.viewStudents') 369 320 form_fields = grok.AutoFields(IStudentClearance) 370 371 @property 372 def title(self): 373 return 'Student: %s' % self.context.name 321 title = 'Clearance Data' 322 pnav = 4 374 323 375 324 @property … … 393 342 form_fields = grok.AutoFields(IStudentClearance) 394 343 label = 'Edit clearance data' 395 396 @property 397 def title(self): 398 return 'Student: %s' % self.context.name 344 title = 'Clearance Data' 345 pnav = 4 399 346 400 347 class StudentPersonalDisplayFormPage(WAeUPDisplayFormPage): … … 405 352 grok.require('waeup.viewStudents') 406 353 form_fields = grok.AutoFields(IStudentPersonal) 407 408 @property 409 def title(self): 410 return 'Student: %s' % self.context.name 354 title = 'Personal Data' 355 pnav = 4 411 356 412 357 @property … … 430 375 form_fields = grok.AutoFields(IStudentPersonal) 431 376 label = 'Edit personal data' 432 433 @property 434 def title(self): 435 return 'Student: %s' % self.context.name 377 title = 'Personal Data' 378 pnav = 4 436 379 437 380 class StudyCourseDisplayFormPage(WAeUPDisplayFormPage): … … 443 386 form_fields = grok.AutoFields(IStudentStudyCourse) 444 387 #grok.template('studycoursepage') 445 446 @property 447 def title(self): 448 return 'Student: %s' % self.context.__parent__.name 449 450 @property 451 def label(self): 452 return '%s: Study Course Data' % self.context.__parent__.name 388 title = 'Study Course' 389 pnav = 4 390 391 @property 392 def label(self): 393 return '%s: Study Course' % self.context.__parent__.name 453 394 454 395 class PaymentsDisplayFormPage(WAeUPDisplayFormPage): … … 460 401 form_fields = grok.AutoFields(IStudentPayments) 461 402 #grok.template('paymentspage') 462 463 @property 464 def title(self): 465 return 'Student: %s' % self.context.__parent__.name 403 title = 'Payments' 404 pnav = 4 466 405 467 406 @property … … 477 416 form_fields = grok.AutoFields(IStudentAccommodation) 478 417 #grok.template('accommodationpage') 479 480 @property 481 def title(self): 482 return 'Student: %s' % self.context.__parent__.name 418 title = 'Accommodation' 419 pnav = 4 483 420 484 421 @property … … 493 430 grok.require('waeup.viewStudents') 494 431 grok.template('studenthistory') 495 496 @property 497 def title(self): 498 return 'Student: %s' % self.context.name 432 title = 'History' 433 pnav = 4 499 434 500 435 @property -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studentbasemanagepage.pt
r6638 r6642 1 <h2 i18n:translate="" 2 tal:condition="view/label" 3 tal:content="view/label">Label</h2> 4 1 5 <form action="." tal:attributes="action request/URL" method="post" 2 6 class="edit-form" enctype="multipart/form-data"> … … 35 39 </tal:block> 36 40 <tr> 37 <td class="label"><label> Application Transition:</label></td>41 <td class="label"><label>Registration Transition:</label></td> 38 42 <td> 39 43 <select id="transition" name="transition"> -
main/waeup.sirp/trunk/src/waeup/sirp/students/container.py
r6637 r6642 20 20 import os 21 21 from zope.component.interfaces import IFactory 22 from zope.interface import implementedBy23 22 from waeup.sirp.students.interfaces import ( 24 23 IStudentsContainer, IStudent, IStudentPayments, IStudentAccommodation) -
main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
r6637 r6642 4 4 from zope import schema 5 5 from waeup.sirp.interfaces import IWAeUPObject 6 7 class IStudentNavigation(IWAeUPObject): 8 """Interface needed for student navigation. 9 """ 10 11 def getStudent(): 12 """Return student object. 13 """ 6 14 7 15 class IStudentBase(IWAeUPObject): … … 54 62 """ 55 63 56 def addStudent( faculty):64 def addStudent(student): 57 65 """Add an IStudent object and subcontainers. 58 66 -
main/waeup.sirp/trunk/src/waeup/sirp/students/payments.py
r6635 r6642 20 20 from grok import index 21 21 from zope.component.interfaces import IFactory 22 from zope.interface import implementedBy 23 from waeup.sirp.students.interfaces import IStudentPayments 22 from waeup.sirp.students.interfaces import IStudentPayments, IStudentNavigation 24 23 from waeup.sirp.utils.helpers import attrs_to_fields 25 24 … … 27 26 """This is a container for student payments. 28 27 """ 29 grok.implements(IStudentPayments )28 grok.implements(IStudentPayments, IStudentNavigation) 30 29 grok.provides(IStudentPayments) 31 30 … … 34 33 return 35 34 35 def getStudent(self): 36 return self.__parent__ 37 36 38 StudentPayments = attrs_to_fields(StudentPayments) -
main/waeup.sirp/trunk/src/waeup/sirp/students/student.py
r6637 r6642 23 23 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 24 24 from waeup.sirp.interfaces import IObjectHistory 25 from waeup.sirp.students.interfaces import IStudent 25 from waeup.sirp.students.interfaces import IStudent, IStudentNavigation 26 26 from waeup.sirp.utils.helpers import attrs_to_fields 27 27 … … 30 30 owned by students. 31 31 """ 32 grok.implements(IStudent )32 grok.implements(IStudent, IStudentNavigation) 33 33 grok.provides(IStudent) 34 34 … … 52 52 return history 53 53 54 def getStudent(self): 55 return self 56 54 57 # Set all attributes of Student required in IStudent as field 55 58 # properties. Doing this, we do not have to set initial attributes -
main/waeup.sirp/trunk/src/waeup/sirp/students/studycourse.py
r6633 r6642 21 21 from grok import index 22 22 from zope.component.interfaces import IFactory 23 from zope.interface import implementedBy24 from waeup.sirp.students.interfaces import IStudentStudyCourse 23 from waeup.sirp.students.interfaces import ( 24 IStudentStudyCourse, IStudentNavigation) 25 25 from waeup.sirp.utils.helpers import attrs_to_fields 26 26 … … 28 28 """This is a container for study levels. 29 29 """ 30 grok.implements(IStudentStudyCourse )30 grok.implements(IStudentStudyCourse, IStudentNavigation) 31 31 grok.provides(IStudentStudyCourse) 32 32 … … 35 35 return 36 36 37 def getStudent(self): 38 return self.__parent__ 39 37 40 StudentStudyCourse = attrs_to_fields(StudentStudyCourse)
Note: See TracChangeset for help on using the changeset viewer.