From 32b9575cefa9eede2be68ea8464a7c70d52e4105 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 14 Feb 2018 12:39:03 +0100 Subject: Archaeological site: search view (refs #3913) - add site to profile - allow alternate label in menus for sites - add entry in menu - basic configuration of site model --- ishtar_common/menu_base.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ishtar_common/menu_base.py') diff --git a/ishtar_common/menu_base.py b/ishtar_common/menu_base.py index 7913bd470..13eb46f99 100644 --- a/ishtar_common/menu_base.py +++ b/ishtar_common/menu_base.py @@ -23,13 +23,19 @@ from ishtar_common.models import get_current_profile class SectionItem: def __init__(self, idx, label, childs=[], profile_restriction=None, css=''): self.idx = idx - self.label = label + self._label = label self.childs = childs self.available = False self.items = {} self.profile_restriction = profile_restriction self.css = css + @property + def label(self): + if callable(self._label): + return self._label() + return self._label + def check_profile_restriction(self): if self.profile_restriction: profile = get_current_profile() -- cgit v1.2.3