<s> from __future__ import absolute_import , unicode_literals <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from documents . models import NewVersionBlock <EOL> from documents . permissions import ( <EOL> permission_document_create , permission_document_new_version <EOL> ) <EOL> from navigation import Link <EOL> from . literals import ( <EOL> SOURCE_CHOICE_WEB_FORM , SOURCE_CHOICE_EMAIL_IMAP , SOURCE_CHOICE_EMAIL_POP3 , <EOL> SOURCE_CHOICE_STAGING , SOURCE_CHOICE_WATCH <EOL> ) <EOL> from . permissions import ( <EOL> permission_sources_setup_create , permission_sources_setup_delete , <EOL> permission_sources_setup_edit , permission_sources_setup_view <EOL> ) <EOL> def document_new_version_not_blocked ( context ) : <EOL> return not NewVersionBlock . objects . is_blocked ( context [ '<STR_LIT:object>' ] ) <EOL> link_document_create_multiple = Link ( <EOL> icon = '<STR_LIT>' , permissions = ( permission_document_create , ) , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' <EOL> ) <EOL> link_document_create_siblings = Link ( <EOL> permissions = ( permission_document_create , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' , args = '<STR_LIT>' <EOL> ) <EOL> link_setup_sources = Link ( <EOL> icon = '<STR_LIT>' , permissions = ( permission_sources_setup_view , ) , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' <EOL> ) <EOL> link_setup_source_create_imap_email = Link ( <EOL> permissions = ( permission_sources_setup_create , ) , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = '<STR_LIT>' % SOURCE_CHOICE_EMAIL_IMAP <EOL> ) <EOL> link_setup_source_create_pop3_email = Link ( <EOL> permissions = ( permission_sources_setup_create , ) , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = '<STR_LIT>' % SOURCE_CHOICE_EMAIL_POP3 <EOL> ) <EOL> link_setup_source_create_staging_folder = Link ( <EOL> permissions = ( permission_sources_setup_create , ) , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = '<STR_LIT>' % SOURCE_CHOICE_STAGING <EOL> ) <EOL> link_setup_source_create_watch_folder = Link ( <EOL> permissions = ( permission_sources_setup_create , ) , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = '<STR_LIT>' % SOURCE_CHOICE_WATCH <EOL> ) <EOL> link_setup_source_create_webform = Link ( <EOL> permissions = ( permission_sources_setup_create , ) , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = '<STR_LIT>' % SOURCE_CHOICE_WEB_FORM <EOL> ) <EOL> link_setup_source_delete = Link ( <EOL> permissions = ( permission_sources_setup_delete , ) , tags = '<STR_LIT>' , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = ( '<STR_LIT>' , ) <EOL> ) <EOL> link_setup_source_edit = Link ( <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = ( '<STR_LIT>' , ) , permissions = ( permission_sources_setup_edit , ) <EOL> ) <EOL> link_source_list = Link ( <EOL> permissions = ( permission_sources_setup_view , ) , text = _ ( '<STR_LIT>' ) , <EOL> view = '<STR_LIT>' <EOL> ) <EOL> link_staging_file_delete = Link ( <EOL> keep_query = True , <EOL> permissions = ( permission_document_new_version , permission_document_create ) , <EOL> tags = '<STR_LIT>' , text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = ( '<STR_LIT>' , '<STR_LIT>' , ) <EOL> ) <EOL> link_upload_version = Link ( <EOL> condition = document_new_version_not_blocked , <EOL> permissions = ( permission_document_new_version , ) , <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = '<STR_LIT>' <EOL> ) <EOL> link_setup_source_logs = Link ( <EOL> text = _ ( '<STR_LIT>' ) , view = '<STR_LIT>' , <EOL> args = ( '<STR_LIT>' , ) , permissions = ( permission_sources_setup_view , ) <EOL> ) </s>
