Dynamic contact in header

This commit is contained in:
Oleg Lavrovsky 2017-04-11 17:32:31 +02:00
parent e2cbb98e6e
commit 368e938a47
2 changed files with 9 additions and 5 deletions

View file

@ -38,5 +38,9 @@ class Contact(models.Model):
return 'mailto:%s' % self.email
def www_domain(self):
return self.www.replace('http://', '').replace('https://', '')
def trans_title_styled(self):
v = self.trans_title
if len(v) != 3: return v
return "<strong>%s %s</strong> %s" % tuple(v)
def __str__(self):
return self.trans_title

View file

@ -6,12 +6,12 @@
<div class="nav">
<span class="contact-nav">
<a class="link" href="#contact">Kontakt</a>
<a href="tel:+41313899286">
<a href="{{ contact.phone_link }}">
<span class="glyphicon glyphicon-earphone" aria-hidden="true"></span>
<span class="hidden-xs">+41 31 389 92 86</span></a>
<a href="mailto:info@public-health.ch">
<span class="hidden-xs">{{ contact.phone }}</span></a>
<a href="{{ contact.email_link }}">
<span class="glyphicon glyphicon-envelope" aria-hidden="true"></span>
<span class="hidden-xs">info@public-health.ch</span></a>
<span class="hidden-xs">{{ contact.email }}</span></a>
</span>
<span class="language-nav">
{% language_switcher %}
@ -30,7 +30,7 @@
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{% pageurl site_root %}"><img src="/static/images/public-health-logo-sign.png" alt="[logo]">
<span class="hidden-xs"><strong>Public Health</strong> Schweiz</span></a>
<span class="hidden-xs">{{ contact.trans_title }}</span></a>
</div>
{% block menu %}