Added a new system for layouting production-ready forms without any HTML coding, many performance improvements and more independence towards Archetypes.

This commit is contained in:
Gaetan Delannay 2010-08-05 18:23:17 +02:00
parent 309ea921fa
commit bfd2357f69
84 changed files with 4663 additions and 3549 deletions

View file

@ -26,7 +26,6 @@ class <!genClassName!>(<!parents!>):
suppl_views = ()
typeDescription = '<!genClassName!>'
typeDescMsgId = '<!genClassName!>_edit_descr'
_at_rename_after_creation = True
i18nDomain = '<!applicationName!>'
schema = fullSchema
wrapperClass = <!genClassName!>_Wrapper

View file

@ -6,11 +6,9 @@ import Products.<!applicationName!>.config
from appy.gen.plone25.mixins.FlavourMixin import FlavourMixin
from Extensions.appyWrappers import <!wrapperClass!>
predefinedSchema = Schema((<!predefinedFields!>
),)
schema = Schema((<!fields!>
),)
fullSchema = OrderedBaseFolderSchema.copy() + predefinedSchema.copy() + schema.copy()
fullSchema = OrderedBaseFolderSchema.copy() + schema.copy()
class <!flavourName!>(OrderedBaseFolder, FlavourMixin):
'''Configuration flavour class for <!applicationName!>.'''
@ -32,10 +30,8 @@ class <!flavourName!>(OrderedBaseFolder, FlavourMixin):
schema = fullSchema
allMetaTypes = <!metaTypes!>
wrapperClass = <!wrapperClass!>
_at_rename_after_creation = True
for elem in dir(FlavourMixin):
if not elem.startswith('__'): security.declarePublic(elem)
<!commonMethods!>
<!predefinedMethods!>
<!methods!>
registerType(<!flavourName!>, '<!applicationName!>')

View file

@ -27,7 +27,6 @@ class <!applicationName!>PodTemplate(BaseContent, PodTemplateMixin):
suppl_views = ()
typeDescription = "<!applicationName!>PodTemplate"
typeDescMsgId = '<!applicationName!>_edit_descr'
_at_rename_after_creation = True
wrapperClass = <!wrapperClass!>
schema = fullSchema
for elem in dir(PodTemplateMixin):

View file

@ -7,7 +7,7 @@
flavour python: tool.getFlavour(tool);"
tal:condition="tool/showPortlet">
<metal:block metal:use-macro="here/global_defines/macros/defines" />
<metal:prologue use-macro="here/skyn/macros/macros/pagePrologue"/>
<metal:prologue use-macro="here/skyn/page/macros/prologue"/>
<dl tal:define="rootClasses tool/getRootClasses;
appName string:<!applicationName!>;
appFolder tool/getAppFolder;

View file

@ -4,23 +4,16 @@
#portal-breadcrumbs { display: none; }
#importedElem { color: grey; font-style: italic; }
.appyList { line-height: 1.1em; margin: 0 0 0.5em 1.2em; padding: 0; }
.appyBullet { margin: 0; }
.appyPod { float:right; }
.appyNav { padding: 0.4em 0 0.4em 0; }
.appyFocus { color: #900101; }
.appyTabs { margin-bottom: 1em; }
.appyTabs li a { border-bottom:1px solid transparent; font-size: 90%; }
.appyTabs li a:visited { color: #578308; }
.appyTitle { padding-top: 0.5em; font-size: 110%; }
.appyLabel { font-weight: bold; padding-right: 0.4em; }
.appyRefEdit { line-height: 1.5em; }
.appyWorkflow {
text-align: center;
background-color: &dtml-globalBackgroundColor;;
}
label { font-weight: bold; font-style: italic; }
.discreet { font-size: 94%; }
.appyList { line-height: 1.1em; margin: 0 0 0.5em 1.2em; padding: 0; }
.appyBullet { margin: 0; }
.appyPod { float:right; }
.appyNav { padding: 0.4em 0 0.4em 0; }
.appyFocus { color: #900101; }
.appyTitle { padding-top: 0.5em; font-size: 110%; }
.appyRefEdit { line-height: 1.5em; }
.appyWorkflow { text-align: center; background-color: &dtml-globalBackgroundColor;;}
.appyPlusImg {
vertical-align: top;
@ -30,10 +23,9 @@
}
.appyPhase {
border-style: solid;
border-style: dashed;
border-width: thin;
text-align: center;
padding: 0 1em 0 1.3em;
padding: 0 0.1em 0 1em;
}
.appyState {
@ -75,14 +67,14 @@
background-color: #cde2a7;
background-image: url(&dtml-portal_url;/skyn/done.png);
background-repeat: no-repeat;
background-position: center left;
background-position: -1px 4px;
}
.stepCurrent {
background-color: #ffce7b;
background-color: #eef3f5;
background-image: url(&dtml-portal_url;/skyn/current.png);
background-repeat: no-repeat;
background-position: center left;
background-position: -1px 4px;
}
.stepFuture {
@ -104,13 +96,7 @@
}
/* With fields layout in columns, standard error frame is too large */
.error {
padding: 0.4em;
}
.odd {
background-color: white;
}
.odd { background-color: white; }
/* Table styles */
.no-style-table {
@ -125,18 +111,41 @@
margin: 0 !important;
}
/* Minor layout changes in fieldsets and tables */
fieldset {
margin: 0 0 0 0;
line-height: 1em;
border: 2px solid #8CACBB;
margin: 0.5em 0em 0.5em 0em;
padding: 0 0.7em 0.5em;
}
.fieldset {
line-height: 1em;
th {
font-style: italic;
font-weight: normal;
}
/* Group fieldsets */
.appyGroup {
border-width: 2px;
.section1 {
font-size: 120%;
margin: 0.45em 0em 0.1em 0;
padding: 0.3em 0em 0.2em 0.1em;
background-color: #eef3f5;
border-top: 1px solid #8CACBB;
border-bottom: 1px solid #8CACBB;
}
.section2 {
font-size: 110%;
font-style: italic;
margin: 0.45em 0em 0.1em 0;
border-bottom: 2px solid #8CACBB;
}
.section3 {
font-size: 100%;
font-style: italic;
margin: 0.45em 0em 0.1em 0;
background-color: #efeae8;
text-align: center;
color: grey;
}
.imageInput {
@ -169,6 +178,7 @@ fieldset {
padding-left: 0.3em;
padding-top: 0.3em;
padding-bottom: 0em;
border-top : 1px solid #8CACBB;
}
.vertical td {
@ -212,9 +222,6 @@ fieldset {
font-weight: normal;
text-transform: none;
}
.portletSep {
border-top: 1px dashed #8cacbb;
}
.portletSearch {
padding: 0 0 0 0.6em;
font-style: normal;
@ -225,13 +232,11 @@ fieldset {
font-weight: bold;
font-style: normal;
}
.portletGroupItem {
padding-left: 0.8em;
font-style: italic;
}
.portletCurrent {
font-weight: bold;
}
.portletSep { border-top: 1px dashed #8cacbb; }
.portletGroupItem { padding-left: 0.8em; font-style: italic; }
.portletPageItem { font-style: italic; }
.portletCurrent { font-weight: bold; }
div.appyGrey {
display: none;
position: absolute;

View file

@ -7,11 +7,9 @@ import Products.<!applicationName!>.config
from appy.gen.plone25.mixins.ToolMixin import ToolMixin
from Extensions.appyWrappers import AbstractWrapper, <!wrapperClass!>
predefinedSchema = Schema((<!predefinedFields!>
),)
schema = Schema((<!fields!>
),)
fullSchema = OrderedBaseFolderSchema.copy() + predefinedSchema.copy() + schema.copy()
fullSchema = OrderedBaseFolderSchema.copy() + schema.copy()
class <!toolName!>(UniqueObject, OrderedBaseFolder, ToolMixin):
'''Tool for <!applicationName!>.'''
@ -32,7 +30,6 @@ class <!toolName!>(UniqueObject, OrderedBaseFolder, ToolMixin):
typeDescMsgId = '<!toolName!>_edit_descr'
i18nDomain = '<!applicationName!>'
wrapperClass = <!wrapperClass!>
_at_rename_after_creation = True
schema = fullSchema
schema["id"].widget.visible = False
schema["title"].widget.visible = False
@ -47,6 +44,5 @@ class <!toolName!>(UniqueObject, OrderedBaseFolder, ToolMixin):
OrderedBaseFolder.__init__(self, '<!toolInstanceName!>')
self.setTitle('<!applicationName!>')
<!commonMethods!>
<!predefinedMethods!>
<!methods!>
registerType(<!toolName!>, '<!applicationName!>')

View file

@ -45,8 +45,9 @@ def initialize(context):
<!imports!>
# I need to do those imports here; else, types and add permissions will not
# be registered.
classes = [<!classes!>]
ZopeInstaller(context, PROJECTNAME,
<!applicationName!>Tool.<!applicationName!>Tool,
DEFAULT_ADD_CONTENT_PERMISSION, ADD_CONTENT_PERMISSIONS,
logger, globals()).install()
logger, globals(), classes).install()
# ------------------------------------------------------------------------------

View file

@ -1,6 +1,6 @@
# ------------------------------------------------------------------------------
from appy.gen import *
from appy.gen.plone25.wrappers import AbstractWrapper, FileWrapper
from appy.gen.plone25.wrappers import AbstractWrapper
from appy.gen.plone25.wrappers.ToolWrapper import ToolWrapper
from appy.gen.plone25.wrappers.FlavourWrapper import FlavourWrapper
from appy.gen.plone25.wrappers.PodTemplateWrapper import PodTemplateWrapper

View file

@ -1,11 +1,8 @@
<!codeHeader!>
import os, os.path, sys
try: # New CMF
from Products.CMFCore.permissions import setDefaultRoles
except ImportError: # Old CMF
from Products.CMFCore.CMFCorePermissions import setDefaultRoles
import Extensions.appyWrappers
import os, os.path, sys, copy
import appy.gen
from Products.CMFCore.permissions import setDefaultRoles
import Extensions.appyWrappers as wraps
<!imports!>
# The following imports are here for allowing mixin classes to access those
@ -17,7 +14,6 @@ from OFS.Image import File
from DateTime import DateTime
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.PloneBatch import Batch
from Products.Archetypes.utils import DisplayList
import logging
logger = logging.getLogger('<!applicationName!>')
@ -32,9 +28,7 @@ setDefaultRoles(DEFAULT_ADD_CONTENT_PERMISSION, tuple(defaultAddRoles))
product_globals = globals()
applicationRoles = [<!roles!>]
rootClasses = [<!rootClasses!>]
referers = {
<!referers!>
}
# In the following dict, we keep one instance for every Appy workflow defined
# in the application. Those prototypical instances will be used for executing
# user-defined actions and transitions. For each instance, we add a special
@ -44,6 +38,9 @@ workflowInstances = {}
<!workflowInstancesInit!>
# In the following dict, we store, for every Appy class, the ordered list of
# attributes (included inherited attributes).
# appy types (included inherited ones).
attributes = {<!attributes!>}
# In the followinf dict, we store, for every Appy class, a dict of appy types
# keyed by their names.
attributesDict = {<!attributesDict!>}
# ------------------------------------------------------------------------------

View file

@ -1,20 +1,5 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" i18n:domain="plone">
<body>
<tal:message i18n:domain="plone" metal:define-macro="portal_message">
<tal:comment replace="nothing">Single message from portal_status_message request key</tal:comment>
<div tal:define="msg request/portal_status_message | nothing"
tal:condition="msg" class="portalMessage" tal:content="msg" i18n:translate=""></div>
<tal:comment replace="nothing">Messages added via plone_utils</tal:comment>
<tal:messages define="messages putils/showPortalMessages" condition="messages">
<tal:msgs define="type_css_map python: {'info':'portalMessage', 'warn':'portalWarningMessage',
'stop':'portalStopMessage'};"
repeat="msg messages">
<div tal:define="mtype msg/type | nothing;"
tal:attributes="class python:mtype and type_css_map[mtype] or 'info';"
tal:content="structure msg/message | nothing" i18n:translate=""></div>
</tal:msgs>
</tal:messages>
</tal:message>
<tal:message metal:define-macro="portal_message"></tal:message>
</body>
</html>