from pylons.i18n import _

from adhocracy.lib.helpers import url as _url


def breadcrumbs(items=[], include_instance=True):
    from adhocracy.lib.helpers import base_url
    from adhocracy.lib.helpers.instance_helper import url
    _items = []
    _items.append({'label': _("Start"), 'url': base_url(instance=None)})
    if include_instance and c.instance:
        _items.append({'label': c.instance.label, 'url': url(c.instance)})
    _items += items
    return _url.BREAD_SEP.join(_url.link(item['label'], item['url']) for item in _items)
