Exemple #1
0
def make_navbar_path_dict(request, path_links=None):
    def make_admin(request):
        if check_permission('admin', request):
            return {
                'href':
                dispatch.translation_project_admin(
                    request.translation_project),
                'text':
                _('Admin')
            }
        else:
            return None

    language = request.translation_project.language
    project = request.translation_project.project
    return {
        'admin': make_admin(request),
        'language': {
            'href': dispatch.open_language(request, language.code),
            'text': tr_lang(language.fullname)
        },
        'project': {
            'href':
            dispatch.open_translation_project(request, language.code,
                                              project.code),
            'text':
            project.fullname
        },
        'pathlinks': path_links
    }
Exemple #2
0
def make_navbar_path_dict(request, path_links=None):
    language = request.translation_project.language
    project = request.translation_project.project
    return {
        'language':  {'href': dispatch.open_language(language.code),
                      'text': tr_lang(language.fullname)},
        'project':   {'href': dispatch.open_translation_project(language.code, project.code),
                      'text': project.fullname},
        'pathlinks': path_links}
Exemple #3
0
def make_navbar_path_dict(request, path_links=None):
    language = request.translation_project.language
    project = request.translation_project.project
    return {
        'language': {
            'href': dispatch.open_language(language.code),
            'text': tr_lang(language.fullname)
        },
        'project': {
            'href': dispatch.open_translation_project(language.code,
                                                      project.code),
            'text': project.fullname
        },
        'pathlinks': path_links
    }
def make_navbar_path_dict(request, path_links=None):
    def make_admin(request):
        if check_permission('admin', request):
            return {'href': dispatch.translation_project_admin(request.translation_project),
                    'text': _('Admin')}
        else:
            return None

    language     = request.translation_project.language
    project      = request.translation_project.project
    return {
        'admin':     make_admin(request),
        'language':  {'href': dispatch.open_language(request, language.code),
                      'text': tr_lang(language.fullname)},
        'project':   {'href': dispatch.open_translation_project(request, language.code, project.code),
                      'text': project.fullname},
        'pathlinks': path_links }