Update and enable the trash app
This commit is contained in:
@@ -11,6 +11,9 @@ class IconSet(IconSetBase):
|
||||
dictionary={
|
||||
ADD: 'add.png',
|
||||
APPLICATION_VIEW_ICONS: 'application_view_icons.png',
|
||||
BIN_CLOSED: 'bin_closed.png',
|
||||
BIN: 'bin.png',
|
||||
BIN_EMPTY: 'bin_empty.png',
|
||||
BLACKBOARD_SUM: 'blackboard_sum.png',
|
||||
BOOK: 'book.png',
|
||||
BOOK_GO: 'book_go.png',
|
||||
|
||||
@@ -5,6 +5,9 @@ DEFAULT_ICON_SET = 'fat_cow'
|
||||
|
||||
ADD = 'add'
|
||||
APPLICATION_VIEW_ICONS = 'application_view_icons'
|
||||
BIN_CLOSED = 'bin_closed'
|
||||
BIN = 'bin'
|
||||
BIN_EMPTY = 'bin_empty'
|
||||
BLACKBOARD_SUM = 'blackboard_sum'
|
||||
BOOK = 'book'
|
||||
BOOK_GO = 'book_go'
|
||||
|
||||
@@ -6,14 +6,12 @@ from django.db import transaction, DatabaseError
|
||||
from documents.models import Document
|
||||
from folders.models import Folder
|
||||
from navigation.api import bind_links
|
||||
from project_tools.api import register_tool
|
||||
from taggit.models import Tag
|
||||
|
||||
from .api import make_trashable
|
||||
from .links import trash_can_list, trash_can_items, trash_can_item_restore, trash_can_item_delete
|
||||
from .models import TrashCan, TrashCanItem
|
||||
|
||||
register_tool(trash_can_list)
|
||||
bind_links(['trash_can_list', TrashCan], trash_can_list, menu_name='secondary_menu')
|
||||
bind_links([TrashCan], trash_can_items)
|
||||
bind_links([TrashCanItem], [trash_can_item_restore, trash_can_item_delete])
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from common.querysets import CustomizableQuerySet
|
||||
from common.querysets import CustomizableQuerySet
|
||||
|
||||
from .models import new_delete_method, TrashableQuerySetManager
|
||||
|
||||
|
||||
9
apps/trash/icons.py
Normal file
9
apps/trash/icons.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from icons.literals import BIN_CLOSED, BIN, BIN_EMPTY, DELETE
|
||||
from icons import Icon
|
||||
|
||||
icon_trash_cans = Icon(BIN_CLOSED)
|
||||
icon_trash_can_items = Icon(BIN)
|
||||
icon_trash_can_item_restore = Icon(BIN_EMPTY)
|
||||
icon_trash_can_item_delete = Icon(DELETE)
|
||||
@@ -4,8 +4,10 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import Link
|
||||
|
||||
from .icons import (icon_trash_cans, icon_trash_can_items, icon_trash_can_item_restore,
|
||||
icon_trash_can_item_delete)
|
||||
|
||||
trash_can_list = Link(text=_(u'trash cans'), view='trash_can_list', sprite='bin_closed', icon='bin_closed.png')
|
||||
trash_can_items = Link(text=_(u'items'), view='trash_can_items', args='trash_can.pk', sprite='bin')
|
||||
trash_can_item_restore = Link(text=_(u'restore'), view='trash_can_item_restore', args='trash_can_item.pk', sprite='bin_empty')
|
||||
trash_can_item_delete = Link(text=_(u'delete'), view='trash_can_item_delete', args='trash_can_item.pk', sprite='delete')
|
||||
trash_can_list = Link(text=_(u'trash cans'), view='trash_can_list', icon=icon_trash_cans)
|
||||
trash_can_items = Link(text=_(u'items'), view='trash_can_items', args='trash_can.pk', icon=icon_trash_can_items)
|
||||
trash_can_item_restore = Link(text=_(u'restore'), view='trash_can_item_restore', args='trash_can_item.pk', icon=icon_trash_can_item_restore)
|
||||
trash_can_item_delete = Link(text=_(u'delete'), view='trash_can_item_delete', args='trash_can_item.pk', icon=icon_trash_can_item_delete)
|
||||
|
||||
12
apps/trash/registry.py
Normal file
12
apps/trash/registry.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from .icons import icon_trash_cans
|
||||
from .links import trash_can_list
|
||||
|
||||
label = _(u'Trash manager')
|
||||
description = _(u'Provides a generic and reusable trash can.')
|
||||
icon = icon_trash_cans
|
||||
dependencies = ['app_registry', 'icons', 'documents', 'permissions', 'navigation', 'documents', 'tags', 'folders']
|
||||
tool_links = [trash_can_list]
|
||||
@@ -161,7 +161,6 @@ INSTALLED_APPS = (
|
||||
'pagination',
|
||||
'django_gpg',
|
||||
'converter',
|
||||
#'trash',
|
||||
'user_management',
|
||||
'mimetype',
|
||||
'clustering',
|
||||
@@ -192,6 +191,7 @@ INSTALLED_APPS = (
|
||||
'rest_api',
|
||||
#'bootstrap',
|
||||
'statistics',
|
||||
'trash',
|
||||
|
||||
# Has to be last so the other apps can register it's signals
|
||||
#'signaler',
|
||||
|
||||
2
urls.py
2
urls.py
@@ -41,7 +41,7 @@ urlpatterns = patterns('',
|
||||
(r'^maintenance/', include('maintenance.urls')),
|
||||
(r'^statistics/', include('statistics.urls')),
|
||||
(r'^clustering/', include('clustering.urls')),
|
||||
#(r'^trash/', include('trash.urls')),
|
||||
(r'^trash/', include('trash.urls')),
|
||||
#(r'^admin/doc/', include('django.contrib.admindocs.urls')),
|
||||
#(r'^admin/', include(admin.site.urls)),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user