|
1 # |
|
2 # Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net> |
|
3 # All Rights Reserved. |
|
4 # |
|
5 # This software is subject to the provisions of the Zope Public License, |
|
6 # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. |
|
7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
|
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
|
10 # FOR A PARTICULAR PURPOSE. |
|
11 # |
|
12 |
|
13 __docformat__ = 'restructuredtext' |
|
14 |
|
15 # import standard library |
|
16 |
|
17 # import interfaces |
|
18 from pyams_content.component.paragraph import IBaseParagraph |
|
19 from pyams_content.features.renderer import IRenderedContent |
|
20 |
|
21 # import packages |
|
22 from pyams_file.schema import ImageField |
|
23 from pyams_gis.schema import GeoPointField |
|
24 from pyams_i18n.schema import I18nTextLineField |
|
25 from zope.schema import TextLine, Text, Choice |
|
26 |
|
27 from pyams_content import _ |
|
28 |
|
29 |
|
30 # |
|
31 # Contact paragraph |
|
32 # |
|
33 |
|
34 CONTACT_PARAGRAPH_TYPE = 'Contact' |
|
35 |
|
36 |
|
37 class IContactParagraph(IRenderedContent, IBaseParagraph): |
|
38 """Contact paragraph interface""" |
|
39 |
|
40 name = TextLine(title=_("Contact identity"), |
|
41 description=_("Name of the contact"), |
|
42 required=True) |
|
43 |
|
44 charge = I18nTextLineField(title=_("In charge of"), |
|
45 description=_("Label of contact function"), |
|
46 required=False) |
|
47 |
|
48 photo = ImageField(title=_("Photo"), |
|
49 description=_("Use 'browse' button to select contact picture"), |
|
50 required=False) |
|
51 |
|
52 gps_location = GeoPointField(title=_("GPS location"), |
|
53 description=_("GPS coordinates used to locate contact"), |
|
54 required=False) |
|
55 |
|
56 address = Text(title=_("Address"), |
|
57 required=False) |
|
58 |
|
59 renderer = Choice(title=_("Contact template"), |
|
60 description=_("Presentation template used for this contact"), |
|
61 vocabulary='PyAMS contact renderers', |
|
62 default='hidden') |