<s> from __future__ import absolute_import , unicode_literals <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from converter . permissions import permission_transformation_delete <EOL> from navigation import Link <EOL> from . permissions import ( <EOL> permission_document_delete , permission_document_download , <EOL> permission_document_properties_edit , permission_document_print , <EOL> permission_document_restore , permission_document_tools , <EOL> permission_document_version_revert , permission_document_view , <EOL> permission_document_trash , permission_document_type_create , <EOL> permission_document_type_delete , permission_document_type_edit , <EOL> permission_document_type_view , permission_empty_trash <EOL> ) <EOL> from . settings import setting_zoom_max_level , setting_zoom_min_level <EOL> def is_not_current_version ( context ) : <EOL> return context [ '<STR_LIT:object>' ] . document . latest_version . timestamp != context [ '<STR_LIT:object>' ] . timestamp <EOL> def is_first_page ( context ) : <EOL> return context [ '<STR_LIT>' ] . page_number <= <NUM_LIT:1> <EOL> def is_last_page ( context ) : <EOL> return context [ '<STR_LIT>' ] . page_number >= context [ '<STR_LIT>' ] . document_version . pages . count ( ) <EOL> def is_max_zoom ( context ) : <EOL> return context [ '<STR_LIT>' ] >= setting_zoom_max_level . value <EOL> def is_min_zoom ( context ) : <EOL> return context [ '<STR_LIT>' ] <= setting_zoom_min_level . value <EOL> link_document_preview = Link ( <EOL> permissions = ( permission_document_view , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_properties = Link ( <EOL> permissions = ( permission_document_view , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_version_list = Link ( <EOL> permissions = ( permission_document_view , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_pages = Link ( <EOL> permissions = ( permission_document_view , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_clear_transformations = Link ( <EOL> permissions = ( permission_transformation_delete , ) , <EOL> text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_delete = Link ( <EOL> permissions = ( permission_document_delete , ) , tags = '<STR_LIT>' , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_trash = Link ( <EOL> permissions = ( permission_document_trash , ) , tags = '<STR_LIT>' , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_edit = Link ( <EOL> permissions = ( permission_document_properties_edit , ) , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = '<STR_LIT>' <EOL> ) <EOL> link_document_document_type_edit = Link ( <EOL> permissions = ( permission_document_properties_edit , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_download = Link ( <EOL> permissions = ( permission_document_download , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_print = Link ( <EOL> permissions = ( permission_document_print , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_update_page_count = Link ( <EOL> permissions = ( permission_document_tools , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_restore = Link ( <EOL> permissions = ( permission_document_restore , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_multiple_clear_transformations = Link ( <EOL> permissions = ( permission_transformation_delete , ) , <EOL> text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' <EOL> ) <EOL> link_document_multiple_trash = Link ( <EOL> tags = '<STR_LIT>' , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' <EOL> ) <EOL> link_document_multiple_delete = Link ( <EOL> tags = '<STR_LIT>' , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' <EOL> ) <EOL> link_document_multiple_document_type_edit = Link ( <EOL> text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' <EOL> ) <EOL> link_document_multiple_download = Link ( <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' <EOL> ) <EOL> link_document_multiple_update_page_count = Link ( <EOL> text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' <EOL> ) <EOL> link_document_multiple_restore = Link ( <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' <EOL> ) <EOL> link_document_version_download = Link ( <EOL> args = '<STR_LIT>' , permissions = ( permission_document_download , ) , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' <EOL> ) <EOL> link_document_list = Link ( <EOL> icon = '<STR_LIT>' , text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' <EOL> ) <EOL> link_document_list_recent = Link ( <EOL> icon = '<STR_LIT>' , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' <EOL> ) <EOL> link_document_list_deleted = Link ( <EOL> icon = '<STR_LIT>' , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' <EOL> ) <EOL> link_clear_image_cache = Link ( <EOL> icon = '<STR_LIT>' , <EOL> description = _ ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) , <EOL> permissions = ( permission_document_tools , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' <EOL> ) <EOL> link_trash_can_empty = Link ( <EOL> permissions = ( permission_empty_trash , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' <EOL> ) <EOL> link_document_page_navigation_first = Link ( <EOL> conditional_disable = is_first_page , icon = '<STR_LIT>' , <EOL> keep_query = True , permissions = ( permission_document_view , ) , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = '<STR_LIT>' <EOL> ) <EOL> link_document_page_navigation_last = Link ( <EOL> conditional_disable = is_last_page , icon = '<STR_LIT>' , <EOL> keep_query = True , text = _ ( '<STR_LIT>' ) , <EOL> permissions = ( permission_document_view , ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_page_navigation_previous = Link ( <EOL> conditional_disable = is_first_page , icon = '<STR_LIT>' , <EOL> keep_query = True , permissions = ( permission_document_view , ) , <EOL> text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , <EOL> args = '<STR_LIT>' <EOL> ) <EOL> link_document_page_navigation_next = Link ( <EOL> conditional_disable = is_last_page , icon = '<STR_LIT>' , <EOL> keep_query = True , text = _ ( '<STR_LIT>' ) , <EOL> permissions = ( permission_document_view , ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_page_return = Link ( <EOL> icon = '<STR_LIT>' , permissions = ( permission_document_view , ) , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = '<STR_LIT>' <EOL> ) <EOL> link_document_page_rotate_left = Link ( <EOL> icon = '<STR_LIT>' , permissions = ( permission_document_view , ) , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = '<STR_LIT>' <EOL> ) <EOL> link_document_page_rotate_right = Link ( <EOL> icon = '<STR_LIT>' , permissions = ( permission_document_view , ) , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = '<STR_LIT>' <EOL> ) <EOL> link_document_page_view = Link ( <EOL> permissions = ( permission_document_view , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_page_view_reset = Link ( <EOL> permissions = ( permission_document_view , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_page_zoom_in = Link ( <EOL> conditional_disable = is_max_zoom , icon = '<STR_LIT>' , <EOL> permissions = ( permission_document_view , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_page_zoom_out = Link ( <EOL> conditional_disable = is_min_zoom , icon = '<STR_LIT>' , <EOL> permissions = ( permission_document_view , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_version_revert = Link ( <EOL> condition = is_not_current_version , <EOL> permissions = ( permission_document_version_revert , ) , tags = '<STR_LIT>' , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = '<STR_LIT>' <EOL> ) <EOL> link_document_type_create = Link ( <EOL> permissions = ( permission_document_type_create , ) , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' <EOL> ) <EOL> link_document_type_delete = Link ( <EOL> permissions = ( permission_document_type_delete , ) , tags = '<STR_LIT>' , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = '<STR_LIT>' <EOL> ) <EOL> link_document_type_edit = Link ( <EOL> permissions = ( permission_document_type_edit , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_type_filename_create = Link ( <EOL> permissions = ( permission_document_type_edit , ) , <EOL> text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_type_filename_delete = Link ( <EOL> permissions = ( permission_document_type_edit , ) , tags = '<STR_LIT>' , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = '<STR_LIT>' <EOL> ) <EOL> link_document_type_filename_edit = Link ( <EOL> permissions = ( permission_document_type_edit , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_type_filename_list = Link ( <EOL> permissions = ( permission_document_type_view , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_document_type_list = Link ( <EOL> permissions = ( permission_document_type_view , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' <EOL> ) <EOL> link_document_type_setup = Link ( <EOL> icon = '<STR_LIT>' , permissions = ( permission_document_type_view , ) , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' <EOL> ) </s>
