Skip to content

Commit 1978506

Browse files
authored
Implement new behavior for Person content type (#228)
* Implement new behavior for Person content type * Format codebase * Lint codebase * Format codebase * Modify our upgrade to only run the pending upgrade steps for collective.person
1 parent 68de17b commit 1978506

20 files changed

Lines changed: 1507 additions & 1041 deletions

File tree

backend/news/134.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add a new behavior `kitconcept.intranet.person` with fields academic_title, job_title, department. @ericof

backend/news/134.internal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Upgrade collective.person to version 1.0.0b1. @ericof

backend/pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ dependencies = [
3636
"pas.plugins.keycloakgroups==1.0.0b1",
3737
"pas.plugins.oidc==2.0.0",
3838
"kitconcept.solr==2.0.0a1",
39+
"collective.person==1.0.0b1",
3940
]
4041

4142
[dependency-groups]
@@ -232,6 +233,7 @@ constraint-dependencies = [
232233
"cmarkgfm==2024.11.20",
233234
"collective.MockMailHost==3.0.0",
234235
"collective.monkeypatcher==2.0.0",
236+
"collective.person==1.0.0b1",
235237
"collective.recipe.omelette==2.0.0",
236238
"collective.recipe.template==2.2",
237239
"collective.recipe.vscode==0.1.9",

backend/src/kitconcept/intranet/behaviors/configure.zcml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,12 @@
3939
provides=".lcm.ILCM"
4040
/>
4141

42+
<plone:behavior
43+
name="kitconcept.intranet.person"
44+
title="Intranet-specific Person fields"
45+
description="Add the intranet-specific person fields"
46+
provides=".person.IPersonBehavior"
47+
for="collective.person.content.person.IPerson"
48+
/>
49+
4250
</configure>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from kitconcept.intranet import _
2+
from plone.autoform.interfaces import IFormFieldProvider
3+
from plone.supermodel import model
4+
from zope import schema
5+
from zope.interface import provider
6+
7+
8+
@provider(IFormFieldProvider)
9+
class IPersonBehavior(model.Schema):
10+
"""Behavior: Additional fields for a Person."""
11+
12+
academic_title = schema.Choice(
13+
title=_("Academic Title"),
14+
vocabulary="kitconcept.intranet.vocabularies.academic_titles",
15+
required=False,
16+
)
17+
18+
job_title = schema.TextLine(
19+
title=_("Job Title"),
20+
description=_("Please input the job title of the person."),
21+
required=False,
22+
)
23+
24+
departament = schema.TextLine(
25+
title=_("Department"),
26+
description=_("Please input the department of the person."),
27+
required=False,
28+
)

backend/src/kitconcept/intranet/controlpanels/intranet.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ class IIntranetSettings(Interface):
3939
title=_("Person Picture Aspect Ratio"),
4040
description=_(
4141
"help_person_picture_aspect_ratio",
42-
default="Image aspect ratio of the person's picture. This setting is used for the "
43-
"person picture on the person profile page, on teasers that point to a "
44-
"person profile page and on listings where persons are displayed.",
42+
default="Image aspect ratio of the person's picture. This setting is used "
43+
"for the person picture on the person profile page, on teasers that point "
44+
"to a person profile page and on listings where persons are displayed.",
4545
),
4646
required=True,
4747
default="rounded1to1",

backend/src/kitconcept/intranet/locales/de/LC_MESSAGES/kitconcept.intranet.po

Lines changed: 96 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
msgid ""
22
msgstr ""
33
"Project-Id-Version: PACKAGE VERSION\n"
4-
"POT-Creation-Date: 2025-08-18 19:48+0000\n"
4+
"POT-Creation-Date: 2025-09-09 16:49+0000\n"
55
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
66
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
77
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -22,10 +22,30 @@ msgstr "- Workflow für Intranets. Öffentlicher Zugriff auf veröffentlichte In
2222
msgid "- Workflow for Intranets. Requires authentication."
2323
msgstr "- Workflow für Intranets. Authentifizierung erforderlich."
2424

25-
#: kitconcept/intranet/distributions.zcml:16
25+
#: kitconcept/intranet/controlpanels/intranet.py:49
26+
msgid "1:1 round picture"
27+
msgstr ""
28+
29+
#: kitconcept/intranet/controlpanels/intranet.py:50
30+
msgid "4:5 square picture"
31+
msgstr ""
32+
33+
#: kitconcept/intranet/distributions.zcml:17
2634
msgid "A Plone distribution for Intranets with Plone. Created by kitconcept."
2735
msgstr "Eine Plone-Distribution für Intranets mit Plone. Erstellt von kitconcept."
2836

37+
#: kitconcept/intranet/behaviors/person.py:14
38+
msgid "Academic Title"
39+
msgstr "Akademischer Titel"
40+
41+
#: kitconcept/intranet/behaviors/configure.zcml:48
42+
msgid "Add the intranet-specific person fields"
43+
msgstr "Fügen Sie die intranet-spezifischen Personenfelder hinzu"
44+
45+
#: kitconcept/intranet/behaviors/configure.zcml:40
46+
msgid "Add the lifecycle management fields"
47+
msgstr ""
48+
2949
#: kitconcept/intranet/behaviors/configure.zcml:19
3050
msgid "Allows to set configuration that will be injected into the blocks default configuration."
3151
msgstr "Ermöglicht die Festlegung einer Konfiguration, die in die Standardkonfiguration der Blöcke eingefügt wird."
@@ -39,28 +59,36 @@ msgstr "Blockkonfiguration"
3959
msgid "Can only be seen and edited by the owner."
4060
msgstr "Kann nur vom Eigentümer angesehen und bearbeitet werden."
4161

42-
#: kitconcept/intranet/controlpanels/intranet.py:31
62+
#: kitconcept/intranet/controlpanels/intranet.py:33
4363
msgid "Custom CSS"
4464
msgstr "Benutzerdefiniertes CSS"
4565

46-
#: kitconcept/intranet/controlpanels/intranet.py:32
66+
#: kitconcept/intranet/controlpanels/intranet.py:34
4767
msgid "Custom CSS for the intranet."
4868
msgstr "Benutzerdefiniertes CSS für das Intranet."
4969

70+
#: kitconcept/intranet/behaviors/person.py:26
71+
msgid "Department"
72+
msgstr "Abteilung"
73+
74+
#: kitconcept/intranet/vocabularies/person.py:17
75+
msgid "Dr."
76+
msgstr "Dr."
77+
5078
#: kitconcept/intranet/profiles/default/types/Location.xml
5179
#: kitconcept/intranet/profiles/default/types/Organisational_Unit.xml
5280
msgid "Edit"
5381
msgstr "Bearbeiten"
5482

55-
#: kitconcept/intranet/controlpanels/intranet.py:19
83+
#: kitconcept/intranet/controlpanels/intranet.py:21
5684
msgid "External Search URL"
5785
msgstr "Externe Such-URL"
5886

59-
#: kitconcept/intranet/behaviors/configure.zcml:29
87+
#: kitconcept/intranet/behaviors/configure.zcml:26
6088
msgid "Fields for Location"
6189
msgstr "Felder für Standort"
6290

63-
#: kitconcept/intranet/behaviors/configure.zcml:39
91+
#: kitconcept/intranet/behaviors/configure.zcml:33
6492
msgid "Fields for Organisational Unit"
6593
msgstr "Felder für Organisationseinheit"
6694

@@ -77,12 +105,24 @@ msgstr "Öffentlicher Intranet-Workflow"
77105
msgid "Intranet Restricted Workflow"
78106
msgstr "Intranet-beschränkter Workflow"
79107

80-
#: kitconcept/intranet/controlpanels/intranet.py:39
108+
#: kitconcept/intranet/controlpanels/intranet.py:57
81109
msgid "Intranet Settings"
82110
msgstr "Intranet-Einstellungen"
83111

84-
#: kitconcept/intranet/behaviors/configure.zcml:29
85-
#: kitconcept/intranet/behaviors/location.py:19
112+
#: kitconcept/intranet/behaviors/configure.zcml:48
113+
msgid "Intranet-specific Person fields"
114+
msgstr "Intranet-spezifische Personenfelder"
115+
116+
#: kitconcept/intranet/behaviors/person.py:20
117+
msgid "Job Title"
118+
msgstr "Berufsbezeichnung"
119+
120+
#: kitconcept/intranet/behaviors/configure.zcml:40
121+
msgid "Lifecycle Management fields"
122+
msgstr ""
123+
124+
#: kitconcept/intranet/behaviors/configure.zcml:26
125+
#: kitconcept/intranet/behaviors/location.py:16
86126
#: kitconcept/intranet/profiles/default/types/Location.xml
87127
msgid "Location"
88128
msgstr "Standort"
@@ -97,8 +137,8 @@ msgstr "Mitglied zieht Einreichung zurück"
97137
msgid "Member submits content for publication"
98138
msgstr "Mitglied reicht Inhalte zur Veröffentlichung ein"
99139

100-
#: kitconcept/intranet/behaviors/configure.zcml:39
101-
#: kitconcept/intranet/behaviors/organisational_unit.py:20
140+
#: kitconcept/intranet/behaviors/configure.zcml:33
141+
#: kitconcept/intranet/behaviors/organisational_unit.py:16
102142
#: kitconcept/intranet/profiles/default/types/Organisational_Unit.xml
103143
msgid "Organisational Unit"
104144
msgstr "Organisationseinheit"
@@ -108,10 +148,22 @@ msgstr "Organisationseinheit"
108148
msgid "Pending review"
109149
msgstr "In Bearbeitung"
110150

111-
#: kitconcept/intranet/controlpanels/intranet.py:26
151+
#: kitconcept/intranet/controlpanels/intranet.py:39
152+
msgid "Person Picture Aspect Ratio"
153+
msgstr ""
154+
155+
#: kitconcept/intranet/controlpanels/intranet.py:28
112156
msgid "Placeholder text for the search field."
113157
msgstr "Platzhaltertext für das Suchfeld."
114158

159+
#: kitconcept/intranet/behaviors/person.py:27
160+
msgid "Please input the department of the person."
161+
msgstr "Bitte geben Sie die Abteilung der Person an."
162+
163+
#: kitconcept/intranet/behaviors/person.py:21
164+
msgid "Please input the job title of the person."
165+
msgstr "Bitte geben Sie die Berufsbezeichnung der Person an."
166+
115167
#: kitconcept/intranet/profiles.zcml:14
116168
msgid "Policy package to install our site"
117169
msgstr "Paket mit Richtlinien zur Installation unserer Website"
@@ -121,6 +173,14 @@ msgstr "Paket mit Richtlinien zur Installation unserer Website"
121173
msgid "Private"
122174
msgstr "Privat"
123175

176+
#: kitconcept/intranet/vocabularies/person.py:16
177+
msgid "Prof."
178+
msgstr "Prof."
179+
180+
#: kitconcept/intranet/vocabularies/person.py:18
181+
msgid "Prof. Dr."
182+
msgstr "Prof. Dr."
183+
124184
#: kitconcept/intranet/profiles/default/workflows/simple_intranet_workflow/definition.xml
125185
#: kitconcept/intranet/profiles/restricted/workflows/simple_intranet_workflow/definition.xml
126186
msgid "Publish"
@@ -156,7 +216,7 @@ msgstr "Der Prüfer veröffentlicht Inhalte."
156216
msgid "Reviewer sends content back for re-drafting"
157217
msgstr "Der Prüfer sendet den Inhalt zur Überarbeitung zurück."
158218

159-
#: kitconcept/intranet/controlpanels/intranet.py:25
219+
#: kitconcept/intranet/controlpanels/intranet.py:27
160220
msgid "Search Field Placeholder"
161221
msgstr "Suchfeld-Platzhalter"
162222

@@ -191,7 +251,7 @@ msgstr "Taxonomie"
191251
msgid "Through The Web blocks configuration"
192252
msgstr "Blockkonfiguration durch die Weboberfläche"
193253

194-
#: kitconcept/intranet/controlpanels/intranet.py:20
254+
#: kitconcept/intranet/controlpanels/intranet.py:22
195255
msgid "Used in the intranet header seach bar."
196256
msgstr "Verwendet in der Suchleiste der Intranet-Kopfzeile."
197257

@@ -223,12 +283,17 @@ msgstr "Konfigurieren Sie einige Aspekte der Standardblockkonfiguration."
223283
msgid "help_organisational_unit"
224284
msgstr "Nach Organisationseinheit filtern"
225285

286+
#. Default: "Image aspect ratio of the person's picture. This setting is used for the person picture on the person profile page, on teasers that point to a person profile page and on listings where persons are displayed."
287+
#: kitconcept/intranet/controlpanels/intranet.py:40
288+
msgid "help_person_picture_aspect_ratio"
289+
msgstr ""
290+
226291
#. Default: "Filter by location"
227292
#: kitconcept/intranet/profiles/default/registry/querystring.xml
228293
msgid "help_place"
229294
msgstr "Nach Standort filtern"
230295

231-
#: kitconcept/intranet/distributions.zcml:16
296+
#: kitconcept/intranet/distributions.zcml:17
232297
msgid "kitconcept Intranet"
233298
msgstr ""
234299

@@ -244,6 +309,16 @@ msgstr ""
244309
msgid "kitconcept.intranet: Solr Support"
245310
msgstr ""
246311

312+
#. Default: "Authors"
313+
#: kitconcept/intranet/behaviors/lcm.py:53
314+
msgid "label_authors"
315+
msgstr ""
316+
317+
#. Default: "Feedback to"
318+
#: kitconcept/intranet/behaviors/lcm.py:40
319+
msgid "label_feedback_person"
320+
msgstr ""
321+
247322
#. Default: "Organisational Unit"
248323
#: kitconcept/intranet/profiles/default/registry/querystring.xml
249324
msgid "label_organisational_unit"
@@ -253,3 +328,8 @@ msgstr "Organisationseinheit"
253328
#: kitconcept/intranet/profiles/default/registry/querystring.xml
254329
msgid "label_place"
255330
msgstr "Ort"
331+
332+
#. Default: "Content Owner:"
333+
#: kitconcept/intranet/behaviors/lcm.py:27
334+
msgid "label_responsible"
335+
msgstr ""

0 commit comments

Comments
 (0)