Updated contact, added phone_number and company dev-dc
authorDamien Correia
Tue, 13 Nov 2018 14:06:54 +0100
branchdev-dc
changeset 1087 978a2b9123b9
parent 1086 3d259e1718ef
child 1088 c83faa4b4559
child 1091 40deb3d316ac
Updated contact, added phone_number and company
src/pyams_content/component/paragraph/contact.py
src/pyams_content/component/paragraph/interfaces/contact.py
--- a/src/pyams_content/component/paragraph/contact.py	Tue Nov 13 14:05:02 2018 +0100
+++ b/src/pyams_content/component/paragraph/contact.py	Tue Nov 13 14:06:54 2018 +0100
@@ -46,8 +46,10 @@
 
     name = FieldProperty(IContactParagraph['name'])
     charge = FieldProperty(IContactParagraph['charge'])
+    company = FieldProperty(IContactParagraph['company'])
     contact_email = FieldProperty(IContactParagraph['contact_email'])
     contact_form = FieldProperty(IContactParagraph['contact_form'])
+    phone_number = FieldProperty(IContactParagraph['phone_number'])
     _photo = FileProperty(IContactParagraph['photo'])
 
     if have_gis:
--- a/src/pyams_content/component/paragraph/interfaces/contact.py	Tue Nov 13 14:05:02 2018 +0100
+++ b/src/pyams_content/component/paragraph/interfaces/contact.py	Tue Nov 13 14:06:54 2018 +0100
@@ -9,6 +9,7 @@
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
 #
+from zope.schema._field import ASCIILine
 
 __docformat__ = 'restructuredtext'
 
@@ -50,12 +51,16 @@
 
     name = TextLine(title=_("Contact identity"),
                     description=_("Name of the contact"),
-                    required=True)
+                    required=False)
 
     charge = I18nTextLineField(title=_("In charge of"),
                                description=_("Label of contact function"),
                                required=False)
 
+    company = TextLine(title=_("Company"),
+                               description=_("Business name of the employer"),
+                               required=False)
+
     contact_email = MailAddressField(title=_("Email address"),
                                      description=_("Contact email address"),
                                      required=False)
@@ -65,6 +70,10 @@
                                           required=False,
                                           content_type=FORM_CONTENT_TYPE)
 
+    phone_number = ASCIILine(title=_('Phone number'),
+                             description=_('Phone number in international format.\n E.g. +33 ....'),
+                             required=False, )
+
     photo = ImageField(title=_("Photo"),
                        description=_("Use 'browse' button to select contact picture"),
                        required=False)