--- a/docs/HISTORY.txt Tue Nov 20 15:19:28 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
--- a/src/pyams_default_theme/component/paragraph/interfaces/contact.py Tue Nov 20 15:19:28 2018 +0100
+++ b/src/pyams_default_theme/component/paragraph/interfaces/contact.py Tue Nov 20 15:40:17 2018 +0100
@@ -12,17 +12,12 @@
__docformat__ = 'restructuredtext'
-
-# import standard library
-
-# import interfaces
-
-# import packages
-from zope.interface import Interface, Attribute
+from zope.interface import Attribute, Interface
from zope.schema import Bool, Choice
-from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
+from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary
from pyams_i18n.schema import I18nTextLineField
+
from pyams_default_theme import _
@@ -62,7 +57,7 @@
can_display_map = Attribute("Check if location map can be displayed")
- button_label = I18nTextLineField(title=_("Button label"),
- description=_("Label of the navigation button displayed by "
+ button_label = I18nTextLineField(title=_("Contact button label"),
+ description=_("Custom label of the contact button displayed by "
"front-office template"),
required=False)
--- a/src/pyams_default_theme/component/paragraph/templates/contact-default.pt Tue Nov 20 15:19:28 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 @@
</div>
<tal:if condition="view.contact_email">
<span i18n:translate="">Contact email:</span>
- <a href="mailto:${view.contact_email}">
- ${view.contact_email}
+ <a tal:define="buttom_label i18n:settings.button_label"
+ href="mailto:${view.contact_email}?subject=${view.title}">
+ ${button_label or view.contact_email}
</a><br />
</tal:if>
<tal:if condition="view.phone_number">