# HG changeset patch # User Thierry Florac # Date 1542724817 -3600 # Node ID a6429e91f09105f3d61b39ecec2a80dc75761de4 # Parent 829f481fe2a6ca73fd1e44d5ae1240e0c8054018# Parent df8da54d790ab5584bc9d379a1f0c763ec64d65e Added custom label to contact card link button diff -r 829f481fe2a6 -r a6429e91f091 docs/HISTORY.txt --- a/docs/HISTORY.txt Tue Nov 20 09:13:12 2018 +0100 +++ b/docs/HISTORY.txt Tue Nov 20 15:40:17 2018 +0100 @@ -1,6 +1,10 @@ History ======= +0.1.17 +------ + - added customizable label to contact button + 0.1.16 ------ - added results internal OID into view's preview diff -r 829f481fe2a6 -r a6429e91f091 src/pyams_default_theme/component/paragraph/contact.py --- a/src/pyams_default_theme/component/paragraph/contact.py Tue Nov 20 09:13:12 2018 +0100 +++ b/src/pyams_default_theme/component/paragraph/contact.py Tue Nov 20 15:40:17 2018 +0100 @@ -43,6 +43,7 @@ photo_position = FieldProperty(IContactParagraphDefaultRendererSettings['photo_position']) display_map = FieldProperty(IContactParagraphDefaultRendererSettings['display_map']) map_position = FieldProperty(IContactParagraphDefaultRendererSettings['map_position']) + button_label = FieldProperty(IContactParagraphDefaultRendererSettings['button_label']) @property def can_display_photo(self): diff -r 829f481fe2a6 -r a6429e91f091 src/pyams_default_theme/component/paragraph/interfaces/contact.py --- a/src/pyams_default_theme/component/paragraph/interfaces/contact.py Tue Nov 20 09:13:12 2018 +0100 +++ b/src/pyams_default_theme/component/paragraph/interfaces/contact.py Tue Nov 20 15:40:17 2018 +0100 @@ -12,15 +12,11 @@ __docformat__ = 'restructuredtext' - -# import standard library - -# import interfaces +from zope.interface import Attribute, Interface +from zope.schema import Bool, Choice +from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary -# import packages -from zope.interface import Interface, Attribute -from zope.schema import Bool, Choice -from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm +from pyams_i18n.schema import I18nTextLineField from pyams_default_theme import _ @@ -60,3 +56,8 @@ default='right') can_display_map = Attribute("Check if location map can be displayed") + + button_label = I18nTextLineField(title=_("Contact button label"), + description=_("Custom label of the contact button displayed by " + "front-office template"), + required=False) diff -r 829f481fe2a6 -r a6429e91f091 src/pyams_default_theme/component/paragraph/templates/contact-default.pt --- a/src/pyams_default_theme/component/paragraph/templates/contact-default.pt Tue Nov 20 09:13:12 2018 +0100 +++ b/src/pyams_default_theme/component/paragraph/templates/contact-default.pt Tue Nov 20 15:40:17 2018 +0100 @@ -23,8 +23,9 @@ Contact email: - - ${view.contact_email} + + ${button_label or view.contact_email}