Beispiel #1
0
    def __html__(self):
        params = request.view_args
        if not current_appshell.endpoint_accessible(self.target, params):
            return ''
        attrs = {"role": "presentation"}

        if request.endpoint == self.target:
            attrs["class"] = "active"

        url = url_for(self.target, **params)
        link = element('a', {'href': url}, self.text)
        return element('li', attrs, link)
Beispiel #2
0
def endpoint_accessible(target, values):
    return current_appshell.endpoint_accessible(target, values)
Beispiel #3
0
 def is_visible(self):
     if self.target:
         return current_appshell.endpoint_accessible(
             self.target, self.values)
Beispiel #4
0
def endpoint_accessible(target, values):
    return current_appshell.endpoint_accessible(target, values)
Beispiel #5
0
 def is_visible(self):
     if self.target:
         return current_appshell.endpoint_accessible(self.target,
                                                     self.values)