Exemplo n.º 1
0
 def dropdown_items(self):
     submenu_context = [
         dropdown_dict(_("Examples"), is_header=True),
         dropdown_dict(_("Simple Crispy Form"), url=reverse(DefaultSimpleCrispyFormSectionView.urlname)),
         dropdown_dict(_("Form Controls"), url=reverse(DefaultControlsDemoFormsView.urlname)),
         dropdown_dict(None, is_divider=True),
         dropdown_dict(_("Style Guide"), url=reverse(MainStyleGuideView.urlname)),
     ]
     return submenu_context
Exemplo n.º 2
0
 def dropdown_items(self):
     submenu_context = [
         dropdown_dict(_("Examples"), is_header=True),
         dropdown_dict(_("Simple Crispy Form"),
                       url=reverse(
                           DefaultSimpleCrispyFormSectionView.urlname)),
         dropdown_dict(None, is_divider=True),
         dropdown_dict(_("Style Guide"),
                       url=reverse(MainStyleGuideView.urlname)),
     ]
     return submenu_context
Exemplo n.º 3
0
    def filtered_dropdown_items(self):
        items = self.dropdown_items
        tab_name = self.__class__.__name__
        items.extend([
            dropdown_dict(**item)
            for item in extension_points.uitab_dropdown_items(
                tab_name, self, domain=self.domain, request=self._request)
        ])

        if self.can_access_all_locations:
            return items

        filtered = []
        for item in items:
            if url_is_location_safe(item['url']):
                filtered.append(item)
        return filtered
Exemplo n.º 4
0
 def divider(self):
     return dropdown_dict(None, is_divider=True)