Ignore:
Timestamp:
21 Sep 2012, 08:19:35 (12 years ago)
Author:
uli
Message:

Rollback r9209. Looks like multiple merges from trunk confuse svn when merging back into trunk.

Location:
main/waeup.kofa/branches/uli-zc-async
Files:
5 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/uli-zc-async

  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/batchprocessing.txt

    r9209 r9211  
    7575
    7676    >>> import cStringIO
    77     >>> browser.getLink('Upload data').click()
     77    >>> browser.getLink('Upload CSV file').click()
    7878    >>> filecontents = cStringIO.StringIO(
    7979    ...   open('faculties.csv', 'rb').read())
     
    8484Step 1: start batch processing:
    8585
    86     >>> browser.getLink('Process data').click()
     86    >>> browser.getLink('Batch processing').click()
    8787    >>> button = lookup_submit_value(
    8888    ...   'select', 'faculties_zope.mgr.csv', browser)
     
    9797    'Course Processor', 'CourseTicket Processor',
    9898    'Department Processor', 'Faculty Processor',
    99     'Hostel Processor',
    100     'Student Payment Processor', 'Student Processor',
     99    'Payment Processor', 'Student Processor',
    101100    'StudentStudyCourse Processor (update only)',
    102     'StudentStudyLevel Processor',
    103     'User Processor',
    104     'Verdict Processor (update only)']
     101    'StudentStudyLevel Processor', 'Verdict Processor (update only)']
    105102
    106103    >>> importerselect.getControl('Faculty Processor').selected = True
     
    178175
    179176    >>> import cStringIO
    180     >>> browser.getLink('Upload data').click()
     177    >>> browser.getLink('Upload CSV file').click()
    181178    >>> filecontents = cStringIO.StringIO(
    182179    ...   open('departments.csv', 'rb').read())
     
    187184Step 1: start batch processing:
    188185
    189     >>> browser.getLink('Process data').click()
     186    >>> browser.getLink('Batch processing').click()
    190187    >>> button = lookup_submit_value(
    191188    ...   'select', 'departments_zope.mgr.csv', browser)
     
    243240
    244241    >>> import cStringIO
    245     >>> browser.getLink('Upload data').click()
     242    >>> browser.getLink('Upload CSV file').click()
    246243    >>> filecontents = cStringIO.StringIO(
    247244    ...   open('courses.csv', 'rb').read())
     
    252249Step 1: start batch processing:
    253250
    254     >>> browser.getLink('Process data').click()
     251    >>> browser.getLink('Batch processing').click()
    255252    >>> button = lookup_submit_value(
    256253    ...   'select', 'courses_zope.mgr.csv', browser)
     
    308305
    309306    >>> import cStringIO
    310     >>> browser.getLink('Upload data').click()
     307    >>> browser.getLink('Upload CSV file').click()
    311308    >>> filecontents = cStringIO.StringIO(
    312309    ...   open('certificates.csv', 'rb').read())
     
    317314Step 1: start batch processing:
    318315
    319     >>> browser.getLink('Process data').click()
     316    >>> browser.getLink('Batch processing').click()
    320317    >>> button = lookup_submit_value(
    321318    ...   'select', 'certificates_zope.mgr.csv', browser)
     
    374371
    375372    >>> import cStringIO
    376     >>> browser.getLink('Upload data').click()
     373    >>> browser.getLink('Upload CSV file').click()
    377374    >>> filecontents = cStringIO.StringIO(
    378375    ...   open('mycertcourses.csv', 'rb').read())
     
    383380Step 1: start batch processing:
    384381
    385     >>> browser.getLink('Process data').click()
     382    >>> browser.getLink('Batch processing').click()
    386383    >>> button = lookup_submit_value(
    387384    ...   'select', 'mycertcourses_zope.mgr.csv', browser)
     
    423420    ...File:...mycertcourses_zope.mgr.csv...
    424421
    425 Batch processing users
    426 ======================
    427 
    428     >>> browser.open('http://localhost/app/datacenter')
    429 
    430 Prepare a CSV file for users:
    431 
    432     >>> open('users.csv', 'wb').write(
    433     ... """name,title,public_name,email,phone,roles
    434     ... uli,Uli Fouquet,Chief Developer,uli@abc.de,+49-234-567
    435     ... henrik,Henrik Bettermann,Admin,henrik@abc.de,+49-234-567,['waeup.PortalManager']
    436     ... """)
    437 
    438 Upload the file:
    439 
    440     >>> import cStringIO
    441     >>> browser.getLink('Upload data').click()
    442     >>> filecontents = cStringIO.StringIO(
    443     ...   open('users.csv', 'rb').read())
    444     >>> filewidget = browser.getControl(name='uploadfile:file')
    445     >>> filewidget.add_file(filecontents, 'text/plain', 'users.csv')
    446     >>> browser.getControl(name='SUBMIT').click()
    447 
    448 Step 1: start batch processing:
    449 
    450     >>> browser.getLink('Process data').click()
    451     >>> button = lookup_submit_value(
    452     ...   'select', 'users_zope.mgr.csv', browser)
    453     >>> button.click()
    454 
    455 Step 2: select a processor and mode:
    456 
    457     >>> importerselect = browser.getControl(name='importer')
    458     >>> importerselect.getControl('User Processor').selected = True
    459     >>> modeselect = browser.getControl(name='mode')
    460     >>> modeselect.getControl(value='create').selected = True
    461     >>> browser.getControl('Proceed to step 3').click()
    462 
    463 Step 3: Fix headerlines
    464 
    465 We get informed that there are no problems with the current header:
    466 
    467     >>> print browser.contents
    468     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    469     ...
    470     Header fields OK
    471     ...
    472 
    473 The submit button is enabled:
    474 
    475     >>> browser.getControl('Perform import').disabled
    476     False
    477 
    478     >>> browser.getControl('Perform import').click()
    479 
    480 Step 4: See import results
    481 
    482 The import was successful:
    483 
    484     >>> print browser.contents
    485     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    486     ...Successfully processed 2 rows...
    487     ...Batch processing finished...
    488     ...File:...users_zope.mgr.csv...
    489422
    490423Pending files
     
    511444
    512445    >>> import cStringIO
    513     >>> browser.getLink('Upload data').click()
     446    >>> browser.getLink('Upload CSV file').click()
    514447    >>> filecontents = cStringIO.StringIO(
    515448    ...   open('newfaculties.csv', 'rb').read())
     
    520453Step 1: start batch processing:
    521454
    522     >>> browser.getLink('Process data').click()
     455    >>> browser.getLink('Batch processing').click()
    523456    >>> button = lookup_submit_value(
    524457    ...   'select', 'newfaculties_zope.mgr.csv', browser)
     
    582515
    583516    >>> browser.open('http://localhost/app/datacenter')
    584     >>> browser.getLink('Process data').click()
     517    >>> browser.getLink('Batch processing').click()
    585518    >>> button = lookup_submit_value(
    586519    ...   'select', 'newfaculties_zope.mgr.create.pending.csv', browser)
     
    618551    >>> sorted(os.listdir(dc_path + '/finished'))
    619552    ['certificates_zope.mgr.create.finished.csv', ...,
    620     'users_zope.mgr.create.finished.csv', 'users_zope.mgr.csv']
    621 
    622 Processed (finished) Files
    623 ==========================
    624 
    625     >>> browser.open('http://localhost/app/datacenter/processed')
    626     >>> '<a href="download?filename=finished/certificates_zope.mgr.csv">' in browser.contents
    627     True
     553     'newfaculties_zope.mgr.create.finished.csv',
     554     'newfaculties_zope.mgr.csv']
     555
    628556
    629557Log Files
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/browser.txt

    r9209 r9211  
    8181  >>> browser.getControl(name="form.identifier").value = 'forgetful'
    8282  >>> browser.getControl(name="form.email").value = 'aa@aa.ng'
    83   >>> browser.getControl("Send login credentials").click()
     83  >>> browser.getControl("Get login credentials").click()
    8484  >>> print browser.contents
    8585  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     
    10001000with their code as key.
    10011001
    1002 Each certificate provides a ``Add certificate course`` action button near top.
     1002Each certificate provides a ``Add course referrer`` 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 certificate course').click()
     1008  >>> browser.getControl('Add course referrer').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 certificate course').click()
     1027  >>> browser.getControl('Add course referrer').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 certificate course').click()
     1040  >>> browser.getControl('Add course referrer').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 certificate course').click()
    1045   >>> 'The chosen certificate course is already' in browser.contents
     1044  >>> browser.getControl('Add course referrer').click()
     1045  >>> 'The chosen course referrer is already' in browser.contents
    10461046  True
    10471047
     
    10631063
    10641064  >>> browser.open(cert_url + '/COURSE1_100')
    1065   >>> browser.getLink('Edit certificate course').click()
     1065  >>> browser.getLink('Edit course referrer').click()
    10661066
    10671067If we just click 'Save and return' nothing will change:
     
    10881088changed:
    10891089
    1090   >>> browser.getLink('Edit certificate course').click()
     1090  >>> browser.getLink('Edit course referrer').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 certificate courses').click()
     1127  >>> browser.getControl('Remove selected course referrers').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 certificate courses').click()
     1132  >>> browser.getControl('Remove selected course referrers').click()
    11331133  >>> 'Successfully removed: COURSE1_200' in browser.contents
    11341134  True
     
    12181218page:
    12191219
    1220   >>> browser.getLink('Upload data').click()
     1220  >>> browser.getLink('Upload CSV file').click()
    12211221
    12221222and enter the appropriate data in the form:
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/layout.py

    r9209 r9211  
    191191    grok.baseclass()
    192192    template = default_waeup_display_template
    193     hide_hint = True
    194193
    195194class KofaEditFormPage(UtilityView,EditForm):
     
    216215        if self.widgets.get('perm_address'):
    217216            self.widgets['perm_address'].cssClass = 'span8'
    218             self.widgets['perm_address'].height = 6
    219         if self.widgets.get('next_kin_address'):
    220             self.widgets['next_kin_address'].cssClass = 'span8'
    221             self.widgets['next_kin_address'].height = 6
    222         if self.widgets.get('notice'):
    223             self.widgets['notice'].cssClass = 'span8'
    224             self.widgets['notice'].height = 6
     217            self.widgets['perm_address'].height = 10
    225218        if self.widgets.get('description'):
    226219            self.widgets['description'].cssClass = 'span12'
     
    313306        else:
    314307            return None
    315            
    316     def formatTZDate(self,datetimeobj):
    317         if isinstance(datetimeobj, datetime):
    318             tz = getUtility(IKofaUtils).tzinfo
    319             date = to_timezone(
    320                 datetimeobj, tz).strftime("%d/%m/%Y")
    321             return date
    322         else:
    323             return None         
    324308
    325309    def update(self):
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/pages.py

    r9209 r9211  
    1818""" Viewing components for Kofa objects.
    1919"""
     20import copy
    2021import csv
    2122import grok
     
    2324import re
    2425import sys
    25 from urllib import urlencode
     26import time
     27import re
    2628from zope import schema
    2729from zope.authentication.interfaces import (
     
    3234    getUtilitiesFor,
    3335    )
     36#from zope.component.interfaces import Invalid
    3437from zope.event import notify
    35 from zope.securitypolicy.interfaces import IPrincipalRoleManager
     38from zope.securitypolicy.interfaces import (
     39    IPrincipalRoleManager, IPrincipalRoleMap)
    3640from zope.session.interfaces import ISession
    37 from zope.password.interfaces import IPasswordManager
    3841from waeup.kofa.browser.layout import (
    3942    KofaPage, KofaForm, KofaEditFormPage, KofaAddFormPage,
     
    4649from waeup.kofa.browser.layout import jsaction, action, UtilityView
    4750from waeup.kofa.browser.resources import (
    48     warning, tabs, datatable)
     51    warning, datepicker, tabs, datatable, page_reloader, page_not_reloader)
    4952from waeup.kofa.interfaces import MessageFactory as _
    5053from waeup.kofa.interfaces import(
     
    6164from waeup.kofa.university.vocabularies import course_levels
    6265from waeup.kofa.authentication import LocalRoleSetEvent
     66#from waeup.kofa.widgets.restwidget import ReSTDisplayWidget
    6367from waeup.kofa.widgets.htmlwidget import HTMLDisplayWidget
    64 from waeup.kofa.utils.helpers import get_user_account
    65 from waeup.kofa.mandates.mandate import PasswordMandate
     68from waeup.kofa.authentication import get_principal_role_manager
     69from waeup.kofa.utils.helpers import get_user_account, msave
    6670
    6771grok.context(IKofaObject)
     
    152156    return
    153157
    154 # Save function used for save methods in pages
    155 def msave(view, **data):
    156     changed_fields = view.applyData(view.context, **data)
    157     # Turn list of lists into single list
    158     if changed_fields:
    159         changed_fields = reduce(lambda x,y: x+y, changed_fields.values())
    160     fields_string = ' + '.join(changed_fields)
    161     view.flash(_('Form has been saved.'))
    162     ob_class = view.__implemented__.__name__.replace('waeup.kofa.','')
    163     if fields_string:
    164         grok.getSite().logger.info('%s - %s - saved: %s' % (ob_class, view.context.__name__, fields_string))
    165     return
    166 
    167158#
    168159# Login/logout and language switch pages...
     
    201192                self.redirect(self.camefrom)
    202193                return
    203             # Display appropriate flash message if credentials are correct
    204             # but student has been deactivated.
    205             login = self.request.form['form.login']
    206             if len(login) == 8 and grok.getSite()['students'].has_key(login):
    207                 student = grok.getSite()['students'][
    208                     self.request.form['form.login']]
    209                 password = self.request.form['form.password']
    210                 passwordmanager = getUtility(IPasswordManager, 'SSHA')
    211                 if passwordmanager.checkPassword(student.password, password):
    212                     self.flash(_('Your account has been deactivated.'))
    213                     return
    214             self.flash(_('You entered invalid credentials.'))
     194            self.flash(_('You entered wrong credentials.'))
    215195
    216196
     
    392372    def entries(self):
    393373        return ()
     374
     375class ReindexPage(UtilityView, grok.View):
     376    """ Reindex view.
     377
     378    Reindexes a catalog. For managers only.
     379    """
     380    grok.context(IUniversity)
     381    grok.name('reindex')
     382    grok.require('waeup.managePortal')
     383
     384    def update(self,ctlg=None):
     385        if ctlg is None:
     386            self.flash('No catalog name provided.')
     387            return
     388        cat = queryUtility(ICatalog, name='%s_catalog' % ctlg)
     389        if cat is None:
     390            self.flash('%s_catalog does not exist' % ctlg)
     391            return
     392        self.context.logger.info(
     393            'Catalog `%s_catalog` re-indexing started.' % ctlg)
     394        cat.updateIndexes()
     395        no_of_entries = cat.values()[0].documentCount()
     396        self.flash('%d %s re-indexed.' % (no_of_entries,ctlg))
     397        self.context.logger.info(
     398            'Re-indexing of %d objects finished.' % no_of_entries)
     399        return
     400
     401    def render(self):
     402        self.redirect(self.url(self.context, '@@index'))
     403        return
    394404
    395405#
     
    791801    def delFiles(self, **data):
    792802        form = self.request.form
     803        logger = self.context.logger
    793804        if form.has_key('val_id'):
    794805            child_id = form['val_id']
     
    815826        return
    816827
    817 class DatacenterFinishedPage(KofaEditFormPage):
    818     grok.context(IDataCenter)
    819     grok.name('processed')
    820     grok.require('waeup.manageDataCenter')
    821     label = _(u'Processed Files')
    822     pnav = 0
    823 
    824     def update(self):
    825         datatable.need()
    826         return super(DatacenterFinishedPage, self).update()
    827 
    828828class DatacenterUploadPage(KofaPage):
    829829    grok.context(IDataCenter)
    830830    grok.name('upload')
    831831    grok.require('waeup.manageDataCenter')
    832     label = _(u'Upload portal data as CSV file')
     832    label = _(u'Upload file')
    833833    pnav = 0
    834834    upload_button =_(u'Upload')
     
    849849                self.flash(_("Only csv files are allowed."))
    850850                return
    851             normalized_filename = self.getNormalizedFileName(filename)
    852             finished_file = os.path.join(
    853                 self.context.storage, 'finished', normalized_filename)
    854             unfinished_file = os.path.join(
    855                 self.context.storage, 'unfinished', normalized_filename)
    856             if os.path.exists(finished_file) or os.path.exists(unfinished_file):
    857                 self.flash(_("File with same name was uploaded earlier."))
    858                 return
    859             target = os.path.join(self.context.storage, normalized_filename)
     851            target = os.path.join(self.context.storage,
     852                                  self.getNormalizedFileName(filename))
    860853            open(target, 'wb').write(uploadfile.read())
    861854            os.chmod(target, 0664)
     
    888881        return '%s_%s%s' % (base, filtered_username, ext.lower())
    889882
    890     def getImporters(self):
    891         importers = getAllUtilitiesRegisteredFor(IBatchProcessor)
    892         importer_props = []
    893         for x in importers:
    894             iface_fields = schema.getFields(x.iface)
    895             available_fields = []
    896             for key in iface_fields.keys():
    897                 iface_fields[key] = (iface_fields[key].__class__.__name__,
    898                     iface_fields[key].required)
    899             for value in x.available_fields:
    900                 available_fields.append(
    901                     dict(f_name=value,
    902                          f_type=iface_fields.get(value, (None, False))[0],
    903                          f_required=iface_fields.get(value, (None, False))[1]
    904                          )
    905                     )
    906             available_fields = sorted(available_fields, key=lambda k: k['f_name'])
    907             importer_props.append(
    908                 dict(title=x.name, name=x.util_name, fields=available_fields))
    909         return sorted(importer_props, key=lambda k: k['title'])
    910 
    911883class FileDownloadView(UtilityView, grok.View):
    912884    grok.context(IDataCenter)
     
    925897            'Content-Type', 'text/csv; charset=UTF-8')
    926898        self.response.setHeader(
    927             'Content-Disposition:', 'attachment; filename="%s' %
    928             self.filename.replace('finished/',''))
     899            'Content-Disposition:', 'attachment; filename="%s.csv' %
     900            self.filename.replace('.csv',''))
    929901        fullpath = os.path.join(self.context.storage, self.filename)
    930902        return open(fullpath, 'rb').read()
    931 
    932 class SkeletonDownloadView(UtilityView, grok.View):
    933     grok.context(IDataCenter)
    934     grok.name('skeleton')
    935     grok.require('waeup.manageDataCenter')
    936 
    937     def update(self, processorname=None):
    938         self.processorname = self.request.form['name']
    939         self.filename = ('%s_000.csv' %
    940             self.processorname.replace('processor','import'))
    941         return
    942 
    943     def render(self):
    944         #ob_class = self.__implemented__.__name__.replace('waeup.kofa.','')
    945         #self.context.logger.info(
    946         #    '%s - skeleton downloaded: %s' % (ob_class, self.filename))
    947         self.response.setHeader(
    948             'Content-Type', 'text/csv; charset=UTF-8')
    949         self.response.setHeader(
    950             'Content-Disposition:', 'attachment; filename="%s' % self.filename)
    951         processor = getUtility(IBatchProcessor, name=self.processorname)
    952         csv_data = processor.get_csv_skeleton()
    953         return csv_data
    954903
    955904class DatacenterImportStep1(KofaPage):
     
    965914
    966915    def getFiles(self):
    967         files = self.context.getPendingFiles(sort='date')
     916        files = self.context.getFiles(sort='date')
    968917        for file in files:
    969918            name = file.name
     
    11891138        return False
    11901139
     1140    @property
     1141    def nextstep(self):
     1142        return self.url(self.context, '@@import4')
     1143
    11911144    def update(self, headerfield=None, back2=None, cancel=None, proceed=None):
    11921145        datatable.need()
     
    14091362           string representing the exporter title used when triggering
    14101363           the export job.
     1364
     1365        Calling this method also installs a JavaScript page reloader
     1366        that reloads the page after some time (1.5 secs), if there is
     1367        a running export that is not completed yet.
     1368
     1369        The method caches results.
    14111370        """
    14121371        if self._running_exports is None:
     
    14161375    def _getRunningExports(self):
    14171376        result = self.context.get_export_jobs_status(self.user_id)
     1377        uncompleted = [x for x in result if x[0] != 'completed']
     1378        #if len(uncompleted):
     1379        #    page_reloader.need()
     1380        #else:
     1381        #    page_not_reloader.need()
    14181382        return result
    14191383
     
    14621426            return
    14631427        result = open(path, 'rb').read()
    1464         acronym = grok.getSite()['configuration'].acronym.replace(' ','')
    1465         filename = "%s_%s" % (acronym, os.path.basename(path))
    14661428        self.response.setHeader(
    14671429            'Content-Type', 'text/csv; charset=UTF-8')
    1468         self.response.setHeader(
    1469             'Content-Disposition', 'attachment; filename="%s' % filename)
    14701430        # remove job and running_exports entry from context
    14711431        self.context.delete_export_entry(
     
    20271987    grok.template('certificatemanagepage')
    20281988    taboneactions = [_('Save'),_('Cancel')]
    2029     tabtwoactions = [_('Add certificate course'),
    2030                      _('Remove selected certificate courses'),_('Cancel')]
     1989    tabtwoactions = [_('Add course referrer'),
     1990                     _('Remove selected course referrers'),_('Cancel')]
    20311991    tabthreeactions1 = [_('Remove selected local roles')]
    20321992    tabthreeactions2 = [_('Add local role')]
     
    20512011        return msave(self, **data)
    20522012
    2053     @jsaction(_('Remove selected certificate courses'))
     2013    @jsaction(_('Remove selected course referrers'))
    20542014    def delCertificateCourses(self, **data):
    20552015        delSubobjects(self, redirect='@@manage', tab='2')
    20562016        return
    20572017
    2058     @action(_('Add certificate course'), validator=NullValidator)
     2018    @action(_('Add course referrer'), validator=NullValidator)
    20592019    def addCertificateCourse(self, **data):
    20602020        self.redirect(self.url(self.context, 'addcertificatecourse'))
     
    20932053    form_fields = grok.AutoFields(ICertificateCourseAdd)
    20942054    pnav = 1
    2095     label = _('Add certificate course')
    2096 
    2097     @action(_('Add certificate course'))
     2055    label = _('Add course referrer')
     2056
     2057    @action(_('Add course referrer'))
    20982058    def addCertcourse(self, **data):
    20992059        try:
    2100             self.context.addCertCourse(**data)
     2060            self.context.addCourseRef(**data)
    21012061        except KeyError:
    2102             self.status = self.flash(_('The chosen certificate course is already '
     2062            self.status = self.flash(_('The chosen course referrer is already '
    21032063                                  'part of this certificate.'))
    21042064            return
    21052065        self.status = self.flash(
    2106             _("certificate course ${a}_${b} added.",
     2066            _("Course referrer ${a}_${b} added.",
    21072067            mapping = {'a': data['course'].code, 'b': data['level']}))
    21082068        code = "%s_%s" % (data['course'].code, data['level'])
     
    21452105    grok.require('waeup.manageAcademics')
    21462106    form_fields = grok.AutoFields(ICertificateCourse)
    2147     label = _('Edit certificate course')
     2107    label = _('Edit course referrer')
    21482108    pnav = 1
    21492109
     
    21582118            old_level = self.context.level
    21592119            data['course'] = self.context.course
    2160             parent.addCertCourse(**data)
    2161             parent.delCertCourse(data['course'].code, level=old_level)
     2120            parent.addCourseRef(**data)
     2121            parent.delCourseRef(data['course'].code, level=old_level)
    21622122            self.flash(_('Form has been saved.'))
    21632123            old_code = "%s_%s" % (data['course'].code, old_level)
     
    22182178        return None
    22192179
    2220     @action(_('Send login credentials to email address'), style='primary')
     2180    @action(_('Get login credentials'), style='primary')
    22212181    def request(self, **data):
    22222182        if not self.captcha_result.is_valid:
     
    22332193        # Change password
    22342194        kofa_utils = getUtility(IKofaUtils)
    2235         password = kofa_utils.genPassword()
    2236         mandate = PasswordMandate()
    2237         mandate.params['password'] = password
    2238         mandate.params['user'] = user
    2239         site = grok.getSite()
    2240         site['mandates'].addMandate(mandate)
    2241         # Send email with credentials
    2242         args = {'mandate_id':mandate.mandate_id}
    2243         mandate_url = self.url(site) + '/mandate?%s' % urlencode(args)
    2244         url_info = u'Confirmation link: %s' % mandate_url
    2245         msg = _('You have successfully requested a password for the')
     2195        pwd = kofa_utils.genPassword()
     2196        IUserAccount(user).setPassword(pwd)
     2197        # Send email with new redentials
     2198        msg = _('You have successfully changed your password for the')
     2199        login_url = self.url(grok.getSite(), 'login')
    22462200        success = kofa_utils.sendCredentials(
    2247             IUserAccount(user),password,url_info,msg)
     2201            IUserAccount(user),pwd,login_url,msg)
    22482202        if success:
    22492203            self.flash(_('An email with your user name and password ' +
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/pdf.py

    r9209 r9211  
    8383
    8484    Main things fixed here:
    85     If html code:
     85
    8686    - remove newlines (not visible in HTML but visible in PDF)
    8787    - add <br> tags after <div> (as divs break lines in HTML but not in PDF)
    88     If not html code:
    89     - just replace newlines by <br> tags
    9088    """
    91     if '</' in html:
    92         # Add br tag if widgets contain div tags
    93         # which are not supported by reportlab
    94         html = html.replace('</div>', '</div><br />')
    95         html = html.replace('\n', '')
    96     else:
    97         html = html.replace('\n', '<br />')
     89    # Add br tag if widgets contain div tags
     90    # which are not supported by reportlab
     91    html = html.replace('</div>', '</div><br />')
     92    html = html.replace('\n', '')
    9893    return html
    9994
     
    270265                                target_language=lang)
    271266            f_label = Paragraph(f_label, ENTRY1_STYLE)
    272             f_text = translate(widget(), domain, target_language=lang)
    273             f_text = format_html(f_text)
    274             if f_text:
    275                 hint = ' <font size=9>' + widget.hint + '</font>'
    276                 f_text = f_text + hint
     267            f_text = format_html(widget())
    277268            f_text = Paragraph(f_text, ENTRY1_STYLE)
    278269            table_data.append([f_label,f_text])
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/static/datatable.js

    r9209 r9211  
    11$(document).ready(function(){
    2   $('.dataTable').dataTable();
    3 
    4         $('.dataTableFiles').dataTable( {
    5                 "aaSorting": [[ 2, "desc" ]],
    6         } );
    7 
     2    $('.dataTable').dataTable();
    83        $('.dataTableManage').dataTable( {
    94                "aaSorting": [[ 1, "asc" ]],
    105                "aoColumnDefs":[{ "bSortable": false, "aTargets": [ 0 ] }]
    116        } );
    12 
    13         $('.dataTableManageFiles').dataTable( {
    14                 "aaSorting": [[ 3, "desc" ]],
    15                 "aoColumnDefs":[{ "bSortable": false, "aTargets": [ 0 ] }]
    16         } );
    17 
    18 
    197});
    208
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/static/jquery.dataTables.min.js

    r9209 r9211  
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    1616 * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
    17  *
    18  * Customized by Henrik Bettermann: this.aLengthMenu, this._iDisplayLength, this._iDisplayEnd
    19  *
    2017 */
    2118(function(j,ra,p){j.fn.dataTableSettings=[];var D=j.fn.dataTableSettings;j.fn.dataTableExt={};var n=j.fn.dataTableExt;n.sVersion="1.7.6";n.sErrMode="alert";n.iApiIndex=0;n.oApi={};n.afnFiltering=[];n.aoFeatures=[];n.ofnSearch={};n.afnSortData=[];n.oStdClasses={sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active",
     
    4138[];this.aoColumns=[];this.iNextId=0;this.asDataSearch=[];this.oPreviousSearch={sSearch:"",bRegex:false,bSmart:true};this.aoPreSearchCols=[];this.aaSorting=[[0,"asc",0]];this.aaSortingFixed=null;this.asStripClasses=[];this.asDestoryStrips=[];this.sDestroyWidth=0;this.fnFooterCallback=this.fnHeaderCallback=this.fnRowCallback=null;this.aoDrawCallback=[];this.fnInitComplete=null;this.sTableId="";this.nTableWrapper=this.nTBody=this.nTFoot=this.nTHead=this.nTable=null;this.bInitialised=false;this.aoOpenRows=
    4239[];this.sDom="lfrtip";this.sPaginationType="two_button";this.iCookieDuration=7200;this.sCookiePrefix="SpryMedia_DataTables_";this.fnCookieCallback=null;this.aoStateSave=[];this.aoStateLoad=[];this.sAjaxSource=this.oLoadedState=null;this.bAjaxDataGet=true;this.fnServerData=function(a,b,c){j.ajax({url:a,data:b,success:c,dataType:"json",cache:false,error:function(d,f){f=="parsererror"&&alert("DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})};
    43 this.fnFormatNumber=function(a){if(a<1E3)return a;else{var b=a+"";a=b.split("");var c="";b=b.length;for(var d=0;d<b;d++){if(d%3===0&&d!==0)c=","+c;c=a[b-d-1]+c}}return c};this.aLengthMenu=[10,25,50,100,1000,5000];this.bDrawing=this.iDraw=0;this.iDrawError=-1;this._iDisplayLength=1000;this._iDisplayStart=0;this._iDisplayEnd=1000;this._iRecordsDisplay=this._iRecordsTotal=0;this.bJUI=false;this.oClasses=n.oStdClasses;this.bSorted=this.bFiltered=false;this.oInit=null}function r(a){return function(){var b=[A(this[n.iApiIndex])].concat(Array.prototype.slice.call(arguments));
     40this.fnFormatNumber=function(a){if(a<1E3)return a;else{var b=a+"";a=b.split("");var c="";b=b.length;for(var d=0;d<b;d++){if(d%3===0&&d!==0)c=","+c;c=a[b-d-1]+c}}return c};this.aLengthMenu=[10,25,50,100,1000,5000];this.bDrawing=this.iDraw=0;this.iDrawError=-1;this._iDisplayLength=10;this._iDisplayStart=0;this._iDisplayEnd=10;this._iRecordsDisplay=this._iRecordsTotal=0;this.bJUI=false;this.oClasses=n.oStdClasses;this.bSorted=this.bFiltered=false;this.oInit=null}function r(a){return function(){var b=[A(this[n.iApiIndex])].concat(Array.prototype.slice.call(arguments));
    4441return n.oApi[a].apply(this,b)}}function s(a){var b,c;if(a.bInitialised===false)setTimeout(function(){s(a)},200);else{sa(a);U(a);K(a,true);a.oFeatures.bAutoWidth&&$(a);b=0;for(c=a.aoColumns.length;b<c;b++)if(a.aoColumns[b].sWidth!==null)a.aoColumns[b].nTh.style.width=v(a.aoColumns[b].sWidth);if(a.oFeatures.bSort)O(a);else{a.aiDisplay=a.aiDisplayMaster.slice();E(a);C(a)}if(a.sAjaxSource!==null&&!a.oFeatures.bServerSide)a.fnServerData.call(a.oInstance,a.sAjaxSource,[],function(d){for(b=0;b<d.aaData.length;b++)u(a,
    4542d.aaData[b]);a.iInitDisplayStart=a._iDisplayStart;if(a.oFeatures.bSort)O(a);else{a.aiDisplay=a.aiDisplayMaster.slice();E(a);C(a)}K(a,false);w(a,d)});else if(!a.oFeatures.bServerSide){K(a,false);w(a)}}}function w(a,b){a._bInitComplete=true;if(typeof a.fnInitComplete=="function")typeof b!="undefined"?a.fnInitComplete.call(a.oInstance,a,b):a.fnInitComplete.call(a.oInstance,a)}function y(a,b,c){o(a.oLanguage,b,"sProcessing");o(a.oLanguage,b,"sLengthMenu");o(a.oLanguage,b,"sEmptyTable");o(a.oLanguage,
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/templates/actionbutton.pt

    r9209 r9211  
    11<a class="btn actionbar" tal:condition="viewlet/target_url"
    2    tal:attributes="href viewlet/target_url; onclick viewlet/onclick">
     2   tal:attributes="href viewlet/target_url">
    33  <img src="" alt="edit"
    44   tal:attributes="src viewlet/icon_url;
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/templates/certificatemanagepage.pt

    r9209 r9211  
    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="">Certificate Courses</a></li>
     6    <li tal:attributes="class view/tab2"><a href="#tab-2" i18n:translate="">Course Referrers</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>
    27         <span tal:content="context/__name__">Code</span>
    28         <span i18n:domain="waeup.kofa" i18n:translate="">Courses</span>
    29       </h3>
     26      <h3 i18n:translate="">Course Referrers</h3>
    3027      <table class="display dataTableManage">
    3128        <thead>
    3229          <tr>
    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>
     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>
    3933            <th i18n:translate="">Mandatory</th>
    4034          </tr>
     
    4337          <tr tal:repeat="cc context/values" class="gradeC">
    4438             <td>
    45               <input type="checkbox" name="val_id"
     39              <input type="checkbox"
     40                         name="val_id"
    4641                         tal:attributes="value cc/__name__" />
    4742            </td>
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/templates/certificatepage.pt

    r9209 r9211  
    2020<h3>
    2121  <span tal:content="context/__name__">Code</span>
    22   <span i18n:domain="waeup.kofa" i18n:translate="">Courses</span>
     22  <span i18n:domain="waeup.kofa" i18n:translate="">Course Referrers</span>
    2323</h3>
    2424<br />
     
    2626<thead>
    2727  <tr>
    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>
     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>
    3431  </tr>
    3532</thead>
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/templates/datacenterpage.pt

    r9209 r9211  
    1111<form action="." tal:attributes="action request/URL" method="post"
    1212      i18n:domain="waeup.kofa" enctype="multipart/form-data">
    13     <table i18n:domain="waeup.kofa" class="display dataTableManageFiles">
     13    <table i18n:domain="waeup.kofa" class="display dataTableManage">
    1414      <thead>
    1515        <tr>
    1616          <th></th>
    1717          <th i18n:translate="">File</th>
    18           <th i18n:translate="">Datasets</th>
     18          <th i18n:translate="">Size</th>
    1919          <th i18n:translate="">Upload Date</th>
    2020        </tr>
    2121      </thead>
    2222      <tbody>
    23         <tr tal:repeat="file context/getPendingFiles" class="gradeC">
     23        <tr tal:repeat="file context/getFiles" class="gradeC">
    2424          <td>
    2525            <input type="checkbox" name="val_id"
     
    2828          <td><a tal:attributes="href python: 'download?filename=' + file.name"
    2929                 tal:content="file/name">FILENAME</a></td>
    30           <td tal:content="python: file.lines - 1">100</td>
     30          <td tal:content="file/size">12 k</td>
    3131          <td tal:content="file/uploaddate">Mar 12, 2008</td>
    3232        </tr>
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/templates/datacenteruploadpage.pt

    r9209 r9211  
    99  </div>
    1010</form>
    11 
    12 <br /><br />
    13 
    14 <h2 i18n:translate="">Available Processors (Importers)</h2>
    15 
    16 <table i18n:domain="waeup.kofa">
    17   <thead>
    18     <tr>
    19       <th i18n:translate="">Processor</th>
    20       <th i18n:translate="">Required Schema Fields</th>
    21       <th i18n:translate="">Optional Schema Fields</th>
    22       <th i18n:translate="">Non-Schema Fields</th>
    23       <th i18n:translate="">CSV Skeleton File</th>
    24     </tr>
    25   </thead>
    26   <tr tal:repeat="importer view/getImporters">
    27     <td tal:content="importer/title"></td>
    28     <td nowrap>
    29       <span tal:repeat="field importer/fields">
    30           <tal:schemafield condition="field/f_type">
    31             <tal:required condition="field/f_required">
    32               <span tal:replace="field/f_name"></span>
    33               (<span tal:replace="field/f_type"></span>)
    34               <br />
    35             </tal:required>
    36           </tal:schemafield>
    37       </span>
    38     </td>
    39     <td nowrap>
    40       <span tal:repeat="field importer/fields">
    41           <tal:schemafield condition="field/f_type">
    42             <tal:notrequired condition="not:field/f_required">
    43               <span tal:replace="field/f_name"></span>
    44               (<span tal:replace="field/f_type"></span>)
    45               <br />
    46             </tal:notrequired>
    47           </tal:schemafield>
    48       </span>
    49     </td>
    50     <td>
    51       <span tal:repeat="field importer/fields">
    52           <tal:extrafield condition="not:field/f_type">
    53             <span tal:replace="field/f_name"></span>
    54             <br />
    55           </tal:extrafield>
    56       </span>
    57     </td>
    58 
    59     <td>
    60       <a i18n:translate=""
    61          tal:attributes="href python: 'skeleton?name=' + importer['name']">Download</a>
    62     </td>
    63   </tr>
    64 </table>
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/templates/loginpage.pt

    r9209 r9211  
    3737    If you are having trouble logging in, make sure to enable  cookies in your web browser.
    3838  </p>
    39   <p i18n:translate="login_trouble2" tal:condition="python:False">
     39  <p i18n:translate="login_trouble2">
    4040    You don't have an account because you are a fresh student, or your student record has just been created?
    41     Acquire a Password Activation Code (PWD) and inititialize your student account
    42     <strong><a href ="setpassword"> here</a></strong>.
    43   </p>
    44   <p i18n:translate="login_trouble4">
    45     You don't have an account because you are a fresh student, or your student record has just been created?
    46     Inititialize your student account <strong><a href="requestpw"> here</a></strong>.
     41    Acquire a Password Access Code (PWD) and inititialize your student account
     42    <strong><a href  ="setpassword"> here</a></strong>.
    4743  </p>
    4844  <p i18n:translate="login_trouble3"> Or simply forgot your student id, application id or password? Then request a new password
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/templates/widgets.pt

    r9209 r9211  
    1818        <div tal:content="structure widget/error">ERROR</div>
    1919      </tal:error>
    20       <tal:hint
    21         tal:condition="python: widget.hint and not getattr(view,'hide_hint',False)">
     20      <tal:hint tal:condition="widget/hint">
    2221        <div class="hint" tal:content="structure widget/hint">HINT</div>
    2322      </tal:hint>
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/tests/test_browser.py

    r9209 r9211  
    2121import shutil
    2222import tempfile
     23import pytz
     24from datetime import datetime, timedelta
     25from StringIO import StringIO
    2326import os
     27import grok
    2428from zc.async.testing import wait_for_result
    25 from zope.component import createObject, getUtility
     29from zope.event import notify
     30from zope.component import createObject, queryUtility, getUtility
    2631from zope.component.hooks import setSite, clearSite
     32from zope.catalog.interfaces import ICatalog
    2733from zope.security.interfaces import Unauthorized
     34from zope.securitypolicy.interfaces import IPrincipalRoleManager
    2835from zope.testbrowser.testing import Browser
     36from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState
    2937from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase
    3038from waeup.kofa.app import University
     
    3341from waeup.kofa.university.faculty import Faculty
    3442from waeup.kofa.university.department import Department
     43
     44
     45
    3546
    3647SAMPLE_FILE = os.path.join(os.path.dirname(__file__), 'test_file.csv')
     
    7990        self.app['faculties']['fac1']['dep1'].courses.addCourse(
    8091            self.course)
    81         self.app['faculties']['fac1']['dep1'].certificates['CERT1'].addCertCourse(
     92        self.app['faculties']['fac1']['dep1'].certificates['CERT1'].addCourseRef(
    8293            self.course, level=100)
    8394
     
    116127        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    117128        self.assertEqual(self.browser.url, self.datacenter_path)
    118         self.browser.getLink("Upload data").click()
     129        self.browser.getLink("Upload CSV file").click()
    119130        file = open(SAMPLE_FILE)
    120131        ctrl = self.browser.getControl(name='uploadfile:file')
     
    170181        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    171182        self.assertEqual(self.browser.url, self.datacenter_path)
    172         self.browser.getLink("Export data").click()
     183        self.browser.getLink("Export CSV file").click()
    173184        self.browser.getControl(name="exporter").value = ['faculties']
    174185        self.browser.getControl("Create CSV file").click()
     
    193204        # ...we can download the result
    194205        self.browser.getControl("Download").click()
    195         self.assertEqual(self.browser.headers['content-type'],
     206        self.assertEqual(self.browser.headers['Content-Type'],
    196207                         'text/csv; charset=UTF-8')
    197         self.assertEqual(self.browser.headers['content-disposition'],
    198                          'attachment; filename="WAeUP.Kofa_faculties.csv')
    199208        self.assertEqual(self.browser.contents,
    200             'code,title,title_prefix,users_with_local_roles\r\n'
    201             'fac1,Unnamed Faculty,faculty,[]\r\n')
     209            'code,title,title_prefix\r\nfac1,Unnamed Faculty,faculty\r\n')
    202210
    203211        # after download, the job and the result file are removed
     
    221229        self.assertTrue('Discarded export result' in self.browser.contents)
    222230        return
    223 
    224     def test_skeleton_download(self):
    225         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    226         self.browser.open(self.datacenter_path)
    227         self.browser.getLink("Upload data").click()
    228         self.assertTrue(
    229             '<a href="skeleton?name=facultyprocessor">Download</a>'
    230             in self.browser.contents)
    231         self.browser.getLink(url='skeleton?name=facultyprocessor').click()
    232         self.assertEqual(self.browser.headers['Status'], '200 Ok')
    233         self.assertEqual(self.browser.headers['Content-Type'],
    234                          'text/csv; charset=UTF-8')
    235         self.assertEqual(self.browser.contents,
    236             'code,local_roles,title,title_prefix\r\n')
    237         return
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/tests/test_permissions.py

    r9209 r9211  
    9191        cert.code = 'cert1'
    9292        dept.certificates.addCertificate(cert)
    93         cert.addCertCourse(course)
     93        cert.addCourseRef(course)
    9494
    9595        self.browser = Browser()
  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/viewlets.py

    r9209 r9211  
    6666    """A base for action buttons.
    6767
    68     An action button provides an icon, some text, links to a
    69     target and optionally an onclick event handler.
    70     If you want to set a different text, icon or target name
     68    An action button provides an icon, some text and links to a
     69    target.  If you want to set a different text, icon or target name
    7170    for some active button below, just override the approriate
    7271    attribute in the concerned viewlet.
     
    8382     * ``target_url``
    8483          The URL of the link target.
    85 
    86      * ``onclick``
    87           An onclick Javascript event handler.
    8884
    8985    """
     
    147143        return self.view.url(self.view.context, self.target)
    148144
    149     @property
    150     def onclick(self):
    151         """Onclick event...
    152         """
    153         return
    154 
    155145class PlainActionButton(ActionButton):
    156146    """A base for action buttons without image
     
    396386    grok.require('waeup.manageDataCenter')
    397387    text = _('Edit settings')
    398     grok.order(1)
    399388
    400389class ManageFacultiesContainerActionButton(ManageActionButton):
     
    467456    grok.context(ICertificateCourse)
    468457    grok.view(CertificateCoursePage)
    469     text = _('Edit certificate course')
     458    text = _('Edit course referrer')
     459
     460#
     461# Add actions...
     462#
    470463
    471464class AddUserActionButton(AddActionButton):
     
    475468    text = _('Add user')
    476469
    477 class BrowseDatacenterLogs(ActionButton):
     470#
     471# Actions with a 'browse' icon...
     472#
     473class BrowseActionButton(ActionButton):
     474    grok.baseclass()
     475    grok.context(IKofaObject)
     476    grok.template('actionbutton')
     477    grok.viewletmanager(ActionBar)
     478    grok.require('waeup.manageDataCenter')
     479    icon = 'actionicon_manage.png' # File must exist in static/
     480    target = '@@show' # link to this viewname.
     481    text = _('Show logs') # Text to display on the button
     482
     483class BrowseDatacenterLogs(BrowseActionButton):
    478484    grok.context(IDataCenter)
    479     grok.require('waeup.manageDataCenter')
    480485    grok.view(DatacenterPage)
    481     grok.order(2)
     486    grok.order(4)
    482487    icon = 'actionicon_info.png'
    483488    target = '@@logs'
    484489    text = _('Show logs')
     490
     491#
     492# Misc. buttons...
     493#
     494class BatchOpButton(ActionButton):
     495    grok.context(IDataCenter)
     496    grok.view(DatacenterPage)
     497    grok.require('waeup.importData')
     498    grok.order(6)
     499    icon = 'actionicon_gear.png'
     500    target = '@@import1'
     501    text = _('Batch processing')
    485502
    486503class UploadCSVButton(ActionButton):
     
    488505    grok.view(DatacenterPage)
    489506    grok.require('waeup.manageDataCenter')
    490     grok.order(3)
     507    grok.order(5)
    491508    icon = 'actionicon_up.png'
    492509    target = '@@upload'
    493     text = _('Upload data')
    494 
    495 class BatchOpButton(ActionButton):
    496     grok.context(IDataCenter)
    497     grok.view(DatacenterPage)
    498     grok.require('waeup.importData')
    499     grok.order(4)
    500     icon = 'actionicon_gear.png'
    501     target = '@@import1'
    502     text = _('Process data')
     510    text = _('Upload CSV file')
    503511
    504512class ExportCSVButton(ActionButton):
     
    506514    grok.view(DatacenterPage)
    507515    grok.require('waeup.manageDataCenter')
    508     grok.order(5)
     516    grok.order(7)
    509517    icon = 'actionicon_down.png'
    510518    target = '@@export'
    511     text = _('Export data')
    512 
    513 class BrowseFinishedFiles(ActionButton):
    514     grok.context(IDataCenter)
    515     grok.require('waeup.manageDataCenter')
    516     grok.view(DatacenterPage)
    517     grok.order(6)
    518     icon = 'actionicon_finished.png'
    519     target = '@@processed'
    520     text = _('View processed files')
     519    text = _('Export CSV file')
    521520
    522521#
Note: See TracChangeset for help on using the changeset viewer.