Ignore:
Timestamp:
20 Sep 2012, 08:49:37 (12 years ago)
Author:
uli
Message:

Merge changes from update branch (includes trunk changes until r9107).

Location:
main/waeup.kofa/branches/uli-zc-async
Files:
2 edited

Legend:

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

  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/browser/viewlets.py

    r8387 r9209  
    6666    """A base for action buttons.
    6767
    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
     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
    7071    for some active button below, just override the approriate
    7172    attribute in the concerned viewlet.
     
    8283     * ``target_url``
    8384          The URL of the link target.
     85
     86     * ``onclick``
     87          An onclick Javascript event handler.
    8488
    8589    """
     
    143147        return self.view.url(self.view.context, self.target)
    144148
     149    @property
     150    def onclick(self):
     151        """Onclick event...
     152        """
     153        return
     154
    145155class PlainActionButton(ActionButton):
    146156    """A base for action buttons without image
     
    386396    grok.require('waeup.manageDataCenter')
    387397    text = _('Edit settings')
     398    grok.order(1)
    388399
    389400class ManageFacultiesContainerActionButton(ManageActionButton):
     
    456467    grok.context(ICertificateCourse)
    457468    grok.view(CertificateCoursePage)
    458     text = _('Edit course referrer')
    459 
    460 #
    461 # Add actions...
    462 #
     469    text = _('Edit certificate course')
    463470
    464471class AddUserActionButton(AddActionButton):
     
    468475    text = _('Add user')
    469476
    470 #
    471 # Actions with a 'browse' icon...
    472 #
    473 class BrowseActionButton(ActionButton):
    474     grok.baseclass()
    475     grok.context(IKofaObject)
    476     grok.template('actionbutton')
    477     grok.viewletmanager(ActionBar)
     477class BrowseDatacenterLogs(ActionButton):
     478    grok.context(IDataCenter)
    478479    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 
    483 class BrowseDatacenterLogs(BrowseActionButton):
    484     grok.context(IDataCenter)
    485480    grok.view(DatacenterPage)
    486     grok.order(4)
     481    grok.order(2)
    487482    icon = 'actionicon_info.png'
    488483    target = '@@logs'
    489484    text = _('Show logs')
    490485
    491 #
    492 # Misc. buttons...
    493 #
     486class UploadCSVButton(ActionButton):
     487    grok.context(IDataCenter)
     488    grok.view(DatacenterPage)
     489    grok.require('waeup.manageDataCenter')
     490    grok.order(3)
     491    icon = 'actionicon_up.png'
     492    target = '@@upload'
     493    text = _('Upload data')
     494
    494495class BatchOpButton(ActionButton):
    495496    grok.context(IDataCenter)
    496497    grok.view(DatacenterPage)
    497498    grok.require('waeup.importData')
    498     grok.order(6)
     499    grok.order(4)
    499500    icon = 'actionicon_gear.png'
    500501    target = '@@import1'
    501     text = _('Batch processing')
    502 
    503 class UploadCSVButton(ActionButton):
     502    text = _('Process data')
     503
     504class ExportCSVButton(ActionButton):
    504505    grok.context(IDataCenter)
    505506    grok.view(DatacenterPage)
    506507    grok.require('waeup.manageDataCenter')
    507508    grok.order(5)
    508     icon = 'actionicon_up.png'
    509     target = '@@upload'
    510     text = _('Upload CSV file')
    511 
    512 class ExportCSVButton(ActionButton):
    513     grok.context(IDataCenter)
    514     grok.view(DatacenterPage)
    515     grok.require('waeup.manageDataCenter')
    516     grok.order(7)
    517509    icon = 'actionicon_down.png'
    518510    target = '@@export'
    519     text = _('Export CSV file')
     511    text = _('Export data')
     512
     513class 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')
    520521
    521522#
Note: See TracChangeset for help on using the changeset viewer.