This repository has been archived by the owner on Feb 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
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
9 changed files
with
62 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from grokui.base.interfaces import IGrokUIRealm, IGrokUIPluginInfo | ||
from grokui.base.interfaces import IUIPanel, IMainMenu | ||
from grokui.base.info import BasePluginInfo | ||
from grokui.base.namespace import GrokUILayer, GrokUISkin, GrokUINamespace | ||
from grokui.base.namespace import GrokUILayer, GrokUISkin | ||
from grokui.base.namespace import GrokUINamespace, GrokUIPluginsInfo | ||
from grokui.base.contentproviders import Header, Footer, MainMenu, Messages | ||
from grokui.base.layout import GrokUIView | ||
from grokui.base.info import BasePluginInfo |
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 |
---|---|---|
@@ -1,14 +1,44 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import grokcore.component as grok | ||
import grokcore.viewlet as grok | ||
from megrok.layout import Page | ||
from zope.component import getUtilitiesFor | ||
from zope.location import LocationProxy | ||
from zope.schema.fieldproperty import FieldProperty | ||
from grokui.base.interfaces import IGrokUIPluginInfo | ||
from zope.traversing.browser.absoluteurl import absoluteURL | ||
|
||
from grokui.base import interfaces | ||
from grokui.base import GrokUIPluginsInfo, GrokUIView, GrokUILayer | ||
|
||
grok.templatedir('templates') | ||
|
||
|
||
class BasePluginInfo(grok.GlobalUtility): | ||
grok.baseclass() | ||
grok.implements(IGrokUIPluginInfo) | ||
grok.implements(interfaces.IGrokUIPluginInfo) | ||
|
||
title = FieldProperty(interfaces.IGrokUIPluginInfo['title']) | ||
description = FieldProperty(interfaces.IGrokUIPluginInfo['description']) | ||
version = FieldProperty(interfaces.IGrokUIPluginInfo['version']) | ||
|
||
|
||
class Plugins(GrokUIView): | ||
grok.order(50) | ||
grok.title(u'Information panels') | ||
|
||
def plugins(self): | ||
plugins = getUtilitiesFor(interfaces.IGrokUIPluginInfo) | ||
for name, plugin in plugins: | ||
located = LocationProxy(plugin, self.context, '++info++%s' % name) | ||
yield dict( | ||
url=absoluteURL(located, self.request), | ||
version=located.version, | ||
title=located.title, | ||
description=located.description) | ||
|
||
|
||
title = FieldProperty(IGrokUIPluginInfo['title']) | ||
description = FieldProperty(IGrokUIPluginInfo['description']) | ||
version = FieldProperty(IGrokUIPluginInfo['version']) | ||
class PluginPage(Page): | ||
grok.name('index') | ||
grok.layer(GrokUILayer) | ||
grok.implements(interfaces.IUIPanel) | ||
grok.context(interfaces.IGrokUIPluginInfo) |
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 |
---|---|---|
|
@@ -231,3 +231,6 @@ label { | |
font-weight: bold !important; | ||
} | ||
|
||
#plugins { | ||
padding: 0.4em 3em; | ||
} |
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,5 @@ | ||
<div class="plugin-page"> | ||
<h1 tal:content="context/title" /> | ||
<h2 tal:content="context/version" /> | ||
<p tal:content="context/description" /> | ||
</div> |
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