equal
deleted
inserted
replaced
18 from pyams_content.component.paragraph import IBaseParagraph |
18 from pyams_content.component.paragraph import IBaseParagraph |
19 from pyams_content.features.renderer import IRenderedContent |
19 from pyams_content.features.renderer import IRenderedContent |
20 |
20 |
21 # import packages |
21 # import packages |
22 from pyams_file.schema import ImageField |
22 from pyams_file.schema import ImageField |
23 from pyams_gis.schema import GeoPointField |
23 try: |
|
24 from pyams_gis.schema import GeoPointField |
|
25 except ImportError: |
|
26 have_gis = False |
|
27 else: |
|
28 have_gis = True |
24 from pyams_i18n.schema import I18nTextLineField |
29 from pyams_i18n.schema import I18nTextLineField |
25 from zope.schema import TextLine, Text, Choice |
30 from zope.schema import TextLine, Text, Choice |
26 |
31 |
27 from pyams_content import _ |
32 from pyams_content import _ |
28 |
33 |
48 |
53 |
49 photo = ImageField(title=_("Photo"), |
54 photo = ImageField(title=_("Photo"), |
50 description=_("Use 'browse' button to select contact picture"), |
55 description=_("Use 'browse' button to select contact picture"), |
51 required=False) |
56 required=False) |
52 |
57 |
53 gps_location = GeoPointField(title=_("GPS location"), |
58 if have_gis: |
54 description=_("GPS coordinates used to locate contact"), |
59 gps_location = GeoPointField(title=_("GPS location"), |
55 required=False) |
60 description=_("GPS coordinates used to locate contact"), |
|
61 required=False) |
56 |
62 |
57 address = Text(title=_("Address"), |
63 address = Text(title=_("Address"), |
58 required=False) |
64 required=False) |
59 |
65 |
60 renderer = Choice(title=_("Contact template"), |
66 renderer = Choice(title=_("Contact template"), |