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, }
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, }
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, }
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, }
def must_display(cls, request, *args, **kwargs): return check_permission('commit', request) and \ versioncontrol.hasversioning( request.translation_project.abs_real_path)
def hasversioning(path): path = to_vcs_path(path) return versioncontrol.hasversioning(path, settings.VCS_DIRECTORY)
def must_display(cls, request, *args, **kwargs): return check_permission('commit', request) and \ versioncontrol.hasversioning(request.translation_project.abs_real_path)
def hasversioning(path): from translate.storage import versioncontrol return versioncontrol.hasversioning(path, settings.PODIRECTORY)