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 .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
python-version: [3.11]

steps:
# git checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
python-version: [3.11]

steps:
# git checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pyroma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
python-version: [3.11]

steps:
# git checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python: ["3.8"]
python: ["3.11"]
plone: ["60"]
steps:
- uses: actions/checkout@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zpretty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
python-version: [3.11]

steps:
# git checkout
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ output.xml
pip-selfcheck.json
pyvenv.cfg
report.html
.idea/
.vscode/
.tox/
reports/
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@ default_stages: [commit, push]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/psf/black
rev: 22.6.0
rev: 24.4.2
hooks:
- id: black
# args: ["--line-length=88", "--check", "--diff", "--force-exclude=migrations", "src/"]
args: ["--line-length=88", "--force-exclude=migrations", "src/"]
types: [python]
entry: black
- repo: https://github.com/PyCQA/flake8.git
rev: "3.9.2"
rev: "7.0.0"
hooks:
- id: flake8
name: flake8
entry: flake8
additional_dependencies: ["flake8-django==0.0.4", "pylint-django==2.0.11"]
types: [python]
args: ["--max-complexity=30", "--max-line-length=88", "--ignore=DJ01,DJ08,W503,ANN101", "--exclude=docs/*", "src/", "setup.py"]
args: ["--max-line-length=88", "--ignore=DJ01,DJ08,W503,ANN101", "--exclude=docs/*", "src/", "setup.py"]
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
Expand All @@ -45,11 +45,11 @@ repos:
language: pygrep
types: [python]
- repo: https://github.com/collective/zpretty
rev: 2.4.1
rev: 3.1.0
hooks:
- id: zpretty
name: zpretty
- repo: https://github.com/regebro/pyroma
rev: "3.2"
rev: '4.2'
hooks:
- id: pyroma
8 changes: 7 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ Changelog
=========


1.1.6 (unreleased)
1.2.1 (unreleased)
------------------

- Nothing changed yet.


1.2.0 (2025-02-28)
------------------

- Feedback can now also be added for non-content paths. (Breaking) [eikichi18]


1.1.5 (2024-11-07)
------------------

Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ collective.feedback
===================

Feedback mechanism integration for volto.
Requires volto-feedback >= 0.6.0

Users can add vote and a comment to every page on the site.

Expand All @@ -45,6 +46,7 @@ There are two new specific permission:

- collective.feedback.ManageFeedbacks (collective.feedback: Manage Feedbacks) Allows to reset data (by default Manager and Site Administrator).
- collective.feedback.AccessFeedbacks (collective.feedback: Access Feedbacks) Allows users to list feedbacks on contents where they have that permission (by default Editor, Manager and Site Administrator)
- collective.feedback.ShowDeletedFeedbacks (collective.feedback: Show Deleted Feedbacks) Allows manager to see feedbacks of deleted objects

Feedbacks catalog
=================
Expand All @@ -64,6 +66,7 @@ Add a vote
- Method ``add``
- Parameters: ``data`` (dictionary with parameters)
- Response: unique-id of new record
- Context: only the navigation root

``data`` should be a dictionary with the following parameters:

Expand All @@ -72,6 +75,7 @@ Add a vote
- answer: a custom string, like a comment
- title: the title of the Plone content
- comment: an optional comment
- content: path of the object or name of the view

Others parameters will be ignored.

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

setup(
name="collective.feedback",
version="1.1.6.dev0",
version="1.2.1.dev0",
description="Feedback mechanism integration for io-comune",
long_description=long_description,
# Get more from https://pypi.org/classifiers/
Expand Down
1 change: 1 addition & 0 deletions src/collective/feedback/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"""Init and utils."""
from zope.i18nmessageid import MessageFactory


_ = MessageFactory("collective.feedback")
1 change: 1 addition & 0 deletions src/collective/feedback/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<include file="permissions.zcml" />
<include file="upgrades.zcml" />

<include package=".controlpanels" />
<include package=".storage" />
<include package=".restapi" />

Expand Down
Empty file.
20 changes: 20 additions & 0 deletions src/collective/feedback/controlpanels/configure.zcml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
xmlns:plone="http://namespaces.plone.org/plone"
i18n_domain="collective.feedback"
>

<include
package="Products.CMFCore"
file="permissions.zcml"
/>

<browser:page
name="collective-feedback-settings"
for="Products.CMFPlone.interfaces.IPloneSiteRoot"
class=".settings.CollectiveFeedbackControlPanelView"
permission="cmf.ManagePortal"
/>

</configure>
50 changes: 50 additions & 0 deletions src/collective/feedback/controlpanels/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
from collective.feedback import _
from plone.app.registry.browser.controlpanel import ControlPanelFormWrapper
from plone.app.registry.browser.controlpanel import RegistryEditForm
from plone.restapi.controlpanels.interfaces import IControlpanel
from zope.interface import Interface
from zope.schema import List
from zope.schema import TextLine


class ICollectiveFeedbackSettingsControlpanel(IControlpanel):
""" """


class ICollectiveFeedbackSettings(Interface):
allowed_feedback_view = List(
title=_(
"allowed_feedback_view_label",
default="Vista su cui è possibile lasciare dei feedback",
),
required=True,
default=[
"Login/Logout",
"Ricerca",
"Search",
"Le mie prenotazioni",
"My bookings",
"Prenotazione appuntamento",
"Appointment booking",
"Export appuntamenti",
"Export bookings",
"Area personale",
"Personal area",
"Area operatore",
"Operator area",
],
value_type=TextLine(),
)


class CollectiveFeedbackControlPanelForm(RegistryEditForm):
schema = ICollectiveFeedbackSettings
id = "collective-feedback-control-panel"
label = _("Impostazioni Collective Feedback")


class CollectiveFeedbackControlPanelView(ControlPanelFormWrapper):
""" """

form = CollectiveFeedbackControlPanelForm
2 changes: 1 addition & 1 deletion src/collective/feedback/locales/update.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

import os
import pkg_resources
import subprocess

import pkg_resources

domain = "collective.feedback"
os.chdir(pkg_resources.resource_filename(domain, ""))
Expand Down
34 changes: 22 additions & 12 deletions src/collective/feedback/profiles/default/actions.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<object xmlns:i18n="http://xml.zope.org/namespaces/i18n" meta_type="Plone Actions Tool" name="portal_actions">
<object xmlns:i18n="http://xml.zope.org/namespaces/i18n"
meta_type="Plone Actions Tool"
name="portal_actions"
>

<object meta_type="CMF Action Category" name="user">
<object meta_type="CMF Action" name="feedback-dashboard" i18n:domain="plone">
<property name="title" i18n:translate="">Feedback dashboard</property>
<property name="url_expr">string:${globals_view/navigationRootUrl}/feedback-dashboard</property>
<property name="link_target" />
<property name="icon_expr" />
<property name="permissions">
<element value="collective.feedback: Feedbacks Overview" />
</property>
<property name="visible">True</property>
</object>
<object meta_type="CMF Action Category"
name="user"
>
<object meta_type="CMF Action"
name="feedback-dashboard"
i18n:domain="plone"
>
<property name="title"
i18n:translate=""
>Feedback dashboard</property>
<property name="url_expr">string:${globals_view/navigationRootUrl}/feedback-dashboard</property>
<property name="link_target" />
<property name="icon_expr" />
<property name="permissions">
<element value="collective.feedback: Feedbacks Overview" />
</property>
<property name="visible">True</property>
</object>
</object>

</object>
18 changes: 18 additions & 0 deletions src/collective/feedback/profiles/default/controlpanel.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<object xmlns:i18n="http://xml.zope.org/namespaces/i18n"
name="portal_controlpanel"
i18n:domain="collective.feedback"
>
<configlet action_id="CollectiveFeedbackSettings"
appId="collective.feedback.settings"
category="Products"
condition_expr=""
icon_expr=""
title="Collective Feedback"
url_expr="string:${portal_url}/@@collective-feedback-settings"
visible="True"
i18n:attributes="title"
>
<permission>Manage portal</permission>
</configlet>
</object>
2 changes: 1 addition & 1 deletion src/collective/feedback/profiles/default/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<version>1202</version>
<version>1203</version>
<dependencies>
<dependency>profile-plone.restapi:default</dependency>
<dependency>profile-souper.plone:default</dependency>
Expand Down
1 change: 1 addition & 0 deletions src/collective/feedback/profiles/default/registry/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
>

<!-- -*- extra stuff goes here -*- -->
<records interface="collective.feedback.controlpanels.settings.ICollectiveFeedbackSettings" />

</registry>
12 changes: 9 additions & 3 deletions src/collective/feedback/profiles/default/rolemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,22 @@
<role name="Site Administrator" />
</permission>

<permission acquire="True" name="collective.feedback: Feedbacks Overview">
<permission acquire="True"
name="collective.feedback: Feedbacks Overview"
>
<role name="Authenticated" />
</permission>

<permission acquire="True" name="collective.feedback: Show Deleted Feedbacks">
<permission acquire="True"
name="collective.feedback: Show Deleted Feedbacks"
>
<role name="Manager" />
<role name="Site Administrator" />
</permission>

<permission acquire="True" name="collective.feedback: Update Feedbacks">
<permission acquire="True"
name="collective.feedback: Update Feedbacks"
>
<role name="Manager" />
<role name="Site Administrator" />
</permission>
Expand Down
4 changes: 3 additions & 1 deletion src/collective/feedback/profiles/default/to_1100/rolemap.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<rolemap>
<permissions>
<permission remove="True" name="collective.feedback: Manage Feedbacks" />
<permission name="collective.feedback: Manage Feedbacks"
remove="True"
/>
</permissions>
</rolemap>
Loading