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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 1.0.22 (unreleased)

### Added

- Add Mastodon and Website fields to FoundationMember content type
- Add Mastodon field to FoundationSponsor content type
[@Shamonti]

## 1.0.21 (unreleased)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,15 @@ class IFoundationSponsor(Schema):
required=False,
)

mastodon = schema.URI(
title=_PMF("Mastodon profile", default="Mastodon profile"),
description=_PMF(
"Full Mastodon profile URL (e.g., https://plone.social/@plone)",
default="Full Mastodon profile URL (e.g., https://plone.social/@plone)",
),
required=False,
)

read_permission(connection_to_plone="ploneorg.foundationsponsor.view")
connection_to_plone = RichText(
title=_PMF("Connection to Plone", default="Connection to Plone"),
Expand Down
6 changes: 5 additions & 1 deletion backend/src/ploneorg/src/ploneorg/content/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class IFoundationMember(model.Schema):
model.fieldset(
"social_networks",
_("Social Networks"),
fields=["github", "twitter", "linkedin"],
fields=["github", "twitter", "linkedin", "mastodon", "website"],
)

# Basic info
Expand Down Expand Up @@ -74,9 +74,13 @@ class IFoundationMember(model.Schema):
github = schema.TextLine(title=_("Github username"), required=False)
twitter = schema.TextLine(title=_("Twitter username"), required=False)
linkedin = schema.URI(title=_("Linkedin profile"), required=False)
mastodon = schema.URI(title=_("Mastodon profile"), required=False)
website = schema.URI(title=_("Website"), required=False)
widget("twitter", placeholder=_("i.e.: plone"))
widget("github", placeholder=_("i.e.: plone"))
widget("linkedin", placeholder=_("i.e.: https://www.linkedin.com/in/plone/"))
widget("mastodon", placeholder=_("i.e.: https://plone.social/@plone"))
widget("website", placeholder=_("i.e.: https://plone.org"))

# Read Permission
read_permission(
Expand Down
5 changes: 5 additions & 0 deletions backend/src/ploneorg/tests/test_content_member.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for Foundation Member content type."""

from AccessControl.unauthorized import Unauthorized
from kitconcept import api
from plone.app.testing import setRoles
Expand Down Expand Up @@ -48,6 +49,8 @@ def _payload(self) -> dict:
"github": "holden-space",
"twitter": "holden-space",
"linkedin": "https://www.linkedin.com/in/holden-space/",
"mastodon": "https://plone.social/@holden-space",
"website": "https://rocinante.space",
}

def test_cannot_create_outside_container(self):
Expand Down Expand Up @@ -128,6 +131,8 @@ def _payload() -> dict:
"github": "holden-space",
"twitter": "holden-space",
"linkedin": "https://www.linkedin.com/in/holden-space/",
"mastodon": "https://plone.social/@holden-space",
"website": "https://rocinante.space",
}

def test_manager_create_new_foundation_member(self):
Expand Down