Beispiel #1
0
def versions(request, title):
	# get all versions of the document
	document = get_object_or_404(Document, url_title=title, type='I')
	context = prepare_versions(request, document)
	context['active_page'] = 'versions'

	return render_to_response('information_pages_versions.html', context_instance=context)
Beispiel #2
0
def versions(request, title):
	# get all versions of the document
	document = get_object_or_error(MinutesDocument, request.user, ['minutes.change_minutesdocument'], url_title=title)
	document_versions = prepare_versions(document)

	return render(request, 'minutes_versions.html', {
		'active_page': 'versions',
		'versions': document_versions,
		'document': document,
	})
Beispiel #3
0
def versions(request, title):
	document = get_object_or_404(Document, url_title=title)
	check_permissions(document, request.user, [document.edit_permission_name])
	document_versions = prepare_versions(document)

	return render(request, 'documents_versions.html', {
		'active_page': 'versions',
		'versions': document_versions,
		'document': document,
		'permission_warning': permission_warning(request.user, document),
	})
Beispiel #4
0
def versions(request, title):
	document = Document.objects.get(url_title=title)
	content_type = ContentType.objects.get_for_model(document)
	check_permissions(document, request.user, [document.edit_permission_name])
	document_versions = prepare_versions(document)

	return render(request, 'documents_versions.html', {
		'active_page': 'versions',
		'versions': document_versions,
		'document': document,
		'permission_warning': permission_warning(request.user, content_type, document),
	})
Beispiel #5
0
def versions(request, title):
    # get all versions of the document
    document = get_object_or_error(
        InformationDocument,
        request.user, ['information_pages.change_informationdocument'],
        url_title=title)
    document_versions = prepare_versions(document)

    return render(
        request, 'information_pages_versions.html', {
            'active_page': 'versions',
            'versions': document_versions,
            'document': document,
        })
Beispiel #6
0
def versions(request, title):
	document = get_object_or_404(Document, url_title=title)
	check_permissions(document, request.user, [document.edit_permission_name])
	document_versions = prepare_versions(document)

	if not document.can_be_reverted:
		messages.warning(request, _('This Document can not be reverted!'))

	return render(request, 'documents_versions.html', {
		'active_page': 'versions',
		'versions': document_versions,
		'document': document,
		'permission_overview': document_permission_overview(request.user, document),
		'can_be_reverted': document.can_be_reverted,
	})
Beispiel #7
0
def versions(request, title):
    document = get_object_or_404(Document, url_title=title)
    check_permissions(document, request.user, [document.edit_permission_name])
    document_versions = prepare_versions(document)

    if not document.can_be_reverted:
        messages.warning(request, _('This Document can not be reverted!'))

    return render(
        request, 'documents_versions.html', {
            'active_page':
            'versions',
            'versions':
            document_versions,
            'document':
            document,
            'permission_overview':
            document_permission_overview(request.user, document),
            'can_be_reverted':
            document.can_be_reverted,
        })