-
Notifications
You must be signed in to change notification settings - Fork 1
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
10 changed files
with
447 additions
and
23 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
backend/src/collective_blog/src/collective_blog/content/author.py
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 @@ | ||
from collective_blog import _ | ||
from plone.dexterity.content import Container | ||
from plone.supermodel.model import Schema | ||
from zope import schema | ||
from zope.interface import implementer | ||
|
||
|
||
class IAuthor(Schema): | ||
"""An author.""" | ||
|
||
title = schema.TextLine( | ||
title=_("Name"), | ||
description=_("Name of the author"), | ||
required=True, | ||
) | ||
|
||
description = schema.TextLine( | ||
title=_("Description"), | ||
description=_("About the author"), | ||
required=False, | ||
) | ||
|
||
|
||
@implementer(IAuthor) | ||
class Author(Container): | ||
"""An author.""" |
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
98 changes: 98 additions & 0 deletions
98
backend/src/collective_blog/src/collective_blog/profiles/default/types/Author.xml
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,98 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<object xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
meta_type="Dexterity FTI" | ||
name="Author" | ||
i18n:domain="collective_blog" | ||
> | ||
|
||
<!-- Basic properties --> | ||
<property name="title" | ||
i18n:translate="" | ||
>Author</property> | ||
<property name="description" | ||
i18n:translate="" | ||
/> | ||
|
||
<property name="allow_discussion">False</property> | ||
<property name="factory">Author</property> | ||
<property name="icon_expr" /> | ||
<property name="link_target" /> | ||
|
||
<!-- Hierarchy control --> | ||
<property name="allowed_content_types" /> | ||
<property name="filter_content_types">True</property> | ||
<property name="global_allow">True</property> | ||
|
||
<!-- Schema, class and security --> | ||
<property name="add_permission">cmf.AddPortalContent</property> | ||
<property name="klass">collective_blog.content.author.Author</property> | ||
<property name="model_file" /> | ||
<property name="model_source" /> | ||
<property name="schema">collective_blog.content.author.IAuthor</property> | ||
|
||
<!-- Enabled behaviors --> | ||
<property name="behaviors" | ||
purge="true" | ||
> | ||
<element value="volto.blocks" /> | ||
<element value="volto.preview_image" /> | ||
<element value="plone.namefromtitle" /> | ||
<element value="plone.allowdiscussion" /> | ||
<element value="plone.excludefromnavigation" /> | ||
<element value="plone.shortname" /> | ||
<element value="plone.dublincore" /> | ||
<element value="plone.richtext" /> | ||
<element value="plone.relateditems" /> | ||
<element value="plone.versioning" /> | ||
<element value="plone.tableofcontents" /> | ||
<element value="plone.locking" /> | ||
</property> | ||
|
||
<!-- View information --> | ||
<property name="add_view_expr">string:${folder_url}/++add++author</property> | ||
<property name="immediate_view">view</property> | ||
<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 action_id="view" | ||
category="object" | ||
condition_expr="" | ||
description="" | ||
title="View" | ||
url_expr="string:${object_url}" | ||
visible="True" | ||
i18n:attributes="title" | ||
> | ||
<permission value="View" /> | ||
</action> | ||
<action action_id="edit" | ||
category="object" | ||
condition_expr="" | ||
description="" | ||
title="Edit" | ||
url_expr="string:${object_url}/edit" | ||
visible="True" | ||
i18n:attributes="title" | ||
> | ||
<permission value="Modify portal content" /> | ||
</action> | ||
|
||
</object> |
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.