diff --git a/backend/src/ploneorg/src/ploneorg/browser/configure.zcml b/backend/src/ploneorg/src/ploneorg/browser/configure.zcml index bade71d..264c5aa 100644 --- a/backend/src/ploneorg/src/ploneorg/browser/configure.zcml +++ b/backend/src/ploneorg/src/ploneorg/browser/configure.zcml @@ -12,6 +12,16 @@ type="plone" /> + + + + + + + + Manage portal + + + diff --git a/backend/src/ploneorg/src/ploneorg/profiles/default/registry/ploneorg.interfaces.IPLONEORGSettings.xml b/backend/src/ploneorg/src/ploneorg/profiles/default/registry/ploneorg.interfaces.IPLONEORGSettings.xml new file mode 100644 index 0000000..147bca7 --- /dev/null +++ b/backend/src/ploneorg/src/ploneorg/profiles/default/registry/ploneorg.interfaces.IPLONEORGSettings.xml @@ -0,0 +1,4 @@ + + + + diff --git a/backend/src/ploneorg/src/ploneorg/services/configure.zcml b/backend/src/ploneorg/src/ploneorg/services/configure.zcml index fb8b793..8d718a6 100644 --- a/backend/src/ploneorg/src/ploneorg/services/configure.zcml +++ b/backend/src/ploneorg/src/ploneorg/services/configure.zcml @@ -1,3 +1,6 @@ + + + diff --git a/backend/src/ploneorg/src/ploneorg/services/controlpanel/__init__.py b/backend/src/ploneorg/src/ploneorg/services/controlpanel/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/src/ploneorg/src/ploneorg/services/controlpanel/configure.zcml b/backend/src/ploneorg/src/ploneorg/services/controlpanel/configure.zcml new file mode 100644 index 0000000..50afd31 --- /dev/null +++ b/backend/src/ploneorg/src/ploneorg/services/controlpanel/configure.zcml @@ -0,0 +1,10 @@ + + + + + + diff --git a/backend/src/ploneorg/src/ploneorg/services/controlpanel/controlpanel.py b/backend/src/ploneorg/src/ploneorg/services/controlpanel/controlpanel.py new file mode 100644 index 0000000..476f9ac --- /dev/null +++ b/backend/src/ploneorg/src/ploneorg/services/controlpanel/controlpanel.py @@ -0,0 +1,13 @@ +from plone.restapi.controlpanels import RegistryConfigletPanel +from ploneorg.interfaces import IPLONEORGLayer, IPLONEORGSettings +from zope.component import adapter +from zope.interface import Interface, implementer + + +@adapter(Interface, IPLONEORGLayer) +@implementer(IPLONEORGSettings) +class PloneorgSettingsControlpanel(RegistryConfigletPanel): + schema = IPLONEORGSettings + configlet_id = "ploneorg-settings" + configlet_category_id = "Products" + schema_prefix = None diff --git a/backend/src/ploneorg/src/ploneorg/services/custom_css/__init__.py b/backend/src/ploneorg/src/ploneorg/services/custom_css/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/src/ploneorg/src/ploneorg/services/custom_css/configure.zcml b/backend/src/ploneorg/src/ploneorg/services/custom_css/configure.zcml new file mode 100644 index 0000000..0f16700 --- /dev/null +++ b/backend/src/ploneorg/src/ploneorg/services/custom_css/configure.zcml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/backend/src/ploneorg/src/ploneorg/services/custom_css/get.py b/backend/src/ploneorg/src/ploneorg/services/custom_css/get.py new file mode 100644 index 0000000..1325f8b --- /dev/null +++ b/backend/src/ploneorg/src/ploneorg/services/custom_css/get.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from plone import api +from plone.restapi.services import Service +from ploneorg.interfaces import IPLONEORGSettings +from zope.interface import implementer +from zope.publisher.interfaces import IPublishTraverse + + +@implementer(IPublishTraverse) +class CustomCSS(Service): + def __init__(self, context, request): + super(CustomCSS, self).__init__(context, request) + + def reply(self): + record = api.portal.get_registry_record( + "custom_css", interface=IPLONEORGSettings, default="" + ) + return {"data": record}