예제 #1
0
def update_link(request, path_obj):
    if path_obj.abs_real_path and check_permission('commit', request) and versioncontrol.hasversioning(path_obj.abs_real_path):
        link = dispatch.update(request, path_obj)
        text = _('Update from VCS')
        return {
            'href': link,
            'text': text,
            'link': link,
        }
예제 #2
0
def commit_link(request, path_obj):
    if path_obj.abs_real_path and check_permission('commit', request) and versioncontrol.hasversioning(path_obj.abs_real_path):
        link = dispatch.commit(request, path_obj)
        text = _('Commit to VCS')
        return {
            'class': 'vcs commit',
            'href': link,
            'text': text,
            'link': link,
        }
예제 #3
0
def update_link(request, path_obj):
    if path_obj.abs_real_path and check_permission(
            'commit', request) and versioncontrol.hasversioning(
                path_obj.abs_real_path):
        link = dispatch.update(request, path_obj)
        text = _('Update from VCS')
        return {
            'href': link,
            'text': text,
            'link': link,
        }
예제 #4
0
def commit_link(request, path_obj):
    if path_obj.abs_real_path and check_permission(
            'commit', request) and versioncontrol.hasversioning(
                path_obj.abs_real_path):
        link = dispatch.commit(request, path_obj)
        text = _('Commit to VCS')
        return {
            'class': 'vcs commit',
            'href': link,
            'text': text,
            'link': link,
        }
예제 #5
0
 def must_display(cls, request, *args, **kwargs):
     return check_permission('commit', request) and \
         versioncontrol.hasversioning(
         request.translation_project.abs_real_path)
예제 #6
0
def hasversioning(path):
    path = to_vcs_path(path)
    return versioncontrol.hasversioning(path, settings.VCS_DIRECTORY)
예제 #7
0
 def must_display(cls, request, *args, **kwargs):
     return check_permission('commit', request) and \
         versioncontrol.hasversioning(request.translation_project.abs_real_path)
예제 #8
0
def hasversioning(path):
    from translate.storage import versioncontrol
    return versioncontrol.hasversioning(path, settings.PODIRECTORY)