diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-02-14 12:39:03 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-02-15 17:20:19 +0100 |
commit | 32b9575cefa9eede2be68ea8464a7c70d52e4105 (patch) | |
tree | df7cf20de56e13c9660d14219d7ee5d825bb2909 /ishtar_common/menu_base.py | |
parent | 5bbafc5b1a398afa4cd37acf20293eddb8c12f9b (diff) | |
download | Ishtar-32b9575cefa9eede2be68ea8464a7c70d52e4105.tar.bz2 Ishtar-32b9575cefa9eede2be68ea8464a7c70d52e4105.zip |
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
Diffstat (limited to 'ishtar_common/menu_base.py')
-rw-r--r-- | ishtar_common/menu_base.py | 8 |
1 files changed, 7 insertions, 1 deletions
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() |