Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/83.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The dexterity editor does not allow editing portal types derived by a schema because that has no persistent effect
4 changes: 4 additions & 0 deletions plone/schemaeditor/browser/schema/listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class SchemaListing(AutoExtensibleForm, form.Form):
showEmptyGroups = True
template = ViewPageTemplateFile('schema_listing.pt')
ignoreRequiredOnExtract = True
read_only = False

@property
def schema(self):
Expand Down Expand Up @@ -136,11 +137,14 @@ def handleSaveDefaults(self, action):

class ReadOnlySchemaListing(SchemaListing):
buttons = button.Buttons()
read_only = True

def edit_url(self, field):
return
delete_url = edit_url

def protected_field(self, field):
return True

class SchemaListingPage(FormWrapper):

Expand Down
30 changes: 18 additions & 12 deletions plone/schemaeditor/browser/schema/schema_listing.pt
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
<div xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
tal:omit-tag="" i18n:domain="plone">
<a id="add-field" class="pat-plone-modal"
href="${context/absolute_url}/@@add-field">
<button style="float: right; display: block;"
i18n:translate="add_new_field_hellip">Add new field&hellip;</button>
</a>

<a id="add-fieldset" class="pat-plone-modal" tal:condition="context/enableFieldsets"
href="${context/absolute_url}/@@add-fieldset">
<button style="float: right; display: block;"
i18n:translate="add_fieldset_hellip">Add new fieldset&hellip;</button>
</a>
tal:define="read_only python:view.read_only"
tal:omit-tag=""
i18n:domain="plone"
>

<tal:editable condition="not: read_only">
<a id="add-field" class="pat-plone-modal"
href="${context/absolute_url}/@@add-field">
<button style="float: right; display: block;"
i18n:translate="add_new_field_hellip">Add new field&hellip;</button>
</a>

<a id="add-fieldset" class="pat-plone-modal" tal:condition="context/enableFieldsets"
href="${context/absolute_url}/@@add-fieldset">
<button style="float: right; display: block;"
i18n:translate="add_fieldset_hellip">Add new fieldset&hellip;</button>
</a>
</tal:editable>

<metal:form metal:use-macro="context/@@ploneform-macros/form">
<metal:top-slot metal:fill-slot="formtop">
Expand Down