Ignore:
Timestamp:
31 Jan 2014, 09:14:41 (11 years ago)
Author:
Henrik Bettermann
Message:

Remove resources and theming completely.

Location:
main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/browser
Files:
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/browser/async.py

    r9217 r11016  
    44from waeup.kofa.async import IJob, IJobManager
    55from waeup.kofa.browser.layout import KofaPage
    6 from waeup.kofa.browser.resources import jquery, loadbar
    76from waeup.kofa.interfaces import IKofaObject, IDataCenter
    87from waeup.kofa.interfaces import MessageFactory as _
     
    5150        self.exports = self.getRunningExports()
    5251        self.uncompleted = [x for x in self.exports if x[0] != 'completed']
    53         loadbar.need()
    5452
    5553    def render(self):
     
    126124
    127125    def update(self, START_NEW=None, REMOVE=None, job_id=None):
    128         jquery.need()
    129126        if REMOVE and job_id:
    130127            self.context.remove(job_id)
  • main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/browser/browser.txt

    r11001 r11016  
    3030  >>> browser = Browser()
    3131
    32 Let's get the default view of a university and see if the
    33 favicon is properly referenced::
     32Let's get the default view of a university::
    3433
    3534  >>> browser.open('http://localhost/myuniversity')
    3635  >>> print browser.contents
    3736  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
    38   ...href="http://localhost/myuniversity/@@/waeup_kofa/favicon.ico"
    3937  ...Welcome to WAeUP.Kofa...
    4038  ...
     
    102100
    103101  >>> 'Sample University' in browser.contents
    104   True
    105 
    106 The edit form contains the default value for the portal skin::
    107 
    108   >>> 'waeup-base.css' in browser.contents
    109102  True
    110103
  • main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/browser/captcha.py

    r9217 r11016  
    2828from zope.interface import Interface
    2929from zope.publisher.interfaces.http import IHTTPRequest
    30 from waeup.kofa.browser import resources
    3130from waeup.kofa.browser.layout import KofaPage
    3231from waeup.kofa.browser.interfaces import (
     
    229228    #: name of challenge field in HTTP request
    230229    chal_field = 'recaptcha_challenge_field'
    231     #: resource to set theme and other options
    232     theme = resources.recaptcha_white
    233230
    234231    # Do not use the following keys in productive environments!  As
     
    294291        form).
    295292        """
    296         if self.theme is not None:
    297             self.theme.need()
    298293        error_param = ''
    299294        if error_code:
  • main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/browser/interfaces.py

    r10685 r11016  
    5959        """Get the list of breadcrumbs as real Python list.
    6060        """
    61 class ITheme(Interface):
    62     """An theme or 'skin'.
    63 
    64     Themes are basically collections of CSS- and/or JavaScript files
    65     stored somewhere. In Grok-contexts these files can be registered
    66     as 'resources' (see :mod:`waeup.kofa.browser.resources`).
    67 
    68     Furthermore, to make themes selectable and distinctable from each
    69     other we assign them short descriptions.
    70 
    71     Themes should be registered as named utilities so that they can be
    72     defined also in third-party packages and be looked up by other
    73     components like theme-selectors.
    74     """
    75     description = schema.TextLine(
    76         title = u'Description',
    77         description = u'Short description of the theme for choice fields',
    78         required = False,
    79         )
    80 
    81     def getResources():
    82         """Get resources of the theme.
    83 
    84         Deliver a list of resources that must be included in a web page to
    85         let it be rendered in the theme's style.
    86 
    87         A resource is normally defined in the `resources` module. If a
    88         theme needs several of them which normally do not depend on
    89         each other then all these resources can be returned by this
    90         method. Normally, you will only return one resource.
    91 
    92         These resources will (if the theme is selected) be `need()`-ed
    93         by the `update()` method of the general site layout.
    94         """
    95 
    9661class ICaptchaRequest(Interface):
    9762    """A set of data required to verify captcha solutions.
  • main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/browser/layout.py

    r10999 r11016  
    2626from zope.i18n import translate
    2727from zope.i18nmessageid import Message
    28 from hurry.resource import mode
    2928from megrok.layout import Page, Layout, Form, EditForm, DisplayForm, AddForm
    3029from z3c.flashmessage.interfaces import IMessageSource, IMessageReceiver
     
    3736from waeup.kofa.utils.helpers import to_timezone
    3837from waeup.kofa.browser.interfaces import (
    39     ITheme, IStudentNavigationBase, IApplicantBase)
    40 from waeup.kofa.browser.theming import get_all_themes, KofaThemeBase
     38    IStudentNavigationBase, IApplicantBase)
    4139from waeup.kofa.authentication import get_principal_role_manager
    4240
     
    114112        msg = translate(self.msg, context=self.form.request)
    115113        return ('<input type="submit" id="%s" name="%s" value="%s"'
    116                 ' class="btn btn-%s" onclick="return confirmPost(%s)" />' %
     114                ' class="btn btn-%s" onclick="return window.confirm(%s)" />' %
    117115                (self.__name__, self.__name__, escape(label, quote=True),
    118116                 self.style, msg)
     
    230228
    231229    #: An instance of the default theme to use for the site layout
    232     default_theme = KofaThemeBase()
    233230    stafftemp = grok.PageTemplateFile('templates/staffsitelayout.pt')
    234231    studenttemp = grok.PageTemplateFile('templates/studentsitelayout.pt')
     
    310307            return None         
    311308
    312     def update(self):
    313         """Include the resources required by the chosen skin/theme.
    314 
    315         University instances provide a 'skin' attribute, that should
    316         hold the internal name of a theme.
    317 
    318         A theme in the waeup.kofa sense consists of a list of
    319         CSS/JavaScript resources defined in the
    320         :mod:`waeup.kofa.browser.resources` module.
    321 
    322         If the context University object has no such attribute or the
    323         set value is not a valid theme name, we pick 'gray waeup
    324         theme' as default.
    325         """
    326         mode('minified')
    327         theme_name = getattr(grok.getSite()['configuration'], 'skin', '')
    328         theme = queryUtility(ITheme, name=theme_name,
    329                              default=self.default_theme)
    330         for resource in theme.getResources():
    331             resource.need()
    332         return
    333 
    334309    def render(self):
    335310        if self.isStudent() or self.isApplicant() or not self.isAuthenticated():
  • main/waeup.kofa/branches/uli-diazo-themed/src/waeup/kofa/browser/pages.py

    r11008 r11016  
    5151    ICaptchaManager, IChangePassword)
    5252from waeup.kofa.browser.layout import jsaction, action, UtilityView
    53 from waeup.kofa.browser.resources import (
    54     warning, tabs)
    5553from waeup.kofa.interfaces import MessageFactory as _
    5654from waeup.kofa.interfaces import(
     
    790788        'frontpage_dict')
    791789
    792     def update(self):
    793         warning.need()
    794         return super(ConfigurationContainerManageFormPage, self).update()
    795 
    796790    def _frontpage(self):
    797791        view = ConfigurationContainerDisplayFormPage(
     
    900894    label = _(u'Data Center')
    901895    pnav = 0
    902 
    903     def update(self):
    904         warning.need()
    905         return super(DatacenterPage, self).update()
    906896
    907897    @jsaction(_('Remove selected'))
     
    17231713        return _('Manage academic section')
    17241714
    1725     def update(self):
    1726         warning.need()
    1727         return super(FacultiesContainerManageFormPage, self).update()
    1728 
    17291715    @jsaction(_('Remove selected'))
    17301716    def delFaculties(self, **data):
     
    18121798    def label(self):
    18131799        return _('Manage faculty')
    1814 
    1815     def update(self):
    1816         warning.need()
    1817         return super(FacultyManageFormPage, self).update()
    18181800
    18191801    @jsaction(_('Remove selected'))
     
    19951977            url = self.url(val)
    19961978            yield(dict(url=url, name=key, container=val))
    1997 
    1998     def update(self):
    1999         warning.need()
    2000         super(DepartmentManageFormPage, self).update()
    2001         return
    20021979
    20031980    @action(_('Save'), style='primary')
     
    21582135    form_fields = grok.AutoFields(ICourse).omit('code')
    21592136
    2160     def update(self):
    2161         warning.need()
    2162         return super(CourseManageFormPage, self).update()
    2163 
    21642137    @action(_('Save'), style='primary')
    21652138    def save(self, **data):
     
    22222195    def label(self):
    22232196        return _('Manage certificate')
    2224 
    2225     def update(self):
    2226         warning.need()
    2227         return super(CertificateManageFormPage, self).update()
    22282197
    22292198    @action(_('Save'), style='primary')
Note: See TracChangeset for help on using the changeset viewer.