~schooltool-owners/schooltool.peas/packaging

« back to all changes in this revision

Viewing changes to src/schooltool/peas/browser/skin.py

  • Committer: Douglas Cerna
  • Date: 2015-02-17 08:43:21 UTC
  • mfrom: (9.1.28 schooltool.peas)
  • Revision ID: douglascerna@yahoo.com-20150217084321-l9mgb9oifyhjgs93
New release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
from zope.cachedescriptors.property import Lazy
23
23
from zope.i18n.interfaces.locales import ICollator
 
24
from z3c.form import converter
24
25
import zc.resourcelibrary
25
26
 
26
27
from schooltool.group.interfaces import IGroupContainer
30
31
from schooltool.skin import flourish
31
32
 
32
33
 
33
 
class HTMLHeadViewletManager(flourish.viewlet.ViewletManager):
 
34
class CustomCSSViewlet(flourish.viewlet.Viewlet):
34
35
 
35
36
    def update(self):
36
 
        zc.resourcelibrary.need('schooltool.flourish.custom')
37
 
        super(HTMLHeadViewletManager, self).update()
38
 
 
39
 
 
40
 
class CustomCSSViewlet(flourish.viewlet.Viewlet):
41
 
 
 
37
        zc.resourcelibrary.need('schooltool.peas.custom')
 
38
        
42
39
    render = flourish.templates.Inline('''
43
40
      <link rel="stylesheet" type="text/css" href="layout.css" media="screen"
44
 
            tal:attributes="href context/++resource++schooltool.flourish.custom/custom.css" />
 
41
            tal:attributes="href context/++resource++schooltool.peas.custom/custom.css" />
45
42
    ''')
46
43
 
47
44
 
72
69
                    if group.__name__ not in defaultGroups],
73
70
                })
74
71
        return result
 
72
 
 
73
 
 
74
class PEASIntegerDataConverter(converter.IntegerDataConverter):
 
75
 
 
76
    def toWidgetValue(self, value):
 
77
        result = super(PEASIntegerDataConverter, self).toWidgetValue(value)
 
78
        if ',' in result:
 
79
            return result.replace(',', '')
 
80
        return result