From 73cc58e295f7367f425b66eb48547ddbd983aa36 Mon Sep 17 00:00:00 2001 From: helmutm Date: Tue, 12 Oct 2010 09:07:46 +0000 Subject: [PATCH] add new Mojo skin - management interface based on Dojo git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@4036 fd906abe-77d9-0310-91a1-e0d9ade77398 --- browser/configure.zcml | 3 ++ browser/mojo/__init__.py | 10 ++++++ browser/mojo/base.css | 22 +++++++++++++ browser/mojo/body.pt | 65 +++++++++++++++++++++++++++++++++++++ browser/mojo/browser.py | 31 ++++++++++++++++++ browser/mojo/configure.zcml | 32 ++++++++++++++++++ browser/mojo/controller.py | 65 +++++++++++++++++++++++++++++++++++++ browser/mojo/custom.css | 7 ++++ browser/mojo/print.css | 17 ++++++++++ 9 files changed, 252 insertions(+) create mode 100644 browser/mojo/__init__.py create mode 100644 browser/mojo/base.css create mode 100644 browser/mojo/body.pt create mode 100644 browser/mojo/browser.py create mode 100644 browser/mojo/configure.zcml create mode 100644 browser/mojo/controller.py create mode 100644 browser/mojo/custom.css create mode 100644 browser/mojo/print.css diff --git a/browser/configure.zcml b/browser/configure.zcml index d7a0325..e96a813 100644 --- a/browser/configure.zcml +++ b/browser/configure.zcml @@ -40,4 +40,7 @@ + + + diff --git a/browser/mojo/__init__.py b/browser/mojo/__init__.py new file mode 100644 index 0000000..8df3369 --- /dev/null +++ b/browser/mojo/__init__.py @@ -0,0 +1,10 @@ +""" +$Id$ +""" + +from zope.app.rotterdam import Rotterdam + + +class Mojo(Rotterdam): + """ The Mojo (Management Interface with Dojo) skin """ + diff --git a/browser/mojo/base.css b/browser/mojo/base.css new file mode 100644 index 0000000..28e3a87 --- /dev/null +++ b/browser/mojo/base.css @@ -0,0 +1,22 @@ +/* + $Id$ + +*/ + +body, html { + width: 100%; + height: 100%; + margin: 0; + padding: 0; + overflow:hidden; + font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; + font-size: 13px; + background-color: white; + color: #000040; +} + +#borderContainer { + width: 100%; + height: 100%; +} + diff --git a/browser/mojo/body.pt b/browser/mojo/body.pt new file mode 100644 index 0000000..9dc0236 --- /dev/null +++ b/browser/mojo/body.pt @@ -0,0 +1,65 @@ + + + +
+ +
+
+ +
+
+ +
+
+ + + +
+
+
+
+ + + + + +
+
+ + + +
+ +
+
\ No newline at end of file diff --git a/browser/mojo/browser.py b/browser/mojo/browser.py new file mode 100644 index 0000000..de4f24f --- /dev/null +++ b/browser/mojo/browser.py @@ -0,0 +1,31 @@ +# +# Copyright (c) 2006 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +Dummy view class for providing the body template. + +$Id$ +""" + +from cybertools.browser.view import UnboundTemplateFile + + +class View(object): + + bodyTemplate = UnboundTemplateFile('body.pt') + diff --git a/browser/mojo/configure.zcml b/browser/mojo/configure.zcml new file mode 100644 index 0000000..30250c7 --- /dev/null +++ b/browser/mojo/configure.zcml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + diff --git a/browser/mojo/controller.py b/browser/mojo/controller.py new file mode 100644 index 0000000..5f89491 --- /dev/null +++ b/browser/mojo/controller.py @@ -0,0 +1,65 @@ +# +# Copyright (c) 2010 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +View controller for the Mojo skin. + +$Id$ +""" + +from cybertools.ajax.dojo import dojoMacroTemplate +from cybertools.browser.controller import Controller as BaseController + + +class Controller(BaseController): + + def __init__(self, context, request): + self.view = view = context # the controller is adapted to a view + self.context = context.context + self.request = request + self.setupCss() + self.setupJs() + super(Controller, self).__init__(context, request) + + def setupCss(self): + macros = self.macros + params = [('base.css', 'screen', 25), + ('print.css', 'print', 30), + ('custom.css', 'all', 100)] + for param in params: + macros.register('css', identifier=param[0], + resourceName=param[0], media=param[1], + priority=param[2]) + + def setupJs(self): + cm = self.macros + cm.register('js', 'dojo.js', template=dojoMacroTemplate, name='main', + position=0, + djConfig='parseOnLoad: true, usePlainJson: true, ' + #'isDebug: true, ' + 'locale: "en"') + jsCall = ('dojo.require("dojo.parser"); ' + 'dojo.registerModulePath("jocy", "/@@/cybertools.jocy"); ') + cm.register('js-execute', 'dojo_registration', jsCall=jsCall) + + jsCall = ('dojo.require("dijit.layout.ContentPane"); ' + 'dojo.require("dijit.layout.BorderContainer"); ') + cm.register('js-execute', 'dojo_contentpane', jsCall=jsCall) + cm.register('css', identifier='tundra.css', position=0, + resourceName='ajax.dojo/dijit/themes/tundra/tundra.css', + media='all') diff --git a/browser/mojo/custom.css b/browser/mojo/custom.css new file mode 100644 index 0000000..68dcade --- /dev/null +++ b/browser/mojo/custom.css @@ -0,0 +1,7 @@ +/* + $Id$ + + Copy this to your custom skin directory and add custom settings. + +*/ + diff --git a/browser/mojo/print.css b/browser/mojo/print.css new file mode 100644 index 0000000..ca6889d --- /dev/null +++ b/browser/mojo/print.css @@ -0,0 +1,17 @@ +/* + $Id$ + +*/ + +body { + font-size: 11px; +} + +.top, #header, #menu, #sub-section, #footer, .object-actions, .button { + display: none; +} + +#content { + width: 100%; + color: Black; +}