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