Skip to content

Commit

Permalink
remove newsitem template override, use default dexterity view for new… (
Browse files Browse the repository at this point in the history
#110)

* remove newsitem template override, use default dexterity view for newsitem in backend
* black
* zpretty
* tests
* tests
  • Loading branch information
mamico authored Aug 23, 2024
1 parent 2492385 commit d7a114e
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 23 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jobs:
plone: ["52", "60"]
tz: ["UTC", "Europe/Rome"]
exclude:
- python: "3.8"
plone: "60"
- python: "3.9"
plone: "52"
- python: "3.10"
plone: "52"
- python: "3.11"
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Changelog
5.5.0 (2024-07-10)
------------------

- remove newsitem template override, use default dexterity view for newsitem in backend
[mamico]

- Fixed limit event occurrences to 100.
[eikichi18]
- Add dependency with collective.volto.sitesettings.
Expand Down
10 changes: 10 additions & 0 deletions src/redturtle/volto/browser/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
layer="redturtle.volto.interfaces.IRedturtleVoltoLayer"
/>

<!-- overrides to default dexterity view -->
<browser:page
name="newsitem_view"
for="plone.app.contenttypes.interfaces.INewsItem"
class="plone.dexterity.browser.view.DefaultView"
template="item.pt"
permission="zope2.View"
layer="redturtle.volto.interfaces.IRedturtleVoltoLayer"
/>

<browser:page
name="redturtle-volto-settings"
for="Products.CMFPlone.interfaces.IPloneSiteRoot"
Expand Down
50 changes: 50 additions & 0 deletions src/redturtle/volto/browser/item.pt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
lang="en"
metal:use-macro="context/@@main_template/macros/master"
xml:lang="en"
i18n:domain="plone"
>
<body>

<metal:main fill-slot="main">

<h1 class="documentFirstHeading"
tal:content="context/Title"
></h1>

<p class="documentDescription"
tal:content="context/Description"
></p>

<tal:block repeat="widget view/widgets/values">
<div class="field"
tal:condition="python:widget.__name__ not in ('IBasic.title', 'IBasic.description', 'title', 'description',)"
>
<label tal:content="widget/label"></label>
<br />
<div tal:content="structure widget/render"></div>
</div>
</tal:block>

<fieldset tal:repeat="group view/groups"
tal:attributes="
id python:''.join((group.prefix, 'groups.', group.__name__)).replace('.', '-');
"
>
<legend tal:content="group/label"></legend>
<div class="field"
tal:repeat="widget group/widgets/values"
>
<label tal:content="widget/label"></label>
<br />
<div tal:content="structure widget/render"></div>
</div>
</fieldset>

</metal:main>

</body>
</html>

This file was deleted.

5 changes: 4 additions & 1 deletion src/redturtle/volto/interfaces.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# -*- coding: utf-8 -*-
# from zope.publisher.interfaces.browser import IDefaultBrowserLayer
from plone.app.contenttypes.interfaces import (
IPloneAppContenttypesLayer as IDefaultBrowserLayer,
)
from plone.dexterity.interfaces import IDexterityContent
from plone.restapi.controlpanels.interfaces import IControlpanel
from redturtle.volto import _
from zope.interface import Interface
from zope.publisher.interfaces.browser import IDefaultBrowserLayer
from zope.schema import Bool


Expand Down
1 change: 1 addition & 0 deletions test_plone60.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ mccabe = 0.7.0
plone.recipe.codeanalysis = 3.0.1
pycodestyle = 2.10.0
pyflakes = 3.0.1
docutils = 0.21.2
plone.stringinterp = 2.0.0
# plone.restapi >= 9.6.1 don't put subjects into SearchableText (to investigate)
plone.restapi = 9.6.0

0 comments on commit d7a114e

Please sign in to comment.