Added max_filesize to all image uploader views

pull/676/head
Karl Hobley 2014-10-07 15:06:12 +01:00 zatwierdzone przez Karl Hobley
rodzic b7b5e182fa
commit 948c11bbd2
3 zmienionych plików z 8 dodań i 3 usunięć

Wyświetl plik

@ -11,6 +11,7 @@ from wagtail.wagtailsearch.backends import get_search_backends
from wagtail.wagtailimages.models import get_image_model
from wagtail.wagtailimages.forms import get_image_form, ImageInsertionForm
from wagtail.wagtailimages.formats import get_image_format
from wagtail.wagtailimages.utils.validators import get_max_image_filesize
def get_image_json(image):
@ -146,7 +147,7 @@ def chooser_upload(request):
return render_modal_workflow(
request, 'wagtailimages/chooser/chooser.html', 'wagtailimages/chooser/chooser.js',
{'images': images, 'uploadform': form, 'searchform': searchform}
{'images': images, 'uploadform': form, 'searchform': searchform, 'max_filesize': get_max_image_filesize()}
)

Wyświetl plik

@ -17,6 +17,7 @@ from wagtail.wagtailsearch.backends import get_search_backends
from wagtail.wagtailimages.models import get_image_model, Filter
from wagtail.wagtailimages.forms import get_image_form, URLGeneratorForm
from wagtail.wagtailimages.utils.crypto import generate_signature
from wagtail.wagtailimages.utils.validators import get_max_image_filesize
@permission_required('wagtailimages.add_image')
@ -223,6 +224,7 @@ def add(request):
return render(request, "wagtailimages/images/add.html", {
'form': form,
'max_filesize': get_max_image_filesize(),
})

Wyświetl plik

@ -14,7 +14,7 @@ from wagtail.wagtailsearch.backends import get_search_backends
from wagtail.wagtailimages.models import get_image_model
from wagtail.wagtailimages.forms import get_image_form_for_multi
from wagtail.wagtailimages.utils.validators import validate_image_format, validate_image_filesize
from wagtail.wagtailimages.utils.validators import validate_image_format, validate_image_filesize, get_max_image_filesize
def json_response(document):
@ -61,7 +61,9 @@ def add(request):
})
return render(request, 'wagtailimages/multiple/add.html', {})
return render(request, 'wagtailimages/multiple/add.html', {
'max_filesize': get_max_image_filesize(),
})
@require_POST