diff --git a/apps/bootstrap/__init__.py b/apps/bootstrap/__init__.py index 76b5145882..58a9ee0976 100644 --- a/apps/bootstrap/__init__.py +++ b/apps/bootstrap/__init__.py @@ -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]) diff --git a/apps/bootstrap/icons.py b/apps/bootstrap/icons.py new file mode 100644 index 0000000000..93de7176ee --- /dev/null +++ b/apps/bootstrap/icons.py @@ -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) diff --git a/apps/bootstrap/links.py b/apps/bootstrap/links.py index 7d5cdeb8d2..95f32d74e3 100644 --- a/apps/bootstrap/links.py +++ b/apps/bootstrap/links.py @@ -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]) diff --git a/apps/bootstrap/registry.py b/apps/bootstrap/registry.py new file mode 100644 index 0000000000..4825519940 --- /dev/null +++ b/apps/bootstrap/registry.py @@ -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] diff --git a/apps/icons/iconsets/fat_cow.py b/apps/icons/iconsets/fat_cow.py index 85c7c497a9..91c22b71b4 100644 --- a/apps/icons/iconsets/fat_cow.py +++ b/apps/icons/iconsets/fat_cow.py @@ -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', diff --git a/apps/icons/literals.py b/apps/icons/literals.py index 0e7c21bea2..a72a0e5ed5 100644 --- a/apps/icons/literals.py +++ b/apps/icons/literals.py @@ -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' diff --git a/settings.py b/settings.py index acd8f3d1e6..b9c03c7907 100644 --- a/settings.py +++ b/settings.py @@ -189,7 +189,7 @@ INSTALLED_APPS = ( #'workflows', #'checkouts', 'rest_api', - #'bootstrap', + 'bootstrap', 'statistics', 'trash', diff --git a/urls.py b/urls.py index 9f2a7e9cbe..baa28f928b 100644 --- a/urls.py +++ b/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')),