Add view to clone a document page transformations to other pages.

This commit is contained in:
Roberto Rosario
2017-01-16 01:05:34 -04:00
parent 3e898fd71b
commit 9f837aaade
7 changed files with 132 additions and 38 deletions

View File

@@ -223,3 +223,17 @@ class DocumentPrintForm(forms.Form):
widget=forms.RadioSelect
)
page_range = forms.CharField(label=_('Page range'), required=False)
class DocumentPageNumberForm(forms.Form):
page = forms.ModelChoiceField(
queryset=None,
help_text=_('Page number from which all the transformation will be '
'cloned. Existing transformations will be lost.'
)
)
def __init__(self, *args, **kwargs):
self.document = kwargs.pop('document')
super(DocumentPageNumberForm, self).__init__(*args, **kwargs)
self.fields['page'].queryset = self.document.pages.all()