Update bootstrap app to registry and icon system
This commit is contained in:
@@ -1,22 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation.api import bind_links
|
||||
#from project_setup.api import register_setup
|
||||
|
||||
from .links import database_bootstrap, bootstrap_execute, erase_database_link
|
||||
from .api import BootstrapSimple, BootstrapPermit
|
||||
from .links import bootstrap_execute
|
||||
from .models import BootstrapSetup
|
||||
|
||||
#register_setup(database_bootstrap)
|
||||
#register_setup(erase_database_link)
|
||||
bind_links([BootstrapSimple], [bootstrap_execute])
|
||||
bind_links([BootstrapPermit], [bootstrap_execute])
|
||||
"""
|
||||
try:
|
||||
app = App.register('bootstrap', _(u'Database bootstrap'))
|
||||
except App.UnableToRegister:
|
||||
pass
|
||||
else:
|
||||
app.set_dependencies(['app_registry'])
|
||||
"""
|
||||
bind_links([BootstrapSetup], [bootstrap_execute])
|
||||
|
||||
8
apps/bootstrap/icons.py
Normal file
8
apps/bootstrap/icons.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from icons.literals import DATABASE_LIGHTNING, RADIOACTIVITY
|
||||
from icons import Icon
|
||||
|
||||
icon_database_bootstrap = Icon(DATABASE_LIGHTNING)
|
||||
icon_bootstrap_execute = Icon(DATABASE_LIGHTNING)
|
||||
icon_nuke_database = Icon(RADIOACTIVITY)
|
||||
@@ -5,7 +5,8 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from navigation import Link
|
||||
|
||||
from .permissions import PERMISSION_BOOTSTRAP_EXECUTE, PERMISSION_NUKE_DATABASE
|
||||
from .icons import icon_database_bootstrap, icon_bootstrap_execute, icon_nuke_database
|
||||
|
||||
database_bootstrap = Link(text=_(u'bootstrap database'), view='bootstrap_type_list', icon='database_lightning.png', permissions=[PERMISSION_BOOTSTRAP_EXECUTE])
|
||||
bootstrap_execute = Link(text=_(u'execute'), view='bootstrap_execute', args='object.name', sprite='database_lightning', permissions=[PERMISSION_BOOTSTRAP_EXECUTE])
|
||||
erase_database_link = Link(text=_(u'erase database'), view='erase_database_view', icon='radioactivity.png', permissions=[PERMISSION_NUKE_DATABASE])
|
||||
database_bootstrap = Link(text=_(u'bootstrap database'), view='bootstrap_type_list', icon=icon_database_bootstrap, permissions=[PERMISSION_BOOTSTRAP_EXECUTE])
|
||||
bootstrap_execute = Link(text=_(u'execute'), view='bootstrap_execute', args='object.pk', icon=icon_bootstrap_execute, permissions=[PERMISSION_BOOTSTRAP_EXECUTE])
|
||||
link_erase_database = Link(text=_(u'erase database'), view='erase_database_view', icon=icon_nuke_database, permissions=[PERMISSION_NUKE_DATABASE])
|
||||
|
||||
12
apps/bootstrap/registry.py
Normal file
12
apps/bootstrap/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_database_bootstrap
|
||||
from .links import database_bootstrap, link_erase_database
|
||||
|
||||
label = _(u'Database bootstrap')
|
||||
description = _(u'Provides pre configured setups for indexes, document types, tags.')
|
||||
dependencies = ['app_registry', 'icons', 'navigation', 'documents', 'indexing', 'metadata', 'tags']
|
||||
icon = icon_database_bootstrap
|
||||
setup_links = [database_bootstrap, link_erase_database]
|
||||
@@ -38,6 +38,7 @@ class IconSet(IconSetBase):
|
||||
DATABASE_ADD: 'database_add.png',
|
||||
DATABASE_EDIT: 'database_edit.png',
|
||||
DATABASE_DELETE: 'database_delete.png',
|
||||
DATABASE_LIGHTNING: 'database_lightning.png',
|
||||
DELETE: 'delete.png',
|
||||
DISK: 'disk.png',
|
||||
DRAW_AIRBRUSH: 'draw_airbrush.png',
|
||||
@@ -106,6 +107,7 @@ class IconSet(IconSetBase):
|
||||
PILL: 'pill.png',
|
||||
PLUGIN: 'plugin.png',
|
||||
PRINTER: 'printer.png',
|
||||
RADIOACTIVITY: 'radioactivity.png',
|
||||
RAINBOW: 'rainbow.png',
|
||||
RESULTSET_FIRST: 'resultset_first.png',
|
||||
RESULTSET_LAST: 'resultset_last.png',
|
||||
|
||||
@@ -32,6 +32,7 @@ DATABASE = 'database'
|
||||
DATABASE_ADD = 'database_add'
|
||||
DATABASE_EDIT = 'database_edit'
|
||||
DATABASE_DELETE = 'database_delete'
|
||||
DATABASE_LIGHTNING = 'database_lightning'
|
||||
DELETE = 'delete'
|
||||
DISK = 'disk'
|
||||
DRAW_AIRBRUSH = 'draw_airbrush'
|
||||
@@ -102,6 +103,7 @@ PICTURES = 'pictures'
|
||||
PILL = 'pill'
|
||||
PLUGIN = 'plugin'
|
||||
PRINTER = 'printer'
|
||||
RADIOACTIVITY = 'radioactivity'
|
||||
RAINBOW = 'rainbow'
|
||||
RESULTSET_FIRST = 'resultset_first'
|
||||
RESULTSET_LAST = 'resultset_last'
|
||||
|
||||
@@ -189,7 +189,7 @@ INSTALLED_APPS = (
|
||||
#'workflows',
|
||||
#'checkouts',
|
||||
'rest_api',
|
||||
#'bootstrap',
|
||||
'bootstrap',
|
||||
'statistics',
|
||||
'trash',
|
||||
|
||||
|
||||
2
urls.py
2
urls.py
@@ -36,7 +36,7 @@ urlpatterns = patterns('',
|
||||
#(r'^installation/', include('installation.urls')),
|
||||
(r'^scheduler/', include('scheduler.urls')),
|
||||
(r'^job_processing/', include('job_processor.urls')),
|
||||
#(r'^bootstrap/', include('bootstrap.urls')),
|
||||
(r'^bootstrap/', include('bootstrap.urls')),
|
||||
(r'^diagnostics/', include('diagnostics.urls')),
|
||||
(r'^maintenance/', include('maintenance.urls')),
|
||||
(r'^statistics/', include('statistics.urls')),
|
||||
|
||||
Reference in New Issue
Block a user