Changeset 8920 for main/waeup.kofa/trunk/src/waeup/kofa/browser
- Timestamp:
- 5 Jul 2012, 14:48:51 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/browser
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/browser.txt
r8777 r8920 1000 1000 with their code as key. 1001 1001 1002 Each certificate provides a ``Add c ourse referrer`` action button near top.1002 Each certificate provides a ``Add certificate course`` action button near top. 1003 1003 1004 1004 Certificates provide an add-form to add new certcourses: … … 1006 1006 >>> cert_url = dept_url + '/certificates/CERT1' 1007 1007 >>> browser.open(cert_url + '/manage') 1008 >>> browser.getControl('Add c ourse referrer').click()1008 >>> browser.getControl('Add certificate course').click() 1009 1009 >>> print browser.contents 1010 1010 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... … … 1025 1025 >>> ctrl.getControl('COURSE1').selected = True 1026 1026 >>> browser.getControl(name='form.level').value = ['100'] 1027 >>> browser.getControl('Add c ourse referrer').click()1027 >>> browser.getControl('Add certificate course').click() 1028 1028 1029 1029 Our certificatecourse will be linked on the parent certificate page: … … 1038 1038 >>> cert_url = dept_url + '/certificates/CERT1' 1039 1039 >>> browser.open(cert_url + '/manage') 1040 >>> browser.getControl('Add c ourse referrer').click()1040 >>> browser.getControl('Add certificate course').click() 1041 1041 >>> ctrl = browser.getControl(name='form.course') 1042 1042 >>> ctrl.getControl('COURSE1').selected = True 1043 1043 >>> browser.getControl(name='form.level').value = ['100'] 1044 >>> browser.getControl('Add c ourse referrer').click()1045 >>> 'The chosen c ourse referreris already' in browser.contents1044 >>> browser.getControl('Add certificate course').click() 1045 >>> 'The chosen certificate course is already' in browser.contents 1046 1046 True 1047 1047 … … 1063 1063 1064 1064 >>> browser.open(cert_url + '/COURSE1_100') 1065 >>> browser.getLink('Edit c ourse referrer').click()1065 >>> browser.getLink('Edit certificate course').click() 1066 1066 1067 1067 If we just click 'Save and return' nothing will change: … … 1088 1088 changed: 1089 1089 1090 >>> browser.getLink('Edit c ourse referrer').click()1090 >>> browser.getLink('Edit certificate course').click() 1091 1091 >>> browser.getControl(name='form.level').value = ['400'] 1092 1092 >>> browser.getControl('Cancel').click() … … 1125 1125 >>> 'COURSE1_200</a>' in browser.contents 1126 1126 True 1127 >>> browser.getControl('Remove selected c ourse referrers').click()1127 >>> browser.getControl('Remove selected certificate courses').click() 1128 1128 >>> 'No item selected' in browser.contents 1129 1129 True 1130 1130 >>> browser.getControl(name='val_id').getControl( 1131 1131 ... value='COURSE1_200').selected = True 1132 >>> browser.getControl('Remove selected c ourse referrers').click()1132 >>> browser.getControl('Remove selected certificate courses').click() 1133 1133 >>> 'Successfully removed: COURSE1_200' in browser.contents 1134 1134 True -
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r8858 r8920 1920 1920 grok.template('certificatemanagepage') 1921 1921 taboneactions = [_('Save'),_('Cancel')] 1922 tabtwoactions = [_('Add c ourse referrer'),1923 _('Remove selected c ourse referrers'),_('Cancel')]1922 tabtwoactions = [_('Add certificate course'), 1923 _('Remove selected certificate courses'),_('Cancel')] 1924 1924 tabthreeactions1 = [_('Remove selected local roles')] 1925 1925 tabthreeactions2 = [_('Add local role')] … … 1944 1944 return msave(self, **data) 1945 1945 1946 @jsaction(_('Remove selected c ourse referrers'))1946 @jsaction(_('Remove selected certificate courses')) 1947 1947 def delCertificateCourses(self, **data): 1948 1948 delSubobjects(self, redirect='@@manage', tab='2') 1949 1949 return 1950 1950 1951 @action(_('Add c ourse referrer'), validator=NullValidator)1951 @action(_('Add certificate course'), validator=NullValidator) 1952 1952 def addCertificateCourse(self, **data): 1953 1953 self.redirect(self.url(self.context, 'addcertificatecourse')) … … 1986 1986 form_fields = grok.AutoFields(ICertificateCourseAdd) 1987 1987 pnav = 1 1988 label = _('Add c ourse referrer')1989 1990 @action(_('Add c ourse referrer'))1988 label = _('Add certificate course') 1989 1990 @action(_('Add certificate course')) 1991 1991 def addCertcourse(self, **data): 1992 1992 try: 1993 self.context.addC ourseRef(**data)1993 self.context.addCertCourse(**data) 1994 1994 except KeyError: 1995 self.status = self.flash(_('The chosen c ourse referreris already '1995 self.status = self.flash(_('The chosen certificate course is already ' 1996 1996 'part of this certificate.')) 1997 1997 return 1998 1998 self.status = self.flash( 1999 _(" Course referrer${a}_${b} added.",1999 _("certificate course ${a}_${b} added.", 2000 2000 mapping = {'a': data['course'].code, 'b': data['level']})) 2001 2001 code = "%s_%s" % (data['course'].code, data['level']) … … 2038 2038 grok.require('waeup.manageAcademics') 2039 2039 form_fields = grok.AutoFields(ICertificateCourse) 2040 label = _('Edit c ourse referrer')2040 label = _('Edit certificate course') 2041 2041 pnav = 1 2042 2042 … … 2051 2051 old_level = self.context.level 2052 2052 data['course'] = self.context.course 2053 parent.addC ourseRef(**data)2054 parent.delC ourseRef(data['course'].code, level=old_level)2053 parent.addCertCourse(**data) 2054 parent.delCertCourse(data['course'].code, level=old_level) 2055 2055 self.flash(_('Form has been saved.')) 2056 2056 old_code = "%s_%s" % (data['course'].code, old_level) -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/certificatemanagepage.pt
r7811 r8920 4 4 <ul class="tabs" data-tabs="tabs"> 5 5 <li tal:attributes="class view/tab1"><a href="#tab-1" i18n:translate="">Settings</a></li> 6 <li tal:attributes="class view/tab2"><a href="#tab-2" i18n:translate="">C ourse Referrers</a></li>6 <li tal:attributes="class view/tab2"><a href="#tab-2" i18n:translate="">Certificate Courses</a></li> 7 7 <li tal:attributes="class view/tab3"><a href="#tab-3" i18n:translate="">Local Roles</a></li> 8 8 </ul> … … 24 24 </div> 25 25 <div id="tab-2" tal:attributes="class view/tab2"> 26 <h3 i18n:translate="">Course Referrers</h3> 26 <h3> 27 <span tal:content="context/__name__">Code</span> 28 <span i18n:domain="waeup.kofa" i18n:translate="">Courses</span> 29 </h3> 27 30 <table class="display dataTableManage"> 28 31 <thead> 29 32 <tr> 30 <th> </th><th i18n:translate="">Level</th> 31 <th i18n:translate="">Semester</th><th i18n:translate="">Referrer</th> 32 <th i18n:translate="">Course</th><th i18n:translate="">Title</th> 33 <th> </th> 34 <th i18n:translate="">Level</th> 35 <th i18n:translate="">Semester</th> 36 <th i18n:translate="">Cert. Course</th> 37 <th i18n:translate="">Dep. Course</th> 38 <th i18n:translate="">Title</th> 33 39 <th i18n:translate="">Mandatory</th> 34 40 </tr> … … 37 43 <tr tal:repeat="cc context/values" class="gradeC"> 38 44 <td> 39 <input type="checkbox" 40 name="val_id" 45 <input type="checkbox" name="val_id" 41 46 tal:attributes="value cc/__name__" /> 42 47 </td> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/certificatepage.pt
r7811 r8920 20 20 <h3> 21 21 <span tal:content="context/__name__">Code</span> 22 <span i18n:domain="waeup.kofa" i18n:translate="">Course Referrers</span>22 <span i18n:domain="waeup.kofa" i18n:translate="">Courses</span> 23 23 </h3> 24 24 <br /> … … 26 26 <thead> 27 27 <tr> 28 <th i18n:translate="">Level</th><th i18n:translate="">Semester</th> 29 <th i18n:translate="">Referrer</th><th i18n:translate="">Course</th> 30 <th i18n:translate="">Title</th><th i18n:translate="">Mandatory</th> 28 <th i18n:translate="">Level</th> 29 <th i18n:translate="">Semester</th> 30 <th i18n:translate="">Cert. Course</th> 31 <th i18n:translate="">Dep. Course</th> 32 <th i18n:translate="">Title</th> 33 <th i18n:translate="">Mandatory</th> 31 34 </tr> 32 35 </thead> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_browser.py
r8755 r8920 84 84 self.app['faculties']['fac1']['dep1'].courses.addCourse( 85 85 self.course) 86 self.app['faculties']['fac1']['dep1'].certificates['CERT1'].addC ourseRef(86 self.app['faculties']['fac1']['dep1'].certificates['CERT1'].addCertCourse( 87 87 self.course, level=100) 88 88 -
main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_permissions.py
r7811 r8920 91 91 cert.code = 'cert1' 92 92 dept.certificates.addCertificate(cert) 93 cert.addC ourseRef(course)93 cert.addCertCourse(course) 94 94 95 95 self.browser = Browser() -
main/waeup.kofa/trunk/src/waeup/kofa/browser/viewlets.py
r8387 r8920 456 456 grok.context(ICertificateCourse) 457 457 grok.view(CertificateCoursePage) 458 text = _('Edit c ourse referrer')458 text = _('Edit certificate course') 459 459 460 460 #
Note: See TracChangeset for help on using the changeset viewer.