Move navigation app classes to a separate classes file
This commit is contained in:
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .permissions import (ACLS_EDIT_ACL, ACLS_VIEW_ACL,
|
||||
ACLS_CLASS_EDIT_ACL, ACLS_CLASS_VIEW_ACL)
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .icons import icon_app
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .icons import icon_app
|
||||
from .permissions import PERMISSION_BACKUP_JOB_VIEW, PERMISSION_BACKUP_JOB_CREATE, PERMISSION_BACKUP_JOB_EDIT, PERMISSION_BACKUP_JOB_DELETE
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .permissions import PERMISSION_BOOTSTRAP_EXECUTE, PERMISSION_NUKE_DATABASE
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .permissions import (PERMISSION_DOCUMENT_CHECKOUT, PERMISSION_DOCUMENT_CHECKIN, PERMISSION_DOCUMENT_CHECKIN_OVERRIDE)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .permissions import PERMISSION_NODES_VIEW, PERMISSION_EDIT_CLUSTER_CONFIGURATION
|
||||
from .icons import icon_tool_link, icon_node_link
|
||||
|
||||
@@ -12,9 +12,9 @@ from django.conf import settings
|
||||
from django.db.models.signals import post_save
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from navigation.api import bind_links, register_top_menu, Link
|
||||
from navigation import Link
|
||||
from navigation.api import bind_links, register_top_menu
|
||||
from project_setup.api import register_setup
|
||||
#from project_tools.api import register_tool
|
||||
|
||||
from .settings import (AUTO_CREATE_ADMIN, AUTO_ADMIN_USERNAME,
|
||||
AUTO_ADMIN_PASSWORD, TEMPORARY_DIRECTORY)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .icons import (icon_password_change, icon_current_user_details, icon_current_user_edit,
|
||||
icon_about, icon_license, icon_admin_site)
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .icons import icon_format_list
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .icons import icon_diagnostic, icon_diagnostic_execute
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .icons import (icon_private_keys, icon_public_keys, icon_key_delete,
|
||||
icon_key_query, icon_key_receive, icon_key_setup)
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .permissions import (PERMISSION_COMMENT_CREATE,
|
||||
PERMISSION_COMMENT_DELETE, PERMISSION_COMMENT_VIEW)
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
from documents.permissions import PERMISSION_DOCUMENT_VIEW
|
||||
|
||||
from .permissions import (PERMISSION_DOCUMENT_INDEXING_VIEW,
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .models import DocumentVersionSignature
|
||||
from .permissions import (
|
||||
|
||||
@@ -9,7 +9,7 @@ from history.permissions import PERMISSION_HISTORY_VIEW
|
||||
from maintenance.api import MaintenanceNamespace
|
||||
from navigation.api import (bind_links, register_top_menu,
|
||||
register_model_list_columns,
|
||||
register_sidebar_template, Link, register_multi_item_links)
|
||||
register_sidebar_template, register_multi_item_links)
|
||||
|
||||
# Register document type links
|
||||
from .models import (Document, DocumentPage,
|
||||
|
||||
@@ -6,7 +6,7 @@ from acls.api import class_permissions
|
||||
from acls.permissions import ACLS_EDIT_ACL, ACLS_VIEW_ACL
|
||||
from documents.models import Document
|
||||
from navigation.api import (bind_links, register_multi_item_links,
|
||||
register_sidebar_template, Link)
|
||||
register_sidebar_template)
|
||||
|
||||
from .links import (folder_list, folder_create, folder_edit,
|
||||
folder_delete, folder_document_multiple_remove, folder_view,
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
from documents.permissions import PERMISSION_DOCUMENT_VIEW
|
||||
from acls.permissions import ACLS_VIEW_ACL
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .permissions import PERMISSION_HISTORY_VIEW
|
||||
from .icons import icon_history_list, icon_history_details
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .permissions import PERMISSION_INSTALLATION_DETAILS
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from clustering.permissions import PERMISSION_NODES_VIEW
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
from documents.permissions import PERMISSION_DOCUMENT_VIEW
|
||||
from acls.permissions import ACLS_VIEW_ACL
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .permissions import PERMISSION_MAILING_LINK, PERMISSION_MAILING_SEND_DOCUMENT
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link, register_top_menu
|
||||
from navigation.api import register_top_menu
|
||||
|
||||
from .links import link_home
|
||||
|
||||
__author__ = 'Roberto Rosario'
|
||||
__copyright__ = 'Copyright 2011 Roberto Rosario'
|
||||
@@ -37,4 +39,4 @@ def get_version():
|
||||
__version__ = get_version()
|
||||
|
||||
|
||||
register_top_menu('home', link=Link(text=_(u'home'), view='home', sprite='house'), position=0)
|
||||
register_top_menu('home', link=link_home, position=0)
|
||||
|
||||
9
apps/main/links.py
Normal file
9
apps/main/links.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation import Link
|
||||
|
||||
from .icons import icon_home
|
||||
|
||||
link_home = Link(text=_(u'home'), view='home', icon=icon_home)
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .icons import icon_maintenance_menu, icon_maintenance_execute
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from documents.permissions import PERMISSION_DOCUMENT_TYPE_EDIT
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from elementtree.ElementTree import Element
|
||||
|
||||
main_menu = Element('root')
|
||||
from .classes import Link
|
||||
|
||||
@@ -1,155 +1,24 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
import urlparse
|
||||
import urllib
|
||||
import logging
|
||||
import re
|
||||
|
||||
from elementtree.ElementTree import Element
|
||||
|
||||
from django.template import (VariableDoesNotExist, Variable)
|
||||
from django.utils.encoding import smart_str, smart_unicode
|
||||
from django.core.urlresolvers import reverse, NoReverseMatch
|
||||
from django.utils.http import urlquote, urlencode
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from elementtree.ElementTree import SubElement
|
||||
|
||||
from .utils import (resolve_to_name, resolve_arguments,
|
||||
get_navigation_objects)
|
||||
from . import main_menu
|
||||
from .utils import resolve_to_name, get_navigation_objects
|
||||
|
||||
multi_object_navigation = {}
|
||||
model_list_columns = {}
|
||||
sidebar_templates = {}
|
||||
|
||||
bound_links = {}
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ResolvedLink(object):
|
||||
active = False
|
||||
url = '#'
|
||||
text = _('Unnamed link')
|
||||
|
||||
|
||||
class Link(object):
|
||||
def __init__(self, text, view, klass=None, args=None, sprite=None,
|
||||
icon=None, permissions=None, condition=None, conditional_disable=None,
|
||||
description=None, dont_mark_active=False, children_view_regex=None,
|
||||
keep_query=False, children_classes=None, children_url_regex=None,
|
||||
children_views=None, conditional_highlight=None):
|
||||
|
||||
self.text = text
|
||||
self.view = view
|
||||
self.args = args or {}
|
||||
#self.kwargs = kwargs or {}
|
||||
self.sprite = sprite
|
||||
self.icon = icon
|
||||
self.permissions = permissions or []
|
||||
self.condition = condition
|
||||
self.conditional_disable = conditional_disable
|
||||
self.description = description
|
||||
self.dont_mark_active = dont_mark_active
|
||||
self.klass = klass
|
||||
self.keep_query = keep_query
|
||||
self.conditional_highlight = conditional_highlight # Used by dynamic sources
|
||||
self.children_views = children_views or []
|
||||
self.children_classes = children_classes or []
|
||||
self.children_url_regex = children_url_regex or []
|
||||
self.children_view_regex = children_view_regex or []
|
||||
|
||||
def resolve(self, context, request=None, current_path=None, current_view=None):
|
||||
# Don't calculate these if passed in an argument
|
||||
request = request or Variable('request').resolve(context)
|
||||
current_path = current_path or request.META['PATH_INFO']
|
||||
current_view = current_view or resolve_to_name(current_path)
|
||||
|
||||
# Preserve unicode data in URL query
|
||||
previous_path = smart_unicode(urllib.unquote_plus(smart_str(request.get_full_path()) or smart_str(request.META.get('HTTP_REFERER', u'/'))))
|
||||
query_string = urlparse.urlparse(previous_path).query
|
||||
parsed_query_string = urlparse.parse_qs(query_string)
|
||||
|
||||
logger.debug('condition: %s', self.condition)
|
||||
|
||||
# Check to see if link has conditional display
|
||||
if self.condition:
|
||||
self.condition_result = self.condition(context)
|
||||
else:
|
||||
self.condition_result = True
|
||||
|
||||
logger.debug('self.condition_result: %s', self.condition_result)
|
||||
|
||||
if self.condition_result:
|
||||
resolved_link = ResolvedLink()
|
||||
resolved_link.text = self.text
|
||||
resolved_link.sprite = self.sprite
|
||||
resolved_link.icon = self.icon
|
||||
resolved_link.permissions = self.permissions
|
||||
resolved_link.condition_result = self.condition_result
|
||||
|
||||
try:
|
||||
#args, kwargs = resolve_arguments(context, self.get('args', {}))
|
||||
args, kwargs = resolve_arguments(context, self.args)
|
||||
except VariableDoesNotExist:
|
||||
args = []
|
||||
kwargs = {}
|
||||
|
||||
if self.view:
|
||||
if not self.dont_mark_active:
|
||||
resolved_link.active = self.view == current_view
|
||||
|
||||
try:
|
||||
if kwargs:
|
||||
resolved_link.url = reverse(self.view, kwargs=kwargs)
|
||||
else:
|
||||
resolved_link.url = reverse(self.view, args=args)
|
||||
if self.keep_query:
|
||||
resolved_link.url = u'%s?%s' % (urlquote(resolved_link.url), urlencode(parsed_query_string, doseq=True))
|
||||
|
||||
except NoReverseMatch, exc:
|
||||
resolved_link.url = '#'
|
||||
resolved_link.error = exc
|
||||
elif self.url:
|
||||
if not self.dont_mark_active:
|
||||
resolved_link.url.active = self.url == current_path
|
||||
|
||||
if kwargs:
|
||||
resolved_link.url = self.url % kwargs
|
||||
else:
|
||||
resolved_link.url = self.url % args
|
||||
if self.keep_query:
|
||||
resolved_link.url = u'%s?%s' % (urlquote(resolved_link.url), urlencode(parsed_query_string, doseq=True))
|
||||
else:
|
||||
resolved_link.active = False
|
||||
|
||||
if self.conditional_highlight:
|
||||
resolved_link.active = self.conditional_highlight(context)
|
||||
|
||||
if self.conditional_disable:
|
||||
resolved_link.disabled = self.conditional_disable(context)
|
||||
else:
|
||||
resolved_link.disabled = False
|
||||
|
||||
if current_view in self.children_views:
|
||||
resolved_link.active = True
|
||||
|
||||
# TODO: eliminate url_regexes and use new tree base main menu
|
||||
for child_url_regex in self.children_url_regex:
|
||||
if re.compile(child_url_regex).match(current_path.lstrip('/')):
|
||||
resolved_link.active = True
|
||||
|
||||
for children_view_regex in self.children_view_regex:
|
||||
if re.compile(children_view_regex).match(current_view):
|
||||
resolved_link.active = True
|
||||
|
||||
for cls in self.children_classes:
|
||||
object_list = get_navigation_objects(context)
|
||||
if object_list:
|
||||
if type(object_list[0]['object']) == cls or object_list[0]['object'] == cls:
|
||||
#new_link['active'] = True
|
||||
resolved_link.active = True
|
||||
|
||||
return resolved_link
|
||||
main_menu = Element('root')
|
||||
|
||||
|
||||
def bind_links(sources, links, menu_name=None, position=0):
|
||||
@@ -219,20 +88,6 @@ def get_context_navigation_links(context, menu_name=None, links_dict=bound_links
|
||||
# TODO: fix this
|
||||
links_dict = links_dict.copy()
|
||||
|
||||
# TODO: doesn't appear to be used
|
||||
'''
|
||||
try:
|
||||
"""
|
||||
Override the navigation links dictionary with the provided
|
||||
link list
|
||||
"""
|
||||
navigation_object_links = Variable('overrided_object_links').resolve(context)
|
||||
if navigation_object_links:
|
||||
return [link.resolve(context) for link in navigation_object_links]
|
||||
except VariableDoesNotExist:
|
||||
pass
|
||||
'''
|
||||
# TODO: who uses this? Remove if no one.
|
||||
# Dynamic sources
|
||||
# TODO: improve name to 'injected...'
|
||||
try:
|
||||
|
||||
142
apps/navigation/classes.py
Normal file
142
apps/navigation/classes.py
Normal file
@@ -0,0 +1,142 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
import urlparse
|
||||
import urllib
|
||||
import logging
|
||||
import re
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.template import VariableDoesNotExist, Variable
|
||||
from django.utils.encoding import smart_str, smart_unicode
|
||||
from django.core.urlresolvers import reverse, NoReverseMatch
|
||||
from django.utils.http import urlquote, urlencode
|
||||
|
||||
from .utils import resolve_to_name, resolve_arguments
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ResolvedLink(object):
|
||||
active = False
|
||||
url = '#'
|
||||
text = _('Unnamed link')
|
||||
|
||||
|
||||
class Link(object):
|
||||
def __init__(self, text, view, klass=None, args=None, sprite=None,
|
||||
icon=None, permissions=None, condition=None, conditional_disable=None,
|
||||
description=None, dont_mark_active=False, children_view_regex=None,
|
||||
keep_query=False, children_classes=None, children_url_regex=None,
|
||||
children_views=None, conditional_highlight=None):
|
||||
|
||||
self.text = text
|
||||
self.view = view
|
||||
self.args = args or {}
|
||||
#self.kwargs = kwargs or {}
|
||||
self.sprite = sprite
|
||||
self.icon = icon
|
||||
self.permissions = permissions or []
|
||||
self.condition = condition
|
||||
self.conditional_disable = conditional_disable
|
||||
self.description = description
|
||||
self.dont_mark_active = dont_mark_active
|
||||
self.klass = klass
|
||||
self.keep_query = keep_query
|
||||
self.conditional_highlight = conditional_highlight # Used by dynamic sources
|
||||
self.children_views = children_views or []
|
||||
self.children_classes = children_classes or []
|
||||
self.children_url_regex = children_url_regex or []
|
||||
self.children_view_regex = children_view_regex or []
|
||||
|
||||
def resolve(self, context, request=None, current_path=None, current_view=None):
|
||||
# Don't calculate these if passed in an argument
|
||||
request = request or Variable('request').resolve(context)
|
||||
current_path = current_path or request.META['PATH_INFO']
|
||||
current_view = current_view or resolve_to_name(current_path)
|
||||
|
||||
# Preserve unicode data in URL query
|
||||
previous_path = smart_unicode(urllib.unquote_plus(smart_str(request.get_full_path()) or smart_str(request.META.get('HTTP_REFERER', u'/'))))
|
||||
query_string = urlparse.urlparse(previous_path).query
|
||||
parsed_query_string = urlparse.parse_qs(query_string)
|
||||
|
||||
logger.debug('condition: %s', self.condition)
|
||||
|
||||
# Check to see if link has conditional display
|
||||
if self.condition:
|
||||
self.condition_result = self.condition(context)
|
||||
else:
|
||||
self.condition_result = True
|
||||
|
||||
logger.debug('self.condition_result: %s', self.condition_result)
|
||||
|
||||
if self.condition_result:
|
||||
resolved_link = ResolvedLink()
|
||||
resolved_link.text = self.text
|
||||
resolved_link.sprite = self.sprite
|
||||
resolved_link.icon = self.icon
|
||||
resolved_link.permissions = self.permissions
|
||||
resolved_link.condition_result = self.condition_result
|
||||
|
||||
try:
|
||||
#args, kwargs = resolve_arguments(context, self.get('args', {}))
|
||||
args, kwargs = resolve_arguments(context, self.args)
|
||||
except VariableDoesNotExist:
|
||||
args = []
|
||||
kwargs = {}
|
||||
|
||||
if self.view:
|
||||
if not self.dont_mark_active:
|
||||
resolved_link.active = self.view == current_view
|
||||
|
||||
try:
|
||||
if kwargs:
|
||||
resolved_link.url = reverse(self.view, kwargs=kwargs)
|
||||
else:
|
||||
resolved_link.url = reverse(self.view, args=args)
|
||||
if self.keep_query:
|
||||
resolved_link.url = u'%s?%s' % (urlquote(resolved_link.url), urlencode(parsed_query_string, doseq=True))
|
||||
|
||||
except NoReverseMatch, exc:
|
||||
resolved_link.url = '#'
|
||||
resolved_link.error = exc
|
||||
elif self.url:
|
||||
if not self.dont_mark_active:
|
||||
resolved_link.url.active = self.url == current_path
|
||||
|
||||
if kwargs:
|
||||
resolved_link.url = self.url % kwargs
|
||||
else:
|
||||
resolved_link.url = self.url % args
|
||||
if self.keep_query:
|
||||
resolved_link.url = u'%s?%s' % (urlquote(resolved_link.url), urlencode(parsed_query_string, doseq=True))
|
||||
else:
|
||||
resolved_link.active = False
|
||||
|
||||
if self.conditional_highlight:
|
||||
resolved_link.active = self.conditional_highlight(context)
|
||||
|
||||
if self.conditional_disable:
|
||||
resolved_link.disabled = self.conditional_disable(context)
|
||||
else:
|
||||
resolved_link.disabled = False
|
||||
|
||||
if current_view in self.children_views:
|
||||
resolved_link.active = True
|
||||
|
||||
# TODO: eliminate url_regexes and use new tree base main menu
|
||||
for child_url_regex in self.children_url_regex:
|
||||
if re.compile(child_url_regex).match(current_path.lstrip('/')):
|
||||
resolved_link.active = True
|
||||
|
||||
for children_view_regex in self.children_view_regex:
|
||||
if re.compile(children_view_regex).match(current_view):
|
||||
resolved_link.active = True
|
||||
|
||||
for cls in self.children_classes:
|
||||
object_list = get_navigation_objects(context)
|
||||
if object_list:
|
||||
if type(object_list[0]['object']) == cls or object_list[0]['object'] == cls:
|
||||
#new_link['active'] = True
|
||||
resolved_link.active = True
|
||||
|
||||
return resolved_link
|
||||
@@ -13,7 +13,7 @@ from ..api import (bound_links, multi_object_navigation,
|
||||
sidebar_templates, get_context_navigation_links)
|
||||
from ..forms import MultiItemForm
|
||||
from ..utils import resolve_to_name, resolve_template_variable
|
||||
from .. import main_menu
|
||||
from ..api import main_menu
|
||||
|
||||
register = Library()
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .permissions import (PERMISSION_OCR_DOCUMENT,
|
||||
PERMISSION_OCR_DOCUMENT_DELETE, PERMISSION_OCR_QUEUE_ENABLE_DISABLE,
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .permissions import (PERMISSION_ROLE_VIEW, PERMISSION_ROLE_EDIT,
|
||||
PERMISSION_ROLE_CREATE, PERMISSION_ROLE_DELETE,
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import register_top_menu, Link
|
||||
from navigation import Link
|
||||
|
||||
from .icons import icon_setup
|
||||
|
||||
|
||||
9
apps/project_tools/links.py
Normal file
9
apps/project_tools/links.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation import Link
|
||||
|
||||
from .icons import icon_tool
|
||||
|
||||
link_tools = Link(text=_(u'tools'), view='tools_list', icon=icon_tool)
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .permissions import PERMISSION_VIEW_JOB_LIST, PERMISSION_VIEW_SCHEDULER_LIST
|
||||
from .icons import icon_scheduler_tool_link, icon_scheduler_list, icon_job_list
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .icons import icon_settings
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ from django.utils.safestring import mark_safe
|
||||
|
||||
from common.utils import return_type, encapsulate
|
||||
from common.widgets import exists_with_famfam
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
from app_registry.models import App
|
||||
|
||||
from .classes import SettingsNamespace
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
from documents.permissions import (PERMISSION_DOCUMENT_NEW_VERSION,
|
||||
PERMISSION_DOCUMENT_CREATE)
|
||||
from .permissions import (PERMISSION_SOURCES_SETUP_VIEW,
|
||||
|
||||
@@ -26,7 +26,7 @@ from common.utils import encapsulate
|
||||
from common.widgets import two_state_template
|
||||
import sendfile
|
||||
from acls.models import AccessEntry
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .models import (WebForm, StagingFolder, SourceTransformation,
|
||||
WatchFolder, POP3Email, SourceLog, IMAPEmail, LocalScanner)
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .icons import icon_statistics
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from acls.api import class_permissions
|
||||
from common.utils import encapsulate
|
||||
from documents.models import Document
|
||||
from navigation.api import (bind_links, register_top_menu,
|
||||
register_model_list_columns, register_multi_item_links, Link)
|
||||
register_model_list_columns, register_multi_item_links)
|
||||
|
||||
from taggit.models import Tag
|
||||
from taggit.managers import TaggableManager
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
from acls.permissions import ACLS_VIEW_ACL
|
||||
|
||||
from .permissions import (PERMISSION_TAG_CREATE, PERMISSION_TAG_ATTACH,
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .icons import (icon_trash_cans, icon_trash_can_items, icon_trash_can_item_restore,
|
||||
icon_trash_can_item_delete)
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
from navigation import Link
|
||||
|
||||
from .permissions import (PERMISSION_GROUP_CREATE, PERMISSION_GROUP_EDIT,
|
||||
PERMISSION_GROUP_VIEW, PERMISSION_GROUP_DELETE, PERMISSION_GROUP_CREATE,
|
||||
|
||||
@@ -3,7 +3,8 @@ from __future__ import absolute_import
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from project_setup.api import register_setup
|
||||
from navigation.api import Link, bind_links
|
||||
from navigation import Link
|
||||
from navigation.api import bind_links
|
||||
|
||||
from .permissions import (PERMISSION_WORKFLOW_SETUP_VIEW,
|
||||
PERMISSION_WORKFLOW_SETUP_CREATE, PERMISSION_WORKFLOW_SETUP_EDIT,
|
||||
|
||||
@@ -146,9 +146,9 @@ INSTALLED_APPS = (
|
||||
'compressor',
|
||||
'djangorestframework',
|
||||
# Base generic
|
||||
'navigation',
|
||||
'permissions',
|
||||
'acls',
|
||||
'navigation',
|
||||
'icons',
|
||||
'project_setup',
|
||||
'project_tools',
|
||||
|
||||
Reference in New Issue
Block a user