class IOrganizer(model.Schema, IVenueEnabled): organizer_uid = schema.Choice( title=_(u'label_event_organizer', default=u'Organizer'), description=_(u'description_event_organizer', default=u'Select an organizer.'), required=False, missing_value='', defaultFactory=default_organizer, vocabulary='plone.app.vocabularies.Catalog', ) form.widget( 'organizer_uid', RelatedItemsFieldWidget, pattern_options={ 'selectableTypes': ['Venue'], 'basePath': get_base_path, }, ) organizer_notes = schema.Text( title=_(u'label_event_organizer_notes', default=u'Organizer notes'), description=_( u'description_event_organizer_notes', default=u'One-time organizer or additional Information.', ), required=False, default=None, ) directives.fieldset( 'venue', label=_(u'fieldset_venue'), fields=['organizer_uid', 'organizer_notes'], order=10, )
class ILocation(model.Schema, IVenueEnabled, IDXEvent): location_uid = schema.Choice( title=_(u'label_event_location', default=u'Location'), description=_(u'description_event_location', default=u'Select a location.'), required=False, missing_value='', defaultFactory=default_location, vocabulary='plone.app.vocabularies.Catalog', ) form.widget( 'location_uid', RelatedItemsFieldWidget, pattern_options={ 'selectableTypes': ['Venue'], 'basePath': get_base_path, }, ) location_notes = schema.Text( title=_(u'label_event_location_notes', default=u'Location notes'), description=_( u'description_event_location_notes', default=u'One-time location or additional Information.', ), required=False, default=None, ) directives.fieldset( 'venue', label=_(u'fieldset_venue'), fields=['location_uid', 'location_notes'], )
class VenueControlPanelForm(controlpanel.RegistryEditForm): id = "VenueControlPanel" schema = IVenueSettings schema_prefix = "collective.venue" label = _(u"Event Venue Settings") description = _("Settings for venues, which are referenced by events.")
class IVenue(model.Schema): """Marker schema interface for Venue types.""" notes = RichText( title=_(u'label_notes', default=u'Notes'), description=_(u'help_notes', default=u'Additional notes for the address.'), required=False, ) order_after(notes='*')
def map_configuration(self): map_layers = getrec('collective.venue.map_layers') or [] config = { "minimap": True, "default_map_layer": getrec('collective.venue.default_map_layer'), "map_layers": [{ "title": _(it), "id": it } for it in map_layers], } return json.dumps(config)
def map_configuration(self): map_layers = getrec('geolocation.map_layers') or [] config = { "minimap": True, "default_map_layer": getrec('geolocation.default_map_layer'), "map_layers": [ {"title": _(it), "id": it} for it in map_layers ], } return json.dumps(config)
class IVenueSettings(Interface): """Controlpanel schema for venue types. """ search_base = schema.Choice( title=_(u'label_search_base', default=u'Location Search Base'), description=_( u'help_search_base', u"Path, from which venue types should be searched. Useful for " u"lineage multisites to seperate main from childsite venue " u"folders. Keep empty to search anywhere."), required=False, default='', vocabulary='plone.app.vocabularies.Catalog', ) form.widget( 'search_base', RelatedItemsFieldWidget, pattern_options={ 'selectableTypes': ['Folder'], # better: is_folderish 'basePath': get_site, }) default_venue = schema.Choice( title=_(u'label_default_venue', default=u'Default Location'), description=_(u'help_default_venue', u"Default location to be used in events."), required=False, default='', vocabulary='plone.app.vocabularies.Catalog', ) form.widget('default_venue', RelatedItemsFieldWidget, pattern_options={ 'selectableTypes': ['Venue'], 'basePath': get_base_path, }) default_organizer = schema.Choice( title=_(u'label_default_organizer', default=u'Default Organizer'), description=_(u'help_default_organizer', u"Default organizer to be used in events."), required=False, default='', vocabulary='plone.app.vocabularies.Catalog', ) form.widget('default_organizer', RelatedItemsFieldWidget, pattern_options={ 'selectableTypes': ['Venue'], 'basePath': get_base_path, })
class IVenueSettings(Interface): """Controlpanel schema for venue types. """ search_base = schema.Choice( title=_(u'label_search_base', default=u'Location Search Base'), description=_( u'help_search_base', u"Path, from which venue types should be searched. Useful for " u"lineage multisites to seperate main from childsite venue " u"folders. Keep empty to search anywhere."), required=False, default='', vocabulary='plone.app.vocabularies.Catalog', ) form.widget( 'search_base', RelatedItemsFieldWidget, pattern_options={ 'selectableTypes': ['Folder'], # better: is_folderish 'basePath': get_site, }) default_venue = schema.Choice( title=_(u'label_default_venue', default=u'Default Location'), description=_(u'help_default_venue', u"Default location to be used in events."), required=False, default='', vocabulary='plone.app.vocabularies.Catalog', ) form.widget('default_venue', RelatedItemsFieldWidget, pattern_options={ 'selectableTypes': ['Venue'], 'basePath': get_base_path, }) default_organizer = schema.Choice( title=_(u'label_default_organizer', default=u'Default Organizer'), description=_(u'help_default_organizer', u"Default organizer to be used in events."), required=False, default='', vocabulary='plone.app.vocabularies.Catalog', ) form.widget('default_organizer', RelatedItemsFieldWidget, pattern_options={ 'selectableTypes': ['Venue'], 'basePath': get_base_path, }) google_api_key = schema.TextLine( title=_(u'label_google_api_key', default=u'Google maps API Key'), description=_( u'help_google_api_key', default= u'If you want to use the Google Maps search API for higher accuracy, you have to provide a Google Maps API key here.' ), # noqa required=False, default=None) show_google_maps_link = schema.Bool( title=_(u'label_google_maps_link', default=u'Show Google maps link.'), description=_( u'help_google_maps_link', default= u'Show a link to the Google Maps site, which can be used for further actions like routing.' ), # noqa required=False, default=False) default_map_layer = schema.Choice( title=_(u'default_map_layer', u'Default map layer'), description=_(u'help_default_map_layer', default=u'Set the default map layer'), required=False, default=default_map_layer, vocabulary='collective.venue.map_layers') map_layers = schema.List( title=_(u'label_map_layers', u'Map Layers'), description=_(u'help_map_layers', default=u'Set the available map layers'), required=False, default=default_map_layers, missing_value=[], value_type=schema.Choice(vocabulary='collective.venue.map_layers'))