Exemple #1
0
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
Exemple #2
0
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
Exemple #3
0
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)
Exemple #4
0
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)
Exemple #5
0
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
Exemple #6
0
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
Exemple #7
0
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
Exemple #8
0
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
Exemple #9
0
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
Exemple #10
0
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
Exemple #14
0
def bc_entity(proposal):
    return _url.BREAD_SEP + _url.link(proposal.title, url(proposal))
def bc_entity(milestone):
    return _url.BREAD_SEP + _url.link(milestone.title, url(milestone))
Exemple #16
0
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))
Exemple #18
0
def entity_bc(text):
    return _url.BREAD_SEP + _url.link(text.variant, url(text))
Exemple #19
0
def entity_bc(page):
    bc = ''
    if page.parent:
        bc += entity_bc(page.parent)
    return bc + _url.BREAD_SEP + _url.link(page.title, url(page))
Exemple #20
0
def breadcrumbs(page):
    bc = _url.root()
    bc += _url.link(_("Documents"), u'/page')
    if page is not None:
        bc += entity_bc(page)
    return bc
Exemple #21
0
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(milestone):
    bc = _url.root()
    bc += _url.link(_("Milestones"), u'/milestone')
    if milestone is not None:
        bc += bc_entity(milestone)
    return bc
Exemple #23
0
def bc_entity(category):
    return _url.BREAD_SEP + _url.link(category.title, url(category))
Exemple #24
0
def bc_entity(tag):
    return _url.BREAD_SEP + _url.link(tag.name, url(tag))
Exemple #25
0
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)
Exemple #26
0
def bc_entity(user):
    return _url.BREAD_SEP + _url.link(user.name, url(user))
Exemple #27
0
def breadcrumbs(user):
    bc = _url.root()
    bc += _url.link(_("Users"), u'/user')
    if user is not None:
        bc += bc_entity(user)
    return bc
Exemple #28
0
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 breadcrumbs(page):
    bc = _url.root()
    bc += _url.link(_("Documents"), u'/page')
    if page is not None:
        bc += entity_bc(page)
    return bc
Exemple #30
0
def bc_entity(user):
    return _url.BREAD_SEP + _url.link(user.name, url(user))
Exemple #31
0
def bc_entity(tag):
    return _url.BREAD_SEP + _url.link(tag.name, url(tag))
Exemple #32
0
def entity_bc(text):
    return _url.BREAD_SEP + _url.link(text.variant, url(text))
Exemple #33
0
def breadcrumbs(tag):
    bc = _url.root()
    bc += _url.link(_("Tags"), u'/tag')
    if tag is not None:
        bc += bc_entity(tag)
    return bc
Exemple #34
0
def breadcrumbs(tag):
    bc = _url.root()
    bc += _url.link(_("Tags"), u'/tag')
    if tag is not None:
        bc += bc_entity(tag)
    return bc
def bc_entity(milestone):
    return _url.BREAD_SEP + _url.link(milestone.title, url(milestone))
Exemple #36
0
def breadcrumbs(proposal):
    bc = _url.root()
    bc += _url.link(_("Proposals"), u'/proposal')
    if proposal is not None:
        bc += bc_entity(proposal)
    return bc
Exemple #37
0
def bc_entity(category):
    return _url.BREAD_SEP + _url.link(category.title, url(category))