Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
676 additions
and
722 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages | ||
try: | ||
__import__('pkg_resources').declare_namespace(__name__) | ||
except ImportError: | ||
from pkgutil import extend_path | ||
__path__ = extend_path(__path__, __name__) | ||
# -*- coding: utf-8 -*- | ||
__import__('pkg_resources').declare_namespace(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages | ||
try: | ||
__import__('pkg_resources').declare_namespace(__name__) | ||
except ImportError: | ||
from pkgutil import extend_path | ||
__path__ = extend_path(__path__, __name__) | ||
# -*- coding: utf-8 -*- | ||
__import__('pkg_resources').declare_namespace(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# -*- coding: utf-8 -*- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,105 +1,3 @@ | ||
from Products.ATContentTypes.interface import IATContentType | ||
from archetypes.schemaextender.interfaces import IBrowserLayerAwareExtender | ||
from archetypes.schemaextender.interfaces import ISchemaModifier | ||
from plone.app.widgets import at | ||
from plone.app.widgets.interfaces import IWidgetsLayer | ||
from plone.app.widgets.utils import first_weekday | ||
from zope.component import adapts | ||
from zope.i18nmessageid import MessageFactory | ||
from zope.interface import implements | ||
|
||
_plone = MessageFactory('plone') | ||
|
||
|
||
class MetadataExtender(object): | ||
""" | ||
""" | ||
|
||
implements(ISchemaModifier, IBrowserLayerAwareExtender) | ||
adapts(IATContentType) | ||
layer = IWidgetsLayer | ||
|
||
def __init__(self, context): | ||
self.context = context | ||
|
||
def fiddle(self, schema): | ||
for field in schema.fields(): | ||
old = field.widget | ||
|
||
if field.__name__ in ['startDate']: | ||
field.widget = at.DatetimeWidget( | ||
label=old.label, | ||
description=old.description, | ||
pattern_options={'date': {'firstDay': first_weekday()}}, | ||
) | ||
|
||
if field.__name__ in ['endDate']: | ||
field.widget = at.DatetimeWidget( | ||
label=old.label, | ||
description=old.description, | ||
pattern_options={'date': {'firstDay': first_weekday()}}, | ||
) | ||
|
||
if field.__name__ in ['subject']: | ||
field.widget = at.KeywordsWidget( | ||
label=old.label, | ||
description=old.description, | ||
) | ||
|
||
if field.__name__ in ['language']: | ||
field.widget = at.SelectWidget( | ||
label=old.label, | ||
description=old.description, | ||
) | ||
|
||
if field.__name__ in ['effectiveDate', 'expirationDate']: | ||
field.widget = at.DatetimeWidget( | ||
label=old.label, | ||
description=old.description, | ||
pattern_options={'date': {'firstDay': first_weekday()}}, | ||
) | ||
|
||
if field.__name__ in ['contributors']: | ||
field.widget = at.AjaxSelectWidget( | ||
label=old.label, | ||
description=_plone(u"The names of people that have " | ||
u"contributed to this item."), | ||
vocabulary="plone.app.vocabularies.Users", | ||
) | ||
|
||
if field.__name__ in ['creators']: | ||
field.widget = at.AjaxSelectWidget( | ||
label=old.label, | ||
description=_plone(u"The names of people that are " | ||
u"creators to this item."), | ||
vocabulary="plone.app.vocabularies.Users", | ||
) | ||
|
||
if field.__name__ in ['text']: | ||
field.widget = at.TinyMCEWidget( | ||
label=old.label, | ||
description=old.description, | ||
) | ||
|
||
if field.__name__ == 'query': | ||
field.widget = at.QueryStringWidget( | ||
label=old.label, | ||
description=old.description | ||
) | ||
|
||
if field.__name__ == 'relatedItems': | ||
field.widget = at.RelatedItemsWidget( | ||
label=old.label, | ||
description=old.description | ||
) | ||
|
||
# if 'customViewFields' in schema: | ||
# field = schema['customViewFields'] | ||
# widget = field.widget | ||
# field.widget = ChosenWidget( | ||
# label=widget.label, | ||
# description=widget.description, | ||
# js_options={ | ||
# 'allow_sortable': True | ||
# } | ||
# ) | ||
# -*- coding: utf-8 -*- | ||
from zope.deprecation import moved | ||
moved('plone.app.widgets.at', 'Version 1.10') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
from copy import deepcopy | ||
from lxml import etree | ||
|
||
import json | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# -*- coding: utf-8 -*- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
from Products.Five import BrowserView | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.