Skip to content

Commit

Permalink
Add field to proprose campaign url
Browse files Browse the repository at this point in the history
  • Loading branch information
thomlamb committed Feb 21, 2025
1 parent f76a308 commit 962563a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/imio/smartweb/core/contents/rest/campaign/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ class ICampaignView(model.Schema):
default=None,
)

propose_project_url = schema.TextLine(
title=_("Propose project URL"),
description=_("URL to propose a project"),
required=False,
)

nb_results = schema.Int(
title=_("Number of items to display"), default=20, required=True
)
Expand Down
1 change: 1 addition & 0 deletions src/imio/smartweb/core/contents/rest/campaign/view.pt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<smartweb-campaign tal:attributes="query-url view/local_query_url;
query-zones-url view/local_query_zones_url;
batch-size view/batch_size;
propose-url view/propose_url;
current-language view/current_language;
display-map view/display_map;
view-path view/view_path;
Expand Down
5 changes: 5 additions & 0 deletions src/imio/smartweb/core/contents/rest/campaign/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@

from imio.smartweb.core.contents.rest.view import BaseRestView
from imio.smartweb.core.interfaces import IOgpViewUtils
from plone import api
from zope.interface import implementer


@implementer(IOgpViewUtils)
class CampaignViewView(BaseRestView):
"""CampaignView view"""

@property
def propose_url(self):
return self.context.propose_project_url

@property
def display_map(self):
return self.context.display_map
Expand Down

0 comments on commit 962563a

Please sign in to comment.