From dd52f23d543213e03b36b1fda3fad133eebdbbd7 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Mon, 3 Jul 2017 17:47:56 +0200 Subject: [PATCH] trans_title optional --- publichealth/home/templatetags/navigation.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/publichealth/home/templatetags/navigation.py b/publichealth/home/templatetags/navigation.py index 7ea6d0f..a3c9c22 100644 --- a/publichealth/home/templatetags/navigation.py +++ b/publichealth/home/templatetags/navigation.py @@ -39,7 +39,8 @@ def top_menu(context, parent, calling_page=None): menuitem.show_dropdown = has_menu_children(menuitem) menuitem.active = (calling_page.url.startswith(menuitem.url) if calling_page else False) - menuitem.title = menuitem.trans_title + if 'trans_title' in menuitem: + menuitem.title = menuitem.trans_title return { 'calling_page': calling_page, 'menuitems': menuitems, @@ -49,7 +50,8 @@ def top_menu(context, parent, calling_page=None): def menuitems_children(parent): menuitems_children = parent.get_children().live().in_menu().specific() for menuitem in menuitems_children: - menuitem.title = menuitem.trans_title + if 'trans_title' in menuitem: + menuitem.title = menuitem.trans_title return menuitems_children # Retrieves the children of the top menu items for the drop downs