Skip to content
This repository has been archived by the owner on Nov 27, 2019. It is now read-only.

Added support for telephone hyperlinks for mobile users. #138

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmsplugin_filer_link/cms_plugins.py
Expand Up @@ -19,6 +19,8 @@ def render(self, context, instance, placeholder):
link = instance.file.url
elif instance.mailto:
link = "mailto:%s" % _(instance.mailto)
elif instance.tel:
link = "tel:%s" % _(instance.tel)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not only related to this pull request... but why are we translating these?

elif instance.url:
link = _(instance.url)
elif instance.page_link:
Expand Down
2 changes: 2 additions & 0 deletions cmsplugin_filer_link/models.py
Expand Up @@ -21,6 +21,8 @@ class FilerLinkPlugin(CMSPlugin):
help_text=_("A link to a page has priority over urls."))
mailto = models.EmailField(_("mailto"), blank=True, null=True,
help_text=_("An email address has priority over both pages and urls"))
tel = models.TextField(_("tel"), blank=True, null=True,
help_text=_("A telephone number has priority over both pages, urls, and mailto"))
link_style = models.CharField(_("link style"), max_length=255,
choices=LINK_STYLES, default=" ")
new_window = models.BooleanField(_("new window?"), default=False,
Expand Down
@@ -1 +1 @@
<a href="{{ link }}" class="{{style}}"{% if new_window %} target="_blank"{% endif %}>{{ name }}</a>
<a href="{{ link }}" class="{{style}}"{% if new_window %} target="_blank"{% endif %}>{{ name }}</a>