Show the number of pages of a document and of document versions in
the document list view and document versions list views respectively. Display a document version's thumbnail before other attributes. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -93,7 +93,8 @@ from .statistics import (
|
||||
)
|
||||
from .widgets import (
|
||||
DocumentThumbnailWidget, DocumentPageThumbnailWidget,
|
||||
DocumentVersionThumbnailWidget
|
||||
DocumentVersionThumbnailWidget, widget_document_page_number,
|
||||
widget_document_version_page_number
|
||||
)
|
||||
|
||||
|
||||
@@ -195,6 +196,12 @@ class DocumentsApp(MayanAppConfig):
|
||||
SourceColumn(
|
||||
source=Document, label=_('Type'), attribute='document_type'
|
||||
)
|
||||
SourceColumn(
|
||||
source=Document, label=_('Pages'),
|
||||
func=lambda context: widget_document_page_number(
|
||||
document=context['object']
|
||||
)
|
||||
)
|
||||
|
||||
# DocumentPage
|
||||
SourceColumn(
|
||||
@@ -246,10 +253,22 @@ class DocumentsApp(MayanAppConfig):
|
||||
)
|
||||
|
||||
# DocumentVersion
|
||||
SourceColumn(
|
||||
source=DocumentVersion, label=_('Thumbnail'),
|
||||
func=lambda context: document_version_thumbnail_widget.render(
|
||||
instance=context['object']
|
||||
)
|
||||
)
|
||||
SourceColumn(
|
||||
source=DocumentVersion, label=_('Time and date'),
|
||||
attribute='timestamp'
|
||||
)
|
||||
SourceColumn(
|
||||
source=DocumentVersion, label=_('Pages'),
|
||||
func=lambda context: widget_document_version_page_number(
|
||||
document_version=context['object']
|
||||
)
|
||||
)
|
||||
SourceColumn(
|
||||
source=DocumentVersion, label=_('MIME type'),
|
||||
attribute='mimetype'
|
||||
@@ -262,12 +281,6 @@ class DocumentsApp(MayanAppConfig):
|
||||
source=DocumentVersion, label=_('Comment'),
|
||||
attribute='comment'
|
||||
)
|
||||
SourceColumn(
|
||||
source=DocumentVersion, label=_('Thumbnail'),
|
||||
func=lambda context: document_version_thumbnail_widget.render(
|
||||
instance=context['object']
|
||||
)
|
||||
)
|
||||
|
||||
# DuplicatedDocument
|
||||
SourceColumn(
|
||||
|
||||
Reference in New Issue
Block a user