Exemplo n.º 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)
Exemplo n.º 2
0
def endpoint_accessible(target, values):
    return current_appshell.endpoint_accessible(target, values)
Exemplo n.º 3
0
 def is_visible(self):
     if self.target:
         return current_appshell.endpoint_accessible(
             self.target, self.values)
Exemplo n.º 4
0
def endpoint_accessible(target, values):
    return current_appshell.endpoint_accessible(target, values)
Exemplo n.º 5
0
 def is_visible(self):
     if self.target:
         return current_appshell.endpoint_accessible(self.target,
                                                     self.values)