Skip to content
Merged
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
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Contributors

- Lur Ibargutxi [libargutxi@codesyntax.com]
- Plone Community [collective@plone.org]
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cs_dynamicpages Copyright 2025, Lur Ibargutxi
cs_dynamicpages Copyright 2025, Plone Community

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ requirements-mxdev.txt: pyproject.toml mx.ini ## Generate constraints file

$(VENV_FOLDER): requirements-mxdev.txt ## Install dependencies
@echo "$(GREEN)==> Install environment$(RESET)"
@uv venv --python=3.10 $(VENV_FOLDER)
@uv venv $(VENV_FOLDER)
@uv pip install -r requirements-mxdev.txt

.PHONY: sync
Expand Down Expand Up @@ -131,4 +131,10 @@ test-coverage: $(VENV_FOLDER) ## run tests with coverage

## Add bobtemplates features (check bobtemplates.plone's documentation to get the list of available features)
add: $(VENV_FOLDER)
/home/lur/plonecli_azkena/bin/plonecli add $(filter-out $@,$(MAKECMDGOALS))
@uvx plonecli add -b .mrbob.ini $(filter-out $@,$(MAKECMDGOALS))

.PHONY: release
release: $(VENV_FOLDER) ## Create a release
@echo "$(GREEN)==> Create a release$(RESET)"
@uv pip install -e ".[release]"
@uv run fullrelease
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cs_dynamicpages

An addon to create dynamic pages for Plone
A new addon for Plone

## Features

Expand All @@ -22,8 +22,8 @@ make create-site

## Contribute

- [Issue tracker](https://github.com/cs/cs_dynamicpages/issues)
- [Source code](https://github.com/cs/cs_dynamicpages/)
- [Issue tracker](https://github.com/collective/cs_dynamicpages/issues)
- [Source code](https://github.com/collective/cs_dynamicpages/)

### Prerequisites ✅

Expand All @@ -38,7 +38,7 @@ make create-site
1. Clone this repository, then change your working directory.

```shell
git clone git@github.com:cs/cs_dynamicpages.git
git clone git@github.com:collective/cs_dynamicpages.git
cd cs_dynamicpages
```

Expand Down Expand Up @@ -83,4 +83,4 @@ The project is licensed under GPLv2.

## Credits and acknowledgements 🙏

Generated using [Cookieplone (0.9.7)](https://github.com/plone/cookieplone) and [cookieplone-templates (6782781)](https://github.com/plone/cookieplone-templates/commit/6782781dae4bafb227467828066ab16b84c23750) on 2025-07-07 09:25:15.108762. A special thanks to all contributors and supporters!
Generated using [Cookieplone (0.9.7)](https://github.com/plone/cookieplone) and [cookieplone-templates (4d55553)](https://github.com/plone/cookieplone-templates/commit/4d55553d61416df56b3360914b398d675b3f72a6) on 2025-07-17 11:59:12.982862. A special thanks to all contributors and supporters!
55 changes: 31 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,49 +1,55 @@
[project]
name = "cs_dynamicpages"
dynamic = ["version"]
description = "An addon to create dynamic pages for Plone"
description = "A new addon for Plone"
readme = "README.md"
license = "GPL-2.0-only"
requires-python = ">=3.10"
authors = [
{ name = "Lur Ibargutxi", email = "libargutxi@codesyntax.com" },
]
keywords = [
"CMS",
"Plone",
"Python",
]
authors = [{ name = "Plone Community", email = "collective@plone.org" }]
keywords = ["CMS", "Plone", "Python"]
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Web Environment",
"Framework :: Plone","Framework :: Plone :: 6.0","Framework :: Plone :: 6.1",
"Framework :: Plone",
"Framework :: Plone :: 6.0",
"Framework :: Plone :: 6.1",
"Framework :: Plone :: Addon",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"Operating System :: OS Independent",
"Programming Language :: Python","Programming Language :: Python :: 3.10","Programming Language :: Python :: 3.11","Programming Language :: Python :: 3.12","Programming Language :: Python :: 3.13",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"Products.CMFPlone",
"plone.api",
"z3c.jbot",
"collective.z3cform.datagridfield",
]

[project.optional-dependencies]
test = [
"horse-with-no-namespace",
"plone.app.testing",
"plone.classicui","plone.restapi[test]",
"plone.app.contenttypes[test]",
"plone.classicui",
"plone.restapi[test]",
"pytest",
"pytest-cov",
"pytest-plone>=0.5.0",
]
release = [
"zest.releaser[recommended]",
"zestreleaser.towncrier",
"zest.pocompile",
]

[project.urls]
Homepage = "https://github.com/cs/cs_dynamicpages"
Homepage = "https://github.com/collective/cs_dynamicpages"
PyPI = "https://pypi.org/project/cs_dynamicpages"
Source = "https://github.com/cs/cs_dynamicpages"
Tracker = "https://github.com/cs/cs_dynamicpages/issues"
Source = "https://github.com/collective/cs_dynamicpages"
Tracker = "https://github.com/collective/cs_dynamicpages/issues"


[project.entry-points."plone.autoinclude.plugin"]
Expand All @@ -63,9 +69,7 @@ build-backend = "hatchling.build"
strict-naming = true

[tool.hatch.build.targets.sdist]
exclude = [
"/.github",
]
exclude = ["/.github"]

[tool.hatch.build.targets.wheel]
packages = ["src/cs_dynamicpages"]
Expand All @@ -76,7 +80,7 @@ filename = "CHANGELOG.md"
start_string = "<!-- towncrier release notes start -->\n"
title_format = "## {version} ({project_date})"
template = "news/.changelog_template.jinja"
issue_format = "[#{issue}](https://github.com/cs/cs_dynamicpages/issues/{issue})"
issue_format = "[#{issue}](https://github.com/collective/cs_dynamicpages/issues/{issue})"
underlines = ["", "", ""]

[[tool.towncrier.type]]
Expand Down Expand Up @@ -131,7 +135,8 @@ lint.select = [
# mccabe
"C90",
# pycodestyle
"E", "W",
"E",
"W",
# pyflakes
"F",
# pygrep-hooks
Expand Down Expand Up @@ -168,6 +173,8 @@ testpaths = ["tests"]
source_pkgs = ["cs_dynamicpages", "tests"]
branch = true
parallel = true
omit = [
"src/cs_dynamicpages/locales/*.py",
]
omit = ["src/cs_dynamicpages/locales/*.py"]


[tool.zest-releaser]
python-file-with-version = "src/cs_dynamicpages/__init__.py"
16 changes: 8 additions & 8 deletions src/cs_dynamicpages/behaviors/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

<!-- -*- extra stuff goes here -*- -->

<plone:behavior
name="cs_dynamicpages.row_columns"
title="RowColumns"
description="This behavior provides..."
provides=".row_columns.IRowColumns"
factory=".row_columns.RowColumns"
marker=".row_columns.IRowColumnsMarker"
/>
<plone:behavior
name="cs_dynamicpages.row_columns"
title="RowColumns"
description="This behavior provides..."
factory=".row_columns.RowColumns"
provides=".row_columns.IRowColumns"
marker=".row_columns.IRowColumnsMarker"
/>


<plone:behavior
Expand Down
21 changes: 17 additions & 4 deletions src/cs_dynamicpages/behaviors/related_image.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
from plone.app.z3cform.widgets.contentbrowser import ContentBrowserFieldWidget
# from plone.app.z3cform.widgets.contentbrowser import ContentBrowserFieldWidget
from plone.autoform import directives as form
from plone.autoform.interfaces import IFormFieldProvider
from plone.supermodel import model
from Products.CMFPlone.utils import safe_hasattr
from z3c.relationfield.schema import RelationChoice
from z3c.relationfield.schema import RelationList
from zope import schema
from zope.component import adapter
from zope.interface import implementer
from zope.interface import Interface
from zope.interface import provider
from zope import schema


try:
# This is for Plone 6.1
from plone.app.z3cform.widgets.contentbrowser import (
ContentBrowserFieldWidget as RelatedImageFieldWidget,
)
except ImportError:
# This is for previous versions of Plone
from plone.app.z3cform.widgets.relateditems import (
RelatedItemsFieldWidget as RelatedImageFieldWidget,
)


class IRelatedImageMarker(Interface):
pass
Expand All @@ -29,7 +42,7 @@ class IRelatedImage(model.Schema):

form.widget(
"related_image",
ContentBrowserFieldWidget,
RelatedImageFieldWidget,
vocabulary="plone.app.vocabularies.Catalog",
pattern_options={
"recentlyUsed": True,
Expand Down Expand Up @@ -68,4 +81,4 @@ def image_position(self):

@image_position.setter
def image_position(self, value):
self.context.image_position = value
self.context.image_position = value
12 changes: 4 additions & 8 deletions src/cs_dynamicpages/behaviors/row_columns.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# -*- coding: utf-8 -*-

from cs_dynamicpages import _
from plone import schema
from plone.autoform.interfaces import IFormFieldProvider
from plone.supermodel import model
from Products.CMFPlone.utils import safe_hasattr
from zope.component import adapter
from zope.interface import Interface
from zope.interface import implementer
from zope.interface import Interface
from zope.interface import provider


Expand All @@ -17,8 +14,7 @@ class IRowColumnsMarker(Interface):

@provider(IFormFieldProvider)
class IRowColumns(model.Schema):
"""
"""
""" """

columns = schema.Choice(
title="Columns",
Expand All @@ -30,13 +26,13 @@ class IRowColumns(model.Schema):

@implementer(IRowColumns)
@adapter(IRowColumnsMarker)
class RowColumns(object):
class RowColumns:
def __init__(self, context):
self.context = context

@property
def columns(self):
if safe_hasattr(self.context, 'columns'):
if safe_hasattr(self.context, "columns"):
return self.context.columns
return None

Expand Down
10 changes: 0 additions & 10 deletions src/cs_dynamicpages/browser/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@



<!-- Set overrides folder for Just-a-Bunch-Of-Templates product -->
<include
package="z3c.jbot"
file="meta.zcml"
/>
<browser:jbot
directory="overrides"
layer="cs_dynamicpages.interfaces.IBrowserLayer"
/>

<!-- Publish static files -->
<plone:static
directory="static"
Expand Down
4 changes: 2 additions & 2 deletions src/cs_dynamicpages/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

<!-- -*- extra stuff goes here -*- -->

<include package=".vocabularies" />
<include package=".vocabularies" />


<include package=".vocabularies" />
<include package=".vocabularies" />


<include package=".controlpanels" />
Expand Down
10 changes: 6 additions & 4 deletions src/cs_dynamicpages/content/dynamic_page_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# from z3c.form.browser.radio import RadioFieldWidget
from zope import schema
from zope.interface import implementer
from plone import api


log = getLogger(__name__)

Expand Down Expand Up @@ -52,10 +52,12 @@ def featured_list(self):

def show_featured_add_button(self):
row_type = self.row_type
row_type_fields = api.portal.get_registry_record('cs_dynamicpages.dynamica_pages_control_panel.row_type_fields')
row_type_fields = api.portal.get_registry_record(
"cs_dynamicpages.dynamica_pages_control_panel.row_type_fields"
)
for row_type_field in row_type_fields:
if row_type_field['row_type'] == row_type:
return row_type_field['row_type_has_featured_add_button']
if row_type_field["row_type"] == row_type:
return row_type_field["row_type_has_featured_add_button"]
return False

def render(self, request):
Expand Down
3 changes: 2 additions & 1 deletion src/cs_dynamicpages/content/dynamic_page_row_featured.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# from plone.app.textfield import RichText
# from plone.autoform import directives
from plone import api
from plone.dexterity.content import Item

# from plone.namedfile import field as namedfile
Expand All @@ -9,7 +10,7 @@
# from z3c.form.browser.radio import RadioFieldWidget
# from zope import schema
from zope.interface import implementer
from plone import api


# from cs_dynamicpages import _

Expand Down
Loading
Loading