add political group and deputy types
This commit is contained in:
parent
966b0ab563
commit
f7c6723738
|
@ -0,0 +1,21 @@
|
|||
from five import grok
|
||||
from zope import schema
|
||||
|
||||
from z3c.relationfield.schema import RelationChoice
|
||||
from plone.formwidget.contenttree import ObjPathSourceBinder
|
||||
|
||||
from plone.directives import form, dexterity
|
||||
|
||||
from themis.datatypes.interfaces import MessageFactory as _
|
||||
|
||||
from themis.datatypes.polgroup import IPolGroup
|
||||
|
||||
class IDeputy(form.Schema):
|
||||
firstname = schema.TextLine(title=_(u'First Name'))
|
||||
lastname = schema.TextLine(title=_(u'Last Name'))
|
||||
active = schema.Bool(title=_(u'Active'), default=True)
|
||||
|
||||
polgroup = RelationChoice(
|
||||
title=_(u"Political Group"),
|
||||
source=ObjPathSourceBinder(object_provides=IPolGroup.__identifier__),
|
||||
required=False)
|
|
@ -0,0 +1,12 @@
|
|||
from five import grok
|
||||
from zope import schema
|
||||
|
||||
from plone.directives import form, dexterity
|
||||
|
||||
from themis.datatypes.interfaces import MessageFactory as _
|
||||
|
||||
class IPolGroup(form.Schema):
|
||||
title = schema.TextLine(title=_(u'Name'))
|
||||
active = schema.Bool(title=_(u'Active'), default=True)
|
||||
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
<object name="portal_types">
|
||||
<object name="themis.datatypes.commission" meta_type="Dexterity FTI" />
|
||||
<object name="themis.datatypes.polgroup" meta_type="Dexterity FTI" />
|
||||
<object name="themis.datatypes.deputy" meta_type="Dexterity FTI" />
|
||||
</object>
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
<?xml version="1.0"?>
|
||||
<object name="themis.datatypes.deputy" meta_type="Dexterity FTI"
|
||||
i18n:domain="themis.datatypes" xmlns:i18n="http://xml.zope.org/namespaces/i18n">
|
||||
|
||||
<!-- Basic metadata -->
|
||||
<property name="title" i18n:translate="">Deputy</property>
|
||||
<property name="description" i18n:translate="">A deputy</property>
|
||||
<property name="content_icon">document_icon.gif</property>
|
||||
<property name="allow_discussion">False</property>
|
||||
<property name="global_allow">True</property>
|
||||
<property name="filter_content_types">True</property>
|
||||
<property name="allowed_content_types" />
|
||||
|
||||
<!-- schema interface -->
|
||||
<property name="schema">themis.datatypes.deputy.IDeputy</property>
|
||||
|
||||
<!-- class used for content items -->
|
||||
<property name="klass">plone.dexterity.content.Item</property>
|
||||
|
||||
<!-- add permission -->
|
||||
<property name="add_permission">cmf.AddPortalContent</property>
|
||||
|
||||
<!-- enabled behaviors -->
|
||||
<property name="behaviors">
|
||||
</property>
|
||||
|
||||
<!-- View information -->
|
||||
<property name="default_view">view</property>
|
||||
<property name="default_view_fallback">False</property>
|
||||
<property name="view_methods">
|
||||
<element value="view"/>
|
||||
</property>
|
||||
|
||||
<!-- Method aliases -->
|
||||
<alias from="(Default)" to="(dynamic view)"/>
|
||||
<alias from="edit" to="@@edit"/>
|
||||
<alias from="sharing" to="@@sharing"/>
|
||||
<alias from="view" to="(selected layout)"/>
|
||||
|
||||
<!-- Actions -->
|
||||
<action title="View" action_id="view" category="object" condition_expr=""
|
||||
url_expr="string:${object_url}" visible="True">
|
||||
<permission value="View"/>
|
||||
</action>
|
||||
<action title="Edit" action_id="edit" category="object" condition_expr=""
|
||||
url_expr="string:${object_url}/edit" visible="True">
|
||||
<permission value="Modify portal content"/>
|
||||
</action>
|
||||
</object>
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
<?xml version="1.0"?>
|
||||
<object name="themis.datatypes.polgroup" meta_type="Dexterity FTI"
|
||||
i18n:domain="themis.datatypes" xmlns:i18n="http://xml.zope.org/namespaces/i18n">
|
||||
|
||||
<!-- Basic metadata -->
|
||||
<property name="title" i18n:translate="">Political Group</property>
|
||||
<property name="description" i18n:translate="">A political group</property>
|
||||
<property name="content_icon">document_icon.gif</property>
|
||||
<property name="allow_discussion">False</property>
|
||||
<property name="global_allow">True</property>
|
||||
<property name="filter_content_types">True</property>
|
||||
<property name="allowed_content_types" />
|
||||
|
||||
<!-- schema interface -->
|
||||
<property name="schema">themis.datatypes.polgroup.IPolGroup</property>
|
||||
|
||||
<!-- class used for content items -->
|
||||
<property name="klass">plone.dexterity.content.Item</property>
|
||||
|
||||
<!-- add permission -->
|
||||
<property name="add_permission">cmf.AddPortalContent</property>
|
||||
|
||||
<!-- enabled behaviors -->
|
||||
<property name="behaviors">
|
||||
<element value="plone.app.content.interfaces.INameFromTitle" />
|
||||
</property>
|
||||
|
||||
<!-- View information -->
|
||||
<property name="default_view">view</property>
|
||||
<property name="default_view_fallback">False</property>
|
||||
<property name="view_methods">
|
||||
<element value="view"/>
|
||||
</property>
|
||||
|
||||
<!-- Method aliases -->
|
||||
<alias from="(Default)" to="(dynamic view)"/>
|
||||
<alias from="edit" to="@@edit"/>
|
||||
<alias from="sharing" to="@@sharing"/>
|
||||
<alias from="view" to="(selected layout)"/>
|
||||
|
||||
<!-- Actions -->
|
||||
<action title="View" action_id="view" category="object" condition_expr=""
|
||||
url_expr="string:${object_url}" visible="True">
|
||||
<permission value="View"/>
|
||||
</action>
|
||||
<action title="Edit" action_id="edit" category="object" condition_expr=""
|
||||
url_expr="string:${object_url}/edit" visible="True">
|
||||
<permission value="Modify portal content"/>
|
||||
</action>
|
||||
</object>
|
||||
|
Reference in New Issue