def settings_breadcrumbs(instance, member=None): """member is a dict with the keys 'name' and 'label'.""" bc = breadcrumbs(instance) bc += _url.link(_("Settings"), url(instance, member="settings")) if member is not None: bc += _url.BREAD_SEP + _url.link( member['label'], url(instance, member="settings/" + member['name'])) return bc
def breadcrumbs(user, dashboard=False): from adhocracy.lib.helpers import base_url items = [] if c.instance is not None: items.append(_url.link(_("Members"), base_url(u'/user'))) elif has('user.index_all'): items.append(_url.link(_("Members"), base_url(u'/user/all'))) if user is not None: items.append(_url.link(user.name, url(user))) if dashboard: items.append(_url.link(_('Dashboard'), base_url('/user/dashboard'))) return _url.root() + _url.BREAD_SEP.join(items)
def breadcrumbs(proposal): from adhocracy.lib.helpers import base_url bc = _url.root() if c.instance.show_proposals_navigation: bc += _url.link(_("Proposals"), base_url(u'/proposal')) elif c.instance.display_category_pages: bc += _url.link(_("Categories"), base_url(u'/category')) if proposal is not None and proposal.category is not None: bc += bc_category(proposal.category) else: # FIXME this case will produce a double BREAD_SEP pass if proposal is not None: bc += bc_entity(proposal) return bc
def breadcrumbs(category): from adhocracy.lib.helpers import base_url bc = _url.root() bc += _url.link(_("Categories"), base_url(u'/category')) if category is not None: bc += bc_entity(category) return bc
def breadcrumbs(page): from adhocracy.lib.helpers import base_url bc = _url.root() bc += _url.link(_("Norms"), base_url(u'/page')) if page is not None: bc += entity_bc(page) return bc
def bc_entity(selection): bc = _url.link(_("Implementation"), proposal.url(selection.proposal, member=u'/implementation')) bc += _url.BREAD_SEP + _url.link(selection.page.title, url(selection)) return bc
def breadcrumbs(proposal): bc = _url.root() bc += _url.link(_("Proposals"), u'/proposal') if proposal is not None: bc += bc_entity(proposal) return bc
def bc_entity(proposal): return _url.BREAD_SEP + _url.link(proposal.title, url(proposal))
def breadcrumbs(milestone): bc = _url.root() bc += _url.link(_("Milestones"), u'/milestone') if milestone is not None: bc += bc_entity(milestone) return bc
def bc_entity(milestone): return _url.BREAD_SEP + _url.link(milestone.title, url(milestone))
def breadcrumbs(user): bc = _url.root() bc += _url.link(_("Users"), u'/user') if user is not None: bc += bc_entity(user) return bc
def breadcrumbs(staticpage): return _url.root() + _url.link(staticpage.title, url(staticpage))
def entity_bc(text): return _url.BREAD_SEP + _url.link(text.variant, url(text))
def entity_bc(page): bc = '' if page.parent: bc += entity_bc(page.parent) return bc + _url.BREAD_SEP + _url.link(page.title, url(page))
def breadcrumbs(page): bc = _url.root() bc += _url.link(_("Documents"), u'/page') if page is not None: bc += entity_bc(page) return bc
def bc_entity(category): return _url.BREAD_SEP + _url.link(category.title, url(category))
def bc_entity(tag): return _url.BREAD_SEP + _url.link(tag.name, url(tag))
def breadcrumbs(badge=None): from adhocracy.lib.helpers import base_url items = [] items.append(_url.link(_("Badges"), base_url(u'/badge'))) return _url.root() + _url.BREAD_SEP.join(items)
def bc_entity(user): return _url.BREAD_SEP + _url.link(user.name, url(user))
def breadcrumbs(tag): bc = _url.root() bc += _url.link(_("Tags"), u'/tag') if tag is not None: bc += bc_entity(tag) return bc