From 368e938a472d50e055faabd3ccdc6850bff449c3 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Tue, 11 Apr 2017 17:32:31 +0200 Subject: [PATCH] Dynamic contact in header --- publichealth/home/models/snippets.py | 4 ++++ publichealth/templates/header.html | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/publichealth/home/models/snippets.py b/publichealth/home/models/snippets.py index f5afa30..8898e46 100644 --- a/publichealth/home/models/snippets.py +++ b/publichealth/home/models/snippets.py @@ -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 "%s %s %s" % tuple(v) def __str__(self): return self.trans_title diff --git a/publichealth/templates/header.html b/publichealth/templates/header.html index 4125c9d..306a435 100644 --- a/publichealth/templates/header.html +++ b/publichealth/templates/header.html @@ -6,12 +6,12 @@ {% block menu %}