New document version improvements from clients/bc

- Comment field help text.
- Remove create_document_form_form.
- Use static NewVersionForm.
- Update sources document upload and new version upload view names.

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-10-10 14:34:50 -04:00
parent cc8147d002
commit bd0d298be3
11 changed files with 40 additions and 43 deletions

View File

@@ -84,10 +84,10 @@ class UploadBaseView(MultiFormView):
@staticmethod
def get_tab_link_for_source(source, document=None):
if document:
view = 'sources:upload_version'
view = 'sources:document_version_upload'
args = ('"{}"'.format(document.pk), '"{}"'.format(source.pk),)
else:
view = 'sources:upload_interactive'
view = 'sources:document_upload_interactive'
args = ('"{}"'.format(source.pk),)
return Link(
@@ -180,8 +180,8 @@ class UploadBaseView(MultiFormView):
},
})
menu_facet.bound_links['sources:upload_interactive'] = self.tab_links
menu_facet.bound_links['sources:upload_version'] = self.tab_links
menu_facet.bound_links['sources:document_upload_interactive'] = self.tab_links
menu_facet.bound_links['sources:document_version_upload'] = self.tab_links
context.update(
{
@@ -360,7 +360,7 @@ class UploadInteractiveView(UploadBaseView):
return context
class UploadInteractiveVersionView(UploadBaseView):
class DocumentVersionUploadInteractiveView(UploadBaseView):
def dispatch(self, request, *args, **kwargs):
self.subtemplates_list = []
@@ -392,7 +392,7 @@ class UploadInteractiveVersionView(UploadBaseView):
self.tab_links = UploadBaseView.get_active_tab_links(self.document)
return super(
UploadInteractiveVersionView, self
DocumentVersionUploadInteractiveView, self
).dispatch(request, *args, **kwargs)
def forms_valid(self, forms):
@@ -448,13 +448,6 @@ class UploadInteractiveVersionView(UploadBaseView):
files=kwargs.get('files', None),
)
def create_document_form_form(self, **kwargs):
return self.get_form_classes()['document_form'](
prefix=kwargs['prefix'],
data=kwargs.get('data', None),
files=kwargs.get('files', None),
)
def get_form_classes(self):
return {
'document_form': NewVersionForm,
@@ -463,12 +456,14 @@ class UploadInteractiveVersionView(UploadBaseView):
def get_context_data(self, **kwargs):
context = super(
UploadInteractiveVersionView, self
DocumentVersionUploadInteractiveView, self
).get_context_data(**kwargs)
context['object'] = self.document
context['title'] = _(
'Upload a new version from source: %s'
) % self.source.label
'Upload a new version for document "%(document)s" '
'from source: %(source)s'
) % {'document': self.document, 'source': self.source.label}
context['submit_label'] = _('Submit')
return context