Add document action icons
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -3,4 +3,9 @@ from __future__ import absolute_import, unicode_literals
|
||||
from mayan.apps.appearance.classes import Icon
|
||||
|
||||
icon_transformation = Icon(driver_name='fontawesome', symbol='crop')
|
||||
icon_transformation_create = Icon(driver_name='fontawesome', symbol='plus')
|
||||
icon_transformation_create = Icon(
|
||||
driver_name='fontawesome-dual', primary_symbol='crop',
|
||||
secondary_symbol='plus'
|
||||
)
|
||||
icon_transformation_delete = Icon(driver_name='fontawesome', symbol='times')
|
||||
icon_transformation_edit = Icon(driver_name='fontawesome', symbol='pencil-alt')
|
||||
|
||||
@@ -1,13 +1,25 @@
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from mayan.apps.appearance.classes import Icon
|
||||
from mayan.apps.converter.icons import icon_transformation
|
||||
|
||||
icon_document_type = Icon(
|
||||
driver_name='fontawesome-layers', data=[
|
||||
{'class': 'fas fa-circle', 'transform': 'shrink-12 up-2'},
|
||||
{'class': 'fas fa-cog', 'transform': 'shrink-6 up-2', 'mask': 'fas fa-torah'}
|
||||
]
|
||||
)
|
||||
|
||||
icon_clear_image_cache = Icon(driver_name='fontawesome', symbol='file-image')
|
||||
|
||||
icon_dashboard_document_types = Icon(
|
||||
driver_name='fontawesome', symbol='book'
|
||||
)
|
||||
icon_dashboard_document_types = Icon(
|
||||
driver_name='fontawesome', symbol='book'
|
||||
)
|
||||
icon_dashboard_documents_in_trash = Icon(
|
||||
driver_name='fontawesome', symbol='trash'
|
||||
driver_name='fontawesome', symbol='trash-alt'
|
||||
)
|
||||
icon_dashboard_pages_per_month = Icon(
|
||||
driver_name='fontawesome', symbol='copy'
|
||||
@@ -18,6 +30,81 @@ icon_dashboard_new_documents_this_month = Icon(
|
||||
icon_dashboard_total_document = Icon(
|
||||
driver_name='fontawesome', symbol='file'
|
||||
)
|
||||
|
||||
|
||||
icon_document_quick_download = Icon(
|
||||
driver_name='fontawesome', symbol='download'
|
||||
)
|
||||
icon_document_download = Icon(
|
||||
driver_name='fontawesome', symbol='download'
|
||||
)
|
||||
icon_document_duplicates_list = Icon(
|
||||
driver_name='fontawesome', symbol='clone'
|
||||
)
|
||||
icon_document_edit = Icon(
|
||||
driver_name='fontawesome', symbol='pencil-alt'
|
||||
)
|
||||
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_page_count_update = Icon(
|
||||
driver_name='fontawesome', symbol='copy'
|
||||
)
|
||||
icon_document_print = Icon(
|
||||
driver_name='fontawesome', symbol='print'
|
||||
)
|
||||
icon_document_trash_send = Icon(
|
||||
driver_name='fontawesome', symbol='trash-alt'
|
||||
)
|
||||
icon_document_transformations_clear = icon_transformation
|
||||
icon_document_transformations_clone = icon_transformation
|
||||
|
||||
icon_document_type_change = icon_document_type
|
||||
|
||||
icon_document_type_create = Icon(driver_name='fontawesome', symbol='plus')
|
||||
icon_document_type_delete = Icon(driver_name='fontawesome', symbol='times')
|
||||
icon_document_type_edit = Icon(driver_name='fontawesome', symbol='pencil-alt')
|
||||
icon_document_type_setup = icon_document_type
|
||||
icon_document_type_filename = Icon(
|
||||
driver_name='fontawesome', symbol='keyboard'
|
||||
)
|
||||
icon_document_type_filename_create = Icon(
|
||||
driver_name='fontawesome', symbol='plus'
|
||||
)
|
||||
icon_document_type_list = icon_document_type
|
||||
|
||||
|
||||
icon_trash_can_empty = Icon(
|
||||
driver_name='fontawesome', symbol='trash-alt'
|
||||
)
|
||||
icon_trashed_document_delete = Icon(
|
||||
driver_name='fontawesome', symbol='times'
|
||||
)
|
||||
icon_trashed_document_list = Icon(
|
||||
driver_name='fontawesome', symbol='trash-alt'
|
||||
)
|
||||
icon_trashed_document_multiple_delete = Icon(
|
||||
driver_name='fontawesome', symbol='trash-alt'
|
||||
)
|
||||
icon_trashed_document_multiple_restore = Icon(
|
||||
driver_name='fontawesome', symbol='recycle'
|
||||
)
|
||||
icon_trashed_document_restore = Icon(
|
||||
driver_name='fontawesome', symbol='recycle'
|
||||
)
|
||||
|
||||
icon_document_version_download = Icon(
|
||||
driver_name='fontawesome', symbol='download'
|
||||
)
|
||||
icon_document_version_view = Icon(
|
||||
driver_name='fontawesome', symbol='eye'
|
||||
)
|
||||
|
||||
icon_document_duplicates_list = Icon(
|
||||
driver_name='fontawesome', symbol='clone'
|
||||
)
|
||||
|
||||
@@ -8,19 +8,47 @@ from mayan.apps.converter.permissions import (
|
||||
from mayan.apps.navigation import Link
|
||||
|
||||
from .icons import (
|
||||
icon_clear_image_cache, icon_document_duplicates_list, icon_document_list,
|
||||
icon_document_list_deleted, icon_document_list_favorites,
|
||||
icon_document_list_recent_access, icon_document_list_recent_added,
|
||||
icon_document_page_navigation_first, icon_document_page_navigation_last,
|
||||
icon_document_page_navigation_next, icon_document_page_navigation_previous,
|
||||
icon_document_page_return, icon_document_page_rotate_left,
|
||||
icon_document_page_rotate_right, icon_document_page_zoom_in,
|
||||
icon_document_page_zoom_out, icon_document_pages, icon_document_preview,
|
||||
icon_document_properties, icon_document_type_create,
|
||||
icon_document_type_delete, icon_document_type_edit,
|
||||
icon_document_type_filename_create, icon_document_type_setup,
|
||||
icon_document_version_list, icon_document_version_return_document,
|
||||
icon_document_version_return_list, icon_duplicated_document_list,
|
||||
icon_clear_image_cache,
|
||||
icon_document_download,
|
||||
|
||||
icon_document_edit,
|
||||
icon_document_favorites_add,
|
||||
icon_document_favorites_remove,
|
||||
|
||||
icon_document_quick_download,
|
||||
|
||||
icon_document_duplicates_list,
|
||||
icon_document_list,
|
||||
icon_document_list_deleted,
|
||||
icon_document_list_favorites,
|
||||
icon_document_list_recent_access,
|
||||
icon_document_list_recent_added,
|
||||
icon_document_page_navigation_first,
|
||||
icon_document_page_navigation_last,
|
||||
icon_document_page_navigation_next,
|
||||
icon_document_page_navigation_previous,
|
||||
icon_document_page_return,
|
||||
icon_document_page_rotate_left,
|
||||
icon_document_page_rotate_right,
|
||||
icon_document_page_zoom_in,
|
||||
icon_document_page_zoom_out,
|
||||
icon_document_pages,
|
||||
|
||||
icon_document_preview,
|
||||
icon_document_properties,
|
||||
|
||||
icon_document_type_create,
|
||||
icon_document_type_delete,
|
||||
icon_document_type_edit,
|
||||
icon_document_type_filename_create,
|
||||
icon_document_type_setup,
|
||||
|
||||
icon_document_version_download,
|
||||
icon_document_version_list,
|
||||
icon_document_version_return_document,
|
||||
icon_document_version_return_list,
|
||||
|
||||
icon_duplicated_document_list,
|
||||
icon_duplicated_document_scan
|
||||
)
|
||||
from .permissions import (
|
||||
@@ -65,22 +93,26 @@ def is_min_zoom(context):
|
||||
|
||||
# Facet
|
||||
link_document_preview = Link(
|
||||
args='resolved_object.id', icon_class=icon_document_preview,
|
||||
args='resolved_object.id',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_preview',
|
||||
permissions=(permission_document_view,),
|
||||
text=_('Preview'), view='documents:document_preview',
|
||||
)
|
||||
link_document_properties = Link(
|
||||
args='resolved_object.id', icon_class=icon_document_properties,
|
||||
args='resolved_object.id',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_properties',
|
||||
permissions=(permission_document_view,),
|
||||
text=_('Properties'), view='documents:document_properties',
|
||||
)
|
||||
link_document_version_list = Link(
|
||||
args='resolved_object.pk', icon_class=icon_document_version_list,
|
||||
args='resolved_object.pk',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_version_list',
|
||||
permissions=(permission_document_version_view,),
|
||||
text=_('Versions'), view='documents:document_version_list',
|
||||
)
|
||||
link_document_pages = Link(
|
||||
args='resolved_object.pk', icon_class=icon_document_pages,
|
||||
args='resolved_object.pk',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_pages',
|
||||
permissions=(permission_document_view,), text=_('Pages'),
|
||||
view='documents:document_pages',
|
||||
)
|
||||
@@ -88,126 +120,161 @@ link_document_pages = Link(
|
||||
# Actions
|
||||
link_document_clear_transformations = Link(
|
||||
args='resolved_object.id',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_transformations_clear',
|
||||
permissions=(permission_transformation_delete,),
|
||||
text=_('Clear transformations'),
|
||||
view='documents:document_clear_transformations',
|
||||
)
|
||||
link_document_clone_transformations = Link(
|
||||
args='resolved_object.id', permissions=(permission_transformation_edit,),
|
||||
args='resolved_object.id',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_transformations_clone',
|
||||
permissions=(permission_transformation_edit,),
|
||||
text=_('Clone transformations'),
|
||||
view='documents:document_clone_transformations',
|
||||
)
|
||||
link_document_delete = Link(
|
||||
args='resolved_object.id', permissions=(permission_document_delete,),
|
||||
args='resolved_object.id',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_trashed_document_delete',
|
||||
permissions=(permission_document_delete,),
|
||||
tags='dangerous', text=_('Delete'), view='documents:document_delete',
|
||||
)
|
||||
link_document_favorites_add = Link(
|
||||
args='resolved_object.id',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_favorites_add',
|
||||
permissions=(permission_document_view,), text=_('Add to favorites'),
|
||||
view='documents:document_add_to_favorites',
|
||||
)
|
||||
link_document_favorites_remove = Link(
|
||||
args='resolved_object.id',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_favorites_remove',
|
||||
permissions=(permission_document_view,), text=_('Remove from favorites'),
|
||||
view='documents:document_remove_from_favorites',
|
||||
)
|
||||
link_document_trash = Link(
|
||||
args='resolved_object.id', permissions=(permission_document_trash,),
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_trash_send',
|
||||
tags='dangerous', text=_('Move to trash'),
|
||||
view='documents:document_trash',
|
||||
)
|
||||
link_document_edit = Link(
|
||||
args='resolved_object.id',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_edit',
|
||||
permissions=(permission_document_properties_edit,),
|
||||
text=_('Edit properties'), view='documents:document_edit',
|
||||
)
|
||||
link_document_document_type_edit = Link(
|
||||
args='resolved_object.id',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_type_change',
|
||||
permissions=(permission_document_properties_edit,), text=_('Change type'),
|
||||
view='documents:document_document_type_edit',
|
||||
)
|
||||
link_document_download = Link(
|
||||
args='resolved_object.id', permissions=(permission_document_download,),
|
||||
text=_('Advanced download'), view='documents:document_download_form',
|
||||
args='resolved_object.id',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_download',
|
||||
permissions=(permission_document_download,), text=_('Advanced download'),
|
||||
view='documents:document_download_form',
|
||||
)
|
||||
link_document_print = Link(
|
||||
args='resolved_object.id', permissions=(permission_document_print,),
|
||||
args='resolved_object.id',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_print',
|
||||
permissions=(permission_document_print,),
|
||||
text=_('Print'), view='documents:document_print',
|
||||
)
|
||||
link_document_quick_download = Link(
|
||||
args='resolved_object.id', permissions=(permission_document_download,),
|
||||
text=_('Quick download'), view='documents:document_download',
|
||||
args='resolved_object.id',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_quick_download',
|
||||
permissions=(permission_document_download,), text=_('Quick download'),
|
||||
view='documents:document_download',
|
||||
)
|
||||
link_document_update_page_count = Link(
|
||||
args='resolved_object.pk', permissions=(permission_document_tools,),
|
||||
args='resolved_object.pk',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_page_count_update',
|
||||
permissions=(permission_document_tools,),
|
||||
text=_('Recalculate page count'),
|
||||
view='documents:document_update_page_count'
|
||||
)
|
||||
link_document_restore = Link(
|
||||
permissions=(permission_document_restore,), text=_('Restore'),
|
||||
permissions=(permission_document_restore,),
|
||||
icon_class_path='mayan.apps.documents.icons.icon_trashed_document_restore',
|
||||
text=_('Restore'),
|
||||
view='documents:document_restore', args='object.pk'
|
||||
)
|
||||
link_document_multiple_clear_transformations = Link(
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_transformations_clear',
|
||||
permissions=(permission_transformation_delete,),
|
||||
text=_('Clear transformations'),
|
||||
view='documents:document_multiple_clear_transformations'
|
||||
)
|
||||
link_document_multiple_trash = Link(
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_trash_send',
|
||||
tags='dangerous', text=_('Move to trash'),
|
||||
view='documents:document_multiple_trash'
|
||||
)
|
||||
link_document_multiple_delete = Link(
|
||||
icon_class_path='mayan.apps.documents.icons.icon_trashed_document_delete',
|
||||
tags='dangerous', text=_('Delete'),
|
||||
view='documents:document_multiple_delete'
|
||||
)
|
||||
link_document_multiple_favorites_add = Link(
|
||||
text=_('Add to favorites'),
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_favorites_add',
|
||||
view='documents:document_multiple_add_to_favorites',
|
||||
)
|
||||
link_document_multiple_favorites_remove = Link(
|
||||
text=_('Remove from favorites'),
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_favorites_remove',
|
||||
view='documents:document_multiple_remove_from_favorites',
|
||||
)
|
||||
link_document_multiple_document_type_edit = Link(
|
||||
text=_('Change type'),
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_type_change',
|
||||
view='documents:document_multiple_document_type_edit'
|
||||
)
|
||||
link_document_multiple_download = Link(
|
||||
text=_('Advanced download'), view='documents:document_multiple_download_form'
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_download',
|
||||
text=_('Advanced download'),
|
||||
view='documents:document_multiple_download_form'
|
||||
)
|
||||
link_document_multiple_update_page_count = Link(
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_page_count_update',
|
||||
text=_('Recalculate page count'),
|
||||
view='documents:document_multiple_update_page_count'
|
||||
)
|
||||
link_document_multiple_restore = Link(
|
||||
icon_class_path='mayan.apps.documents.icons.icon_trashed_document_restore',
|
||||
text=_('Restore'), view='documents:document_multiple_restore'
|
||||
)
|
||||
|
||||
# Versions
|
||||
link_document_version_download = Link(
|
||||
args='resolved_object.pk', permissions=(permission_document_download,),
|
||||
text=_('Download version'), view='documents:document_version_download_form'
|
||||
args='resolved_object.pk',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_version_download',
|
||||
permissions=(permission_document_download,), text=_('Download version'),
|
||||
view='documents:document_version_download_form'
|
||||
)
|
||||
link_document_version_return_document = Link(
|
||||
args='resolved_object.document.pk',
|
||||
icon_class=icon_document_version_return_document,
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_version_return_document',
|
||||
permissions=(permission_document_view,), text=_('Document'),
|
||||
view='documents:document_preview',
|
||||
)
|
||||
link_document_version_return_list = Link(
|
||||
args='resolved_object.document.pk',
|
||||
icon_class=icon_document_version_return_list,
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_version_return_list',
|
||||
permissions=(permission_document_version_view,), text=_('Versions'),
|
||||
view='documents:document_version_list',
|
||||
)
|
||||
link_document_version_view = Link(
|
||||
args='resolved_object.pk', permissions=(permission_document_version_view,),
|
||||
args='resolved_object.pk',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_version_view',
|
||||
permissions=(permission_document_version_view,),
|
||||
text=_('Details'), view='documents:document_version_view'
|
||||
)
|
||||
|
||||
# Views
|
||||
link_document_list = Link(
|
||||
icon_class=icon_document_list, text=_('All documents'),
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_list',
|
||||
text=_('All documents'),
|
||||
view='documents:document_list'
|
||||
)
|
||||
link_document_list_favorites = Link(
|
||||
|
||||
Reference in New Issue
Block a user