summaryrefslogtreecommitdiff
path: root/ishtar_common/menu_base.py
diff options
context:
space:
mode:
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
commit038c7ce8bbb1d40a99c98811f1c267a6218b22c2 (patch)
treedf7cf20de56e13c9660d14219d7ee5d825bb2909 /ishtar_common/menu_base.py
parent365546bcd78bed54c6ab2d7f375b86cde8caa66f (diff)
downloadIshtar-038c7ce8bbb1d40a99c98811f1c267a6218b22c2.tar.bz2
Ishtar-038c7ce8bbb1d40a99c98811f1c267a6218b22c2.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.py8
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()