Add support for preserving the file extenstion when downloading a document

version. GitLab issue #415.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2017-08-11 01:46:26 -04:00
parent b8548a0982
commit bc07bb154d
5 changed files with 78 additions and 25 deletions

View File

@@ -233,6 +233,17 @@ class DocumentDownloadForm(forms.Form):
self.fields['compressed'].widget.attrs.update({'disabled': True})
class DocumentVersionDownloadForm(DocumentDownloadForm):
preserve_extension = forms.BooleanField(
label=_('Preserve extension'), required=False,
help_text=_(
'Takes the file extension and moves it to the end of the '
'filename allowing operating systems that rely on file '
'extensions to open the downloaded document version correctly.'
)
)
class DocumentPrintForm(forms.Form):
page_group = forms.ChoiceField(
choices=PAGE_RANGE_CHOICES, initial=PAGE_RANGE_ALL,