-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into us_49038_come_fare_per
- Loading branch information
Showing
21 changed files
with
880 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# -*- coding: utf-8 -*- | ||
from collective.address.behaviors import IAddress | ||
from iosanita.contenttypes import _ | ||
from plone.app.dexterity import textindexer | ||
from plone.autoform.interfaces import IFormFieldProvider | ||
from plone.dexterity.interfaces import IDexterityContent | ||
from plone.supermodel import model | ||
from zope import schema | ||
from zope.component import adapter | ||
from zope.interface import implementer | ||
from zope.interface import provider | ||
|
||
|
||
class IAddressNomeSede(model.Schema): | ||
nome_sede = schema.TextLine( | ||
title=_("nome_sede", default="Nome sede"), | ||
description=_( | ||
"help_nome_sede", | ||
default="Inserisci il nome della " | ||
"sede, se non è presente tra i Luoghi del sito.", | ||
), | ||
required=False, | ||
) | ||
textindexer.searchable("nome_sede") | ||
|
||
|
||
class IAddressLocal(model.Schema): | ||
""" """ | ||
|
||
quartiere = schema.TextLine( | ||
title=_("quartiere", default="Quartiere"), | ||
description=_("help_quartiere", default=""), | ||
required=False, | ||
) | ||
|
||
circoscrizione = schema.TextLine( | ||
title=_("circoscrizione", default="Circoscrizione"), | ||
description=_("help_circoscrizione", default=""), | ||
required=False, | ||
) | ||
|
||
# searchabletext indexer | ||
textindexer.searchable("quartiere") | ||
textindexer.searchable("circoscrizione") | ||
|
||
|
||
@provider(IFormFieldProvider) | ||
class IAddressVenue(IAddress, IAddressLocal): | ||
"""""" | ||
|
||
model.fieldset( | ||
"dove", | ||
label=_("dove_label", default="Dove"), | ||
fields=[ | ||
"street", | ||
"zip_code", | ||
"city", | ||
"quartiere", | ||
"circoscrizione", | ||
"country", | ||
], | ||
) | ||
|
||
|
||
@provider(IFormFieldProvider) | ||
class IAddressEvent(IAddress, IAddressNomeSede, IAddressLocal): | ||
"""""" | ||
|
||
model.fieldset( | ||
"luogo", | ||
label=_("luogo_label", default="Luogo"), | ||
fields=[ | ||
"nome_sede", | ||
"street", | ||
"zip_code", | ||
"city", | ||
"quartiere", | ||
"circoscrizione", | ||
"country", | ||
], | ||
) | ||
|
||
|
||
@implementer(IAddressVenue) | ||
@adapter(IDexterityContent) | ||
class AddressVenue(object): | ||
""" """ | ||
|
||
def __init__(self, context): | ||
self.context = context | ||
|
||
|
||
@implementer(IAddressEvent) | ||
@adapter(IDexterityContent) | ||
class AddressEvent(object): | ||
""" """ | ||
|
||
def __init__(self, context): | ||
self.context = context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.