Add more new icons
Add new icons for the apps: Document comments, documents, file metadata, parsing and OCR. Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
@@ -256,6 +256,10 @@ class DocumentsApp(MayanAppConfig):
|
||||
)
|
||||
|
||||
# DocumentPage
|
||||
SourceColumn(
|
||||
attribute='get_label', is_absolute_url=True, is_identifier=True,
|
||||
source=DocumentPage
|
||||
)
|
||||
SourceColumn(
|
||||
func=lambda context: document_page_thumbnail_widget.render(
|
||||
instance=context['object']
|
||||
@@ -571,10 +575,10 @@ class DocumentsApp(MayanAppConfig):
|
||||
link_document_page_navigation_first,
|
||||
link_document_page_navigation_previous,
|
||||
link_document_page_navigation_next,
|
||||
link_document_page_navigation_last, link_transformation_list
|
||||
link_document_page_navigation_last,
|
||||
), sources=(DocumentPage,)
|
||||
)
|
||||
menu_object.bind_links(
|
||||
menu_list_facet.bind_links(
|
||||
links=(link_transformation_list,), sources=(DocumentPage,)
|
||||
)
|
||||
|
||||
|
||||
@@ -34,6 +34,10 @@ icon_document_favorites_add = Icon(
|
||||
driver_name='fontawesome-dual', primary_symbol='star',
|
||||
secondary_symbol='plus'
|
||||
)
|
||||
icon_document_favorites_remove = Icon(
|
||||
driver_name='fontawesome-dual', primary_symbol='star',
|
||||
secondary_symbol='minus'
|
||||
)
|
||||
icon_document_image_loading = Icon(
|
||||
driver_name='fontawesomecss', css_classes='far fa-clock fa-2x'
|
||||
)
|
||||
|
||||
@@ -12,7 +12,8 @@ from .icons import (
|
||||
icon_document_list_deleted, icon_document_list_favorites,
|
||||
icon_document_list_recent_access, icon_document_list_recent_added,
|
||||
icon_document_delete, icon_document_download, icon_document_edit,
|
||||
icon_document_favorites_add, icon_document_multiple_delete,
|
||||
icon_document_favorites_add, icon_document_favorites_remove,
|
||||
icon_document_multiple_delete,
|
||||
icon_document_multiepl_restore, icon_document_page_navigation_first,
|
||||
icon_document_page_navigation_last,
|
||||
icon_document_page_navigation_next, icon_document_page_navigation_previous,
|
||||
@@ -116,7 +117,7 @@ link_document_favorites_add = Link(
|
||||
view='documents:document_add_to_favorites',
|
||||
)
|
||||
link_document_favorites_remove = Link(
|
||||
args='resolved_object.id',
|
||||
args='resolved_object.id', icon_class=icon_document_favorites_remove,
|
||||
permissions=(permission_document_view,), text=_('Remove from favorites'),
|
||||
view='documents:document_remove_from_favorites',
|
||||
)
|
||||
|
||||
@@ -52,13 +52,7 @@ class DocumentPage(models.Model):
|
||||
verbose_name_plural = _('Document pages')
|
||||
|
||||
def __str__(self):
|
||||
return _(
|
||||
'Page %(page_num)d out of %(total_pages)d of %(document)s'
|
||||
) % {
|
||||
'document': force_text(self.document),
|
||||
'page_num': self.page_number,
|
||||
'total_pages': self.document_version.pages.count()
|
||||
}
|
||||
return self.get_label()
|
||||
|
||||
@cached_property
|
||||
def cache_partition(self):
|
||||
@@ -222,6 +216,16 @@ class DocumentPage(models.Model):
|
||||
|
||||
return converter.get_page()
|
||||
|
||||
def get_label(self):
|
||||
return _(
|
||||
'Page %(page_num)d out of %(total_pages)d of %(document)s'
|
||||
) % {
|
||||
'document': force_text(self.document),
|
||||
'page_num': self.page_number,
|
||||
'total_pages': self.document_version.pages.count()
|
||||
}
|
||||
get_label.short_description = _('Label')
|
||||
|
||||
def invalidate_cache(self):
|
||||
self.cache_partition.purge()
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@ class DocumentPageListView(SingleObjectListView):
|
||||
def get_extra_context(self):
|
||||
return {
|
||||
'column_class': 'col-xs-12 col-sm-6 col-md-4 col-lg-3',
|
||||
'hide_object': True,
|
||||
'list_as_items': True,
|
||||
'object': self.get_document(),
|
||||
'table_cell_container_classes': 'td-container-thumbnail',
|
||||
|
||||
Reference in New Issue
Block a user