From bed5b4621d90b3ea3217440ee94b76cf2e92cb43 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Fri, 14 Sep 2012 01:37:56 -0400 Subject: [PATCH] Update and enable the document comments app --- apps/document_comments/icons.py | 8 ++++++++ apps/document_comments/links.py | 9 +++++---- apps/document_comments/registry.py | 10 ++++++++++ apps/icons/iconsets/fat_cow.py | 3 +++ apps/icons/literals.py | 3 +++ settings.py | 2 +- urls.py | 4 ++-- 7 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 apps/document_comments/icons.py create mode 100644 apps/document_comments/registry.py diff --git a/apps/document_comments/icons.py b/apps/document_comments/icons.py new file mode 100644 index 0000000000..498f815af3 --- /dev/null +++ b/apps/document_comments/icons.py @@ -0,0 +1,8 @@ +from __future__ import absolute_import + +from icons.literals import COMMENTS, COMMENT_ADD, COMMENT_DELETE +from icons import Icon + +icon_comments_for_document = Icon(COMMENTS) +icon_comment_add = Icon(COMMENT_ADD) +icon_comment_delete = Icon(COMMENT_DELETE) diff --git a/apps/document_comments/links.py b/apps/document_comments/links.py index dc39609883..91c35b915e 100644 --- a/apps/document_comments/links.py +++ b/apps/document_comments/links.py @@ -6,8 +6,9 @@ from navigation.api import Link from .permissions import (PERMISSION_COMMENT_CREATE, PERMISSION_COMMENT_DELETE, PERMISSION_COMMENT_VIEW) +from .icons import (icon_comments_for_document, icon_comment_add, icon_comment_delete) -comment_delete = Link(text=_('delete'), view='comment_delete', args='object.pk', sprite='comment_delete', permissions=[PERMISSION_COMMENT_DELETE]) -comment_multiple_delete = Link(text=_('delete'), view='comment_multiple_delete', args='object.pk', sprite='comments_delete', permissions=[PERMISSION_COMMENT_DELETE]) -comment_add = Link(text=_('add comment'), view='comment_add', args='object.pk', sprite='comment_add', permissions=[PERMISSION_COMMENT_CREATE]) -comments_for_document = Link(text=_('comments'), view='comments_for_document', args='object.pk', sprite='comments', permissions=[PERMISSION_COMMENT_VIEW], children_view_regex=['comment']) +comment_delete = Link(text=_('delete'), view='comment_delete', args='object.pk', icon=icon_comment_delete, permissions=[PERMISSION_COMMENT_DELETE]) +comment_multiple_delete = Link(text=_('delete'), view='comment_multiple_delete', args='object.pk', icon=icon_comment_delete, permissions=[PERMISSION_COMMENT_DELETE]) +comment_add = Link(text=_('add comment'), view='comment_add', args='object.pk', icon=icon_comment_add, permissions=[PERMISSION_COMMENT_CREATE]) +comments_for_document = Link(text=_('comments'), view='comments_for_document', args='object.pk', icon=icon_comments_for_document, permissions=[PERMISSION_COMMENT_VIEW], children_view_regex=['comment']) diff --git a/apps/document_comments/registry.py b/apps/document_comments/registry.py new file mode 100644 index 0000000000..2b331a304c --- /dev/null +++ b/apps/document_comments/registry.py @@ -0,0 +1,10 @@ +from __future__ import absolute_import + +from django.utils.translation import ugettext_lazy as _ + +from .icons import icon_comments_for_document + +label = _(u'Comments') +description = _(u'Handles document comments.') +icon = icon_comments_for_document +dependencies = ['app_registry', 'icons', 'documents', 'permissions', 'navigation'] diff --git a/apps/icons/iconsets/fat_cow.py b/apps/icons/iconsets/fat_cow.py index 82d604fcc2..0ecd68ddbc 100644 --- a/apps/icons/iconsets/fat_cow.py +++ b/apps/icons/iconsets/fat_cow.py @@ -21,6 +21,9 @@ class IconSet(IconSetBase): COG_ADD: 'cog_add.png', COG_EDIT: 'cog_edit.png', COG_DELETE: 'cog_delete.png', + COMMENTS: 'comments.png', + COMMENT_ADD: 'comment_add.png', + COMMENT_DELETE: 'comment_delete.png', COMPUTER_KEY: 'computer_key.png', CROSS: 'cross.png', DELETE: 'delete.png', diff --git a/apps/icons/literals.py b/apps/icons/literals.py index d75ea0ef81..2b33e35e76 100644 --- a/apps/icons/literals.py +++ b/apps/icons/literals.py @@ -15,6 +15,9 @@ COG = 'cog' COG_ADD = 'cog_add' COG_EDIT = 'cog_edit' COG_DELETE = 'cog_delete' +COMMENTS = 'comments' +COMMENT_ADD = 'comment_add' +COMMENT_DELETE = 'comment_delete' COMPUTER_KEY = 'computer_key' CROSS = 'cross' DELETE = 'delete' diff --git a/settings.py b/settings.py index 8e5359e77b..8394b69b0a 100644 --- a/settings.py +++ b/settings.py @@ -176,7 +176,7 @@ INSTALLED_APPS = ( 'tags', 'folders', #'dynamic_search', - #'document_comments', + 'document_comments', #'document_signatures', 'linking', 'metadata', diff --git a/urls.py b/urls.py index b92b423358..3c811d7d8b 100644 --- a/urls.py +++ b/urls.py @@ -6,7 +6,7 @@ admin.autodiscover() urlpatterns = patterns('', (r'^', include('main.urls')), - (r'^apps/', include('app_registry.urls')),#, namespace='user_blogs')), + (r'^apps/', include('app_registry.urls')),#, namespace='apps')), (r'^common/', include('common.urls')), (r'^permissions/', include('permissions.urls')), (r'^setup/', include('project_setup.urls')), @@ -17,7 +17,7 @@ urlpatterns = patterns('', #(r'^search/', include('dynamic_search.urls')), #(r'^ocr/', include('ocr.urls')), (r'^tags/', include('tags.urls')), - #(r'^comments/', include('document_comments.urls')), + (r'^comments/', include('document_comments.urls')), (r'^user_management/', include('user_management.urls')), (r'^metadata/', include('metadata.urls')), (r'^linking/', include('linking.urls')),