Ignore:
Timestamp:
5 Jul 2012, 14:48:51 (12 years ago)
Author:
Henrik Bettermann
Message:

Rename course referrers to certificate courses (according to the discussion long time ago).

Edit some button labels and titles.

Move code from view to content components.

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  
    10001000with their code as key.
    10011001
    1002 Each certificate provides a ``Add course referrer`` action button near top.
     1002Each certificate provides a ``Add certificate course`` action button near top.
    10031003
    10041004Certificates provide an add-form to add new certcourses:
     
    10061006  >>> cert_url = dept_url + '/certificates/CERT1'
    10071007  >>> browser.open(cert_url + '/manage')
    1008   >>> browser.getControl('Add course referrer').click()
     1008  >>> browser.getControl('Add certificate course').click()
    10091009  >>> print browser.contents
    10101010  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     
    10251025  >>> ctrl.getControl('COURSE1').selected = True
    10261026  >>> browser.getControl(name='form.level').value = ['100']
    1027   >>> browser.getControl('Add course referrer').click()
     1027  >>> browser.getControl('Add certificate course').click()
    10281028
    10291029Our certificatecourse will be linked on the parent certificate page:
     
    10381038  >>> cert_url = dept_url + '/certificates/CERT1'
    10391039  >>> browser.open(cert_url + '/manage')
    1040   >>> browser.getControl('Add course referrer').click()
     1040  >>> browser.getControl('Add certificate course').click()
    10411041  >>> ctrl = browser.getControl(name='form.course')
    10421042  >>> ctrl.getControl('COURSE1').selected = True
    10431043  >>> browser.getControl(name='form.level').value = ['100']
    1044   >>> browser.getControl('Add course referrer').click()
    1045   >>> 'The chosen course referrer is already' in browser.contents
     1044  >>> browser.getControl('Add certificate course').click()
     1045  >>> 'The chosen certificate course is already' in browser.contents
    10461046  True
    10471047
     
    10631063
    10641064  >>> browser.open(cert_url + '/COURSE1_100')
    1065   >>> browser.getLink('Edit course referrer').click()
     1065  >>> browser.getLink('Edit certificate course').click()
    10661066
    10671067If we just click 'Save and return' nothing will change:
     
    10881088changed:
    10891089
    1090   >>> browser.getLink('Edit course referrer').click()
     1090  >>> browser.getLink('Edit certificate course').click()
    10911091  >>> browser.getControl(name='form.level').value = ['400']
    10921092  >>> browser.getControl('Cancel').click()
     
    11251125  >>> 'COURSE1_200</a>' in browser.contents
    11261126  True
    1127   >>> browser.getControl('Remove selected course referrers').click()
     1127  >>> browser.getControl('Remove selected certificate courses').click()
    11281128  >>> 'No item selected' in browser.contents
    11291129  True
    11301130  >>> browser.getControl(name='val_id').getControl(
    11311131  ...    value='COURSE1_200').selected = True
    1132   >>> browser.getControl('Remove selected course referrers').click()
     1132  >>> browser.getControl('Remove selected certificate courses').click()
    11331133  >>> 'Successfully removed: COURSE1_200' in browser.contents
    11341134  True
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py

    r8858 r8920  
    19201920    grok.template('certificatemanagepage')
    19211921    taboneactions = [_('Save'),_('Cancel')]
    1922     tabtwoactions = [_('Add course referrer'),
    1923                      _('Remove selected course referrers'),_('Cancel')]
     1922    tabtwoactions = [_('Add certificate course'),
     1923                     _('Remove selected certificate courses'),_('Cancel')]
    19241924    tabthreeactions1 = [_('Remove selected local roles')]
    19251925    tabthreeactions2 = [_('Add local role')]
     
    19441944        return msave(self, **data)
    19451945
    1946     @jsaction(_('Remove selected course referrers'))
     1946    @jsaction(_('Remove selected certificate courses'))
    19471947    def delCertificateCourses(self, **data):
    19481948        delSubobjects(self, redirect='@@manage', tab='2')
    19491949        return
    19501950
    1951     @action(_('Add course referrer'), validator=NullValidator)
     1951    @action(_('Add certificate course'), validator=NullValidator)
    19521952    def addCertificateCourse(self, **data):
    19531953        self.redirect(self.url(self.context, 'addcertificatecourse'))
     
    19861986    form_fields = grok.AutoFields(ICertificateCourseAdd)
    19871987    pnav = 1
    1988     label = _('Add course referrer')
    1989 
    1990     @action(_('Add course referrer'))
     1988    label = _('Add certificate course')
     1989
     1990    @action(_('Add certificate course'))
    19911991    def addCertcourse(self, **data):
    19921992        try:
    1993             self.context.addCourseRef(**data)
     1993            self.context.addCertCourse(**data)
    19941994        except KeyError:
    1995             self.status = self.flash(_('The chosen course referrer is already '
     1995            self.status = self.flash(_('The chosen certificate course is already '
    19961996                                  'part of this certificate.'))
    19971997            return
    19981998        self.status = self.flash(
    1999             _("Course referrer ${a}_${b} added.",
     1999            _("certificate course ${a}_${b} added.",
    20002000            mapping = {'a': data['course'].code, 'b': data['level']}))
    20012001        code = "%s_%s" % (data['course'].code, data['level'])
     
    20382038    grok.require('waeup.manageAcademics')
    20392039    form_fields = grok.AutoFields(ICertificateCourse)
    2040     label = _('Edit course referrer')
     2040    label = _('Edit certificate course')
    20412041    pnav = 1
    20422042
     
    20512051            old_level = self.context.level
    20522052            data['course'] = self.context.course
    2053             parent.addCourseRef(**data)
    2054             parent.delCourseRef(data['course'].code, level=old_level)
     2053            parent.addCertCourse(**data)
     2054            parent.delCertCourse(data['course'].code, level=old_level)
    20552055            self.flash(_('Form has been saved.'))
    20562056            old_code = "%s_%s" % (data['course'].code, old_level)
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/certificatemanagepage.pt

    r7811 r8920  
    44  <ul class="tabs" data-tabs="tabs">
    55    <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="">Course Referrers</a></li>
     6    <li tal:attributes="class view/tab2"><a href="#tab-2" i18n:translate="">Certificate Courses</a></li>
    77    <li tal:attributes="class view/tab3"><a href="#tab-3" i18n:translate="">Local Roles</a></li>
    88  </ul>
     
    2424    </div>
    2525    <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>
    2730      <table class="display dataTableManage">
    2831        <thead>
    2932          <tr>
    30             <th>&nbsp;</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>&nbsp;</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>
    3339            <th i18n:translate="">Mandatory</th>
    3440          </tr>
     
    3743          <tr tal:repeat="cc context/values" class="gradeC">
    3844             <td>
    39               <input type="checkbox"
    40                          name="val_id"
     45              <input type="checkbox" name="val_id"
    4146                         tal:attributes="value cc/__name__" />
    4247            </td>
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/certificatepage.pt

    r7811 r8920  
    2020<h3>
    2121  <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>
    2323</h3>
    2424<br />
     
    2626<thead>
    2727  <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>
    3134  </tr>
    3235</thead>
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_browser.py

    r8755 r8920  
    8484        self.app['faculties']['fac1']['dep1'].courses.addCourse(
    8585            self.course)
    86         self.app['faculties']['fac1']['dep1'].certificates['CERT1'].addCourseRef(
     86        self.app['faculties']['fac1']['dep1'].certificates['CERT1'].addCertCourse(
    8787            self.course, level=100)
    8888
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_permissions.py

    r7811 r8920  
    9191        cert.code = 'cert1'
    9292        dept.certificates.addCertificate(cert)
    93         cert.addCourseRef(course)
     93        cert.addCertCourse(course)
    9494
    9595        self.browser = Browser()
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/viewlets.py

    r8387 r8920  
    456456    grok.context(ICertificateCourse)
    457457    grok.view(CertificateCoursePage)
    458     text = _('Edit course referrer')
     458    text = _('Edit certificate course')
    459459
    460460#
Note: See TracChangeset for help on using the changeset viewer.