-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from BB-Open/settings
Add PKAN Settings
- Loading branch information
Showing
33 changed files
with
468 additions
and
46 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,7 @@ | ||
============= | ||
Base Settings | ||
============= | ||
|
||
.. figure:: ../../_images/settings_base.png | ||
|
||
PKAN Base Settings |
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,37 @@ | ||
=============== | ||
Folder Settings | ||
=============== | ||
|
||
.. figure:: ../../_images/settings_folders.png | ||
|
||
PKAN Folder Settings | ||
|
||
|
||
.. figure:: ../../_images/settings_folders-folder_agents.png | ||
|
||
Folder Settings: Agents | ||
|
||
|
||
.. figure:: ../../_images/settings_folders-folder_formats.png | ||
|
||
Folder Settings: Formats | ||
|
||
|
||
.. figure:: ../../_images/settings_folders-folder_licenses.png | ||
|
||
Folder Settings: Licenses | ||
|
||
|
||
.. figure:: ../../_images/settings_folders-folder_locations.png | ||
|
||
Folder Settings: Locations | ||
|
||
|
||
.. figure:: ../../_images/settings_folders-folder_publishers.png | ||
|
||
Folder Settings: Publishers | ||
|
||
|
||
.. figure:: ../../_images/settings_folders-folder_standards.png | ||
|
||
Folder Settings: Standards |
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,11 @@ | ||
========================== | ||
Configuration And Settings | ||
========================== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:hidden: | ||
:caption: Configuration And Settings | ||
|
||
Base Settings <base> | ||
Folders <folders> |
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
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Control Panels for pkan.dcatapde.""" |
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,26 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Base controlpanel view.""" | ||
|
||
from pkan.dcatapde import i18n | ||
from plone.app.registry.browser import controlpanel | ||
from plone.registry.interfaces import IRegistry | ||
from z3c.form import field | ||
from zope.component import getUtility | ||
|
||
|
||
class SelfHealingRegistryEditForm(controlpanel.RegistryEditForm): | ||
"""Registers the schema if an error occured.""" | ||
|
||
def getContent(self): | ||
registry = getUtility(IRegistry) | ||
try: | ||
return registry.forInterface( # noqa | ||
self.schema, | ||
prefix=self.schema_prefix, | ||
) | ||
except KeyError: | ||
self.ignoreContext = True | ||
self.fields = field.Fields() | ||
registry.registerInterface(self.schema) | ||
self.status = i18n.STATUS_REGISTRY_UPDATED | ||
return None |
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,20 @@ | ||
<configure | ||
xmlns="http://namespaces.zope.org/zope" | ||
xmlns:browser="http://namespaces.zope.org/browser" | ||
i18n_domain="pkan.dcatapde"> | ||
|
||
<browser:page | ||
class=".settings.PKANBaseSettingsPanelView" | ||
for="Products.CMFPlone.interfaces.IPloneSiteRoot" | ||
name="pkan-controlpanel-base" | ||
permission="pkan.dcatapde.controlpanel.PKAN" | ||
/> | ||
|
||
<browser:page | ||
class=".settings.PKANFolderSettingsPanelView" | ||
for="Products.CMFPlone.interfaces.IPloneSiteRoot" | ||
name="pkan-controlpanel-folders" | ||
permission="pkan.dcatapde.controlpanel.PKAN" | ||
/> | ||
|
||
</configure> |
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,41 @@ | ||
# -*- coding: utf-8 -*- | ||
"""PKAN Control Panel.""" | ||
|
||
from pkan.dcatapde import i18n | ||
from pkan.dcatapde import interfaces | ||
from pkan.dcatapde.browser.controlpanel import base | ||
from plone.app.registry.browser import controlpanel | ||
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile | ||
from zope.interface import implementer | ||
|
||
|
||
@implementer(interfaces.IPKANBaseSettings) | ||
class PKANBaseSettingsEditForm(base.SelfHealingRegistryEditForm): | ||
"""PKAN Settings Form.""" | ||
|
||
description = i18n.HELP_SETTINGS_BASE | ||
label = i18n.LABEL_SETTINGS_BASE | ||
schema = interfaces.IPKANBaseSettings | ||
|
||
|
||
class PKANBaseSettingsPanelView(controlpanel.ControlPanelFormWrapper): | ||
"""PKAN Settings Control Panel.""" | ||
|
||
form = PKANBaseSettingsEditForm | ||
index = ViewPageTemplateFile('templates/controlpanel_layout_base.pt') | ||
|
||
|
||
@implementer(interfaces.IPKANFolderSettings) | ||
class PKANFolderSettingsEditForm(base.SelfHealingRegistryEditForm): | ||
"""PKAN Folder Settings Form.""" | ||
|
||
description = i18n.HELP_SETTINGS_FOLDERS | ||
label = i18n.LABEL_SETTINGS_FOLDERS | ||
schema = interfaces.IPKANFolderSettings | ||
|
||
|
||
class PKANFolderSettingsPanelView(controlpanel.ControlPanelFormWrapper): | ||
"""PKAN Folder Settings Control Panel.""" | ||
|
||
form = PKANFolderSettingsEditForm | ||
index = ViewPageTemplateFile('templates/controlpanel_layout_folders.pt') |
38 changes: 38 additions & 0 deletions
38
src/pkan/dcatapde/browser/controlpanel/templates/controlpanel_layout_base.pt
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,38 @@ | ||
<html lang="en" | ||
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" | ||
xmlns:tal="http://xml.zope.org/namespaces/tal" | ||
xmlns:metal="http://xml.zope.org/namespaces/metal" | ||
xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
metal:use-macro="here/prefs_main_template/macros/master" | ||
i18n:domain="pkan.dcatapde"> | ||
|
||
<body> | ||
|
||
<div metal:fill-slot="prefs_configlet_main"> | ||
|
||
<a id="setup-link" class="link-parent" | ||
tal:attributes="href string:$portal_url/@@overview-controlpanel" | ||
i18n:translate="" | ||
i18n:domain="plone">Site Setup</a> | ||
|
||
<h1 class="documentFirstHeading" i18n:translate="">PKAN Settings</h1> | ||
|
||
<div metal:use-macro="context/global_statusmessage/macros/portal_message">Portal status message</div> | ||
|
||
<div id="content-core"> | ||
|
||
<div class="autotabs"> | ||
<div class="autotoc-nav"> | ||
<a href="" class="active" | ||
tal:attributes="href string:${portal_url}/@@pkan-controlpanel-base" | ||
i18n:translate="">Settings</a> | ||
<a href="" | ||
tal:attributes="href string:${portal_url}/@@pkan-controlpanel-folders" | ||
i18n:translate="">Folders</a> | ||
</div> | ||
<span tal:replace="structure view/contents" /> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
38 changes: 38 additions & 0 deletions
38
src/pkan/dcatapde/browser/controlpanel/templates/controlpanel_layout_folders.pt
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,38 @@ | ||
<html lang="en" | ||
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" | ||
xmlns:tal="http://xml.zope.org/namespaces/tal" | ||
xmlns:metal="http://xml.zope.org/namespaces/metal" | ||
xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
metal:use-macro="here/prefs_main_template/macros/master" | ||
i18n:domain="pkan.dcatapde"> | ||
|
||
<body> | ||
|
||
<div metal:fill-slot="prefs_configlet_main"> | ||
|
||
<a id="setup-link" class="link-parent" | ||
tal:attributes="href string:$portal_url/@@overview-controlpanel" | ||
i18n:translate="" | ||
i18n:domain="plone">Site Setup</a> | ||
|
||
<h1 class="documentFirstHeading" i18n:translate="">PKAN Settings</h1> | ||
|
||
<div metal:use-macro="context/global_statusmessage/macros/portal_message">Portal status message</div> | ||
|
||
<div id="content-core"> | ||
|
||
<div class="autotabs"> | ||
<div class="autotoc-nav"> | ||
<a href="" | ||
tal:attributes="href string:${portal_url}/@@pkan-controlpanel-base" | ||
i18n:translate="">Settings</a> | ||
<a href="" class="active" | ||
tal:attributes="href string:${portal_url}/@@pkan-controlpanel-folders" | ||
i18n:translate="">Folders</a> | ||
</div> | ||
<span tal:replace="structure view/contents" /> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Empty file.
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
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.