Ignore:
Timestamp:
9 Dec 2014, 16:45:52 (10 years ago)
Author:
Henrik Bettermann
Message:

Remove session configuration. We do not have sessions in Ikoba.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/browser/pages.py

    r11979 r12186  
    5353    IIkobaXMLImporter, IIkobaXMLExporter, IBatchProcessor,
    5454    ILocalRolesAssignable, DuplicationError, IConfigurationContainer,
    55     ISessionConfiguration, ISessionConfigurationAdd, IJobManager,
    56     IPasswordValidator, IContactForm, IIkobaUtils, ICSVExporter,
    57     application_sessions_vocab)
     55    IJobManager,
     56    IPasswordValidator, IContactForm, IIkobaUtils, ICSVExporter)
    5857from waeup.ikoba.permissions import (
    5958    get_users_with_local_roles, get_all_roles, get_all_users,
     
    743742    grok.name('index')
    744743    grok.context(IConfigurationContainer)
    745     grok.template('configurationmanagepage')
    746744    pnav = 0
    747745    label = _(u'Edit portal configuration')
    748     taboneactions = [_('Save'), _('Update plugins')]
    749     tabtwoactions = [
    750         _('Add session configuration'),
    751         _('Remove selected')]
    752746    form_fields = grok.AutoFields(IConfigurationContainer).omit(
    753747        'frontpage_dict')
     
    763757        msave(self, **data)
    764758        self.context.frontpage_dict = self._frontpage()
    765         return
    766 
    767     @action(_('Add session configuration'), validator=NullValidator,
    768             style='primary')
    769     def addSubunit(self, **data):
    770         self.redirect(self.url(self.context, '@@add'))
    771         return
    772 
    773     def getSessionConfigurations(self):
    774         """Get a list of all stored session configuration objects.
    775         """
    776         for key, val in self.context.items():
    777             url = self.url(val)
    778             session_string = val.getSessionString()
    779             title = _('Session ${a} Configuration',
    780                       mapping = {'a':session_string})
    781             yield(dict(url=url, name=key, title=title))
    782 
    783     @jsaction(_('Remove selected'))
    784     def delSessonConfigurations(self, **data):
    785         delSubobjects(self, redirect='@@index', tab='2')
    786759        return
    787760
     
    794767        grok.getSite().updatePlugins()
    795768        self.flash(_('Plugins were updated. See log file for details.'))
    796         return
    797 
    798 class SessionConfigurationAddFormPage(IkobaAddFormPage):
    799     """Add a session configuration object to configuration container.
    800     """
    801     grok.context(IConfigurationContainer)
    802     grok.name('add')
    803     grok.require('waeup.managePortalConfiguration')
    804     label = _('Add session configuration')
    805     form_fields = grok.AutoFields(ISessionConfigurationAdd)
    806     pnav = 0
    807 
    808     @action(_('Add Session Configuration'), style='primary')
    809     def addSessionConfiguration(self, **data):
    810         sessionconfiguration = createObject(u'waeup.SessionConfiguration')
    811         self.applyData(sessionconfiguration, **data)
    812         try:
    813             self.context.addSessionConfiguration(sessionconfiguration)
    814             ob_class = self.__implemented__.__name__.replace('waeup.ikoba.','')
    815             self.context.__parent__.logger.info(
    816                 '%s - added: %s' % (
    817                 ob_class, sessionconfiguration.application_session))
    818         except KeyError:
    819             self.flash(_('The session chosen already exists.'), type='danger')
    820             return
    821         self.redirect(self.url(self.context, '@@index')+'#tab2')
    822         return
    823 
    824     @action(_('Cancel'), validator=NullValidator)
    825     def cancel(self):
    826         self.redirect(self.url(self.context, '@@index')+'#tab2')
    827         return
    828 
    829 class SessionConfigurationManageFormPage(IkobaEditFormPage):
    830     """Manage session configuration object.
    831     """
    832     grok.context(ISessionConfiguration)
    833     grok.name('index')
    834     grok.require('waeup.managePortalConfiguration')
    835     form_fields = grok.AutoFields(ISessionConfiguration)
    836     pnav = 0
    837 
    838     @property
    839     def label(self):
    840         session_string = self.context.getSessionString()
    841         return _('Edit academic session ${a} configuration',
    842             mapping = {'a':session_string})
    843 
    844     @action(_('Save'), style='primary')
    845     def save(self, **data):
    846         msave(self, **data)
    847         self.redirect(self.url(self.context.__parent__, '@@index')+'#tab2')
    848         return
    849 
    850     @action(_('Cancel'), validator=NullValidator)
    851     def cancel(self):
    852         self.redirect(self.url(self.context.__parent__, '@@index')+'#tab2')
    853769        return
    854770
Note: See TracChangeset for help on using the changeset viewer.