Add app menu entries from the registry
This commit is contained in:
@@ -1,22 +1,13 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import inspect
|
import inspect
|
||||||
#import runpy
|
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import transaction, DatabaseError
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from django.utils.importlib import import_module
|
from django.utils.importlib import import_module
|
||||||
|
|
||||||
from .models import App
|
from .models import App
|
||||||
|
|
||||||
#from navigation.api import bind_links, register_model_list_columns
|
|
||||||
|
|
||||||
#from .links import (app_registry_tool_link, app_list, backup_tool_link,
|
|
||||||
# restore_tool_link, backup_job_list, backup_job_create, backup_job_edit,
|
|
||||||
# backup_job_test)
|
|
||||||
|
|
||||||
#bind_links(['app_list'], [app_list], menu_name='secondary_menu')
|
|
||||||
###app.set_backup([ModelBackup()])
|
###app.set_backup([ModelBackup()])
|
||||||
|
|
||||||
for app_name in settings.INSTALLED_APPS:
|
for app_name in settings.INSTALLED_APPS:
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ from smart_settings import SettingsNamespace
|
|||||||
from project_setup.api import register_setup
|
from project_setup.api import register_setup
|
||||||
from project_tools.api import register_tool
|
from project_tools.api import register_tool
|
||||||
from statistics.api import register_statistics
|
from statistics.api import register_statistics
|
||||||
|
from navigation.api import register_top_menu
|
||||||
|
|
||||||
#from .classes import AppBackup, StorageModuleBase, Setting
|
#from .classes import AppBackup, StorageModuleBase, Setting
|
||||||
|
|
||||||
@@ -90,9 +91,14 @@ class App(TranslatableLabelMixin, LiveObjectMixin, models.Model):
|
|||||||
register_tool(link)
|
register_tool(link)
|
||||||
|
|
||||||
for statistic in getattr(registration, 'statistics', []):
|
for statistic in getattr(registration, 'statistics', []):
|
||||||
logger.debug('stattistic: %s' % statistic)
|
logger.debug('statistic: %s' % statistic)
|
||||||
register_statistics(statistic)
|
register_statistics(statistic)
|
||||||
|
|
||||||
|
for index, link in enumerate(getattr(registration, 'menu_links', [])):
|
||||||
|
logger.debug('menu_link: %s' % link)
|
||||||
|
register_top_menu(name='%s.%s' % (app_name, index), link=link)
|
||||||
|
|
||||||
|
|
||||||
#def set_backup(self, *args, **kwargs):
|
#def set_backup(self, *args, **kwargs):
|
||||||
# return AppBackup(self, *args, **kwargs)
|
# return AppBackup(self, *args, **kwargs)
|
||||||
|
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
|
||||||
|
|
||||||
from icons.sets import fat_cow, famfamfam, custom
|
|
||||||
|
|
||||||
|
|
||||||
SET_CHOICES = (
|
|
||||||
(fat_cow.ID, fat_cow.LABEL),
|
|
||||||
(famfamfam.ID, famfamfam.LABEL),
|
|
||||||
(custom.ID, custom.LABEL),
|
|
||||||
)
|
|
||||||
|
|
||||||
ICON_THEMES = {
|
|
||||||
fat_cow.ID: fat_cow,
|
|
||||||
famfamfam.ID: famfamfam,
|
|
||||||
custom.ID: custom,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
THEME_DEFAULT = 'default'
|
|
||||||
|
|
||||||
SET_CHOICES = (
|
|
||||||
(fat_cow.ID, fat_cow.LABEL),
|
|
||||||
(famfamfam.ID, famfamfam.LABEL),
|
|
||||||
)
|
|
||||||
|
|
||||||
THEME_ICONSETS = {
|
|
||||||
THEME_DEFAULT: {
|
|
||||||
'icons': fat_cow.DICTIONARY,
|
|
||||||
'sprites': famfamfam.DICTIONARY
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
THEMES_CHOICES = {
|
|
||||||
THEME_DEFAULT: _(u'Default theme (using Fat cow for icons and FamFamFam for sprites)')
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFAULT_THEME = THEME_DEFAULT
|
|
||||||
"""
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
from django.utils.translation import ugettext_lazy as _
|
|
||||||
|
|
||||||
from icons.literals import *
|
|
||||||
|
|
||||||
PATH = 'custom'
|
|
||||||
ID = 'custom'
|
|
||||||
LABEL = _(u'Custom')
|
|
||||||
|
|
||||||
DICTIONARY = {
|
|
||||||
FILE_EXTENSION_ERROR: 'file_extension_error.png',
|
|
||||||
FILE_EXTENSION_UNKNOWN: 'file_extension_unknown.png'
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
from django.utils.translation import ugettext_lazy as _
|
|
||||||
|
|
||||||
from icons.literals import *
|
|
||||||
|
|
||||||
PATH = 'famfamfam'
|
|
||||||
ID = 'famfamfam'
|
|
||||||
LABEL = _(u'FamFamFam')
|
|
||||||
|
|
||||||
DICTIONARY = {
|
|
||||||
PLUGIN: 'plugin',
|
|
||||||
CD_BURN: 'cd_burn',
|
|
||||||
}
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
from django.utils.translation import ugettext_lazy as _
|
|
||||||
|
|
||||||
from icons.literals import *
|
|
||||||
|
|
||||||
PATH = 'fat_cow'
|
|
||||||
ID = 'fat_cow'
|
|
||||||
LABEL = _(u'Fat cow')
|
|
||||||
|
|
||||||
DICTIONARY = {
|
|
||||||
ADD: 'add.png',
|
|
||||||
APPLICATION_VIEW_ICONS: 'application_view_icons.png',
|
|
||||||
BLACKBOARD_SUM: 'blackboard_sum.png',
|
|
||||||
BOOK: 'book.png',
|
|
||||||
BOOK_GO: 'book_go.png',
|
|
||||||
BOOK_OPEN: 'book_open.png',
|
|
||||||
CAMERA_DELETE: 'camera_delete.png',
|
|
||||||
CD_BURN: 'cd_burn.png',
|
|
||||||
COG: 'cog.png',
|
|
||||||
COG_ADD: 'cog_add.png',
|
|
||||||
COG_EDIT: 'cog_edit.png',
|
|
||||||
COG_DELETE: 'cog_delete.png',
|
|
||||||
COMPUTER_KEY: 'computer_key.png',
|
|
||||||
CROSS: 'cross.png',
|
|
||||||
DELETE: 'delete.png',
|
|
||||||
DRAW_AIRBRUSH: 'draw_airbrush.png',
|
|
||||||
DOCUMENT_SIGNATURE: 'document_signature.png',
|
|
||||||
ERROR: 'error.png',
|
|
||||||
GROUP: 'group.png',
|
|
||||||
GROUP_ADD: 'group_add.png',
|
|
||||||
GROUP_EDIT: 'group_edit.png',
|
|
||||||
GROUP_DELETE: 'group_delete.png',
|
|
||||||
GROUP_KEY: 'group_key.png',
|
|
||||||
GROUP_LINK: 'group_link.png',
|
|
||||||
INFORMATION: 'information.png',
|
|
||||||
KEY: 'key.png',
|
|
||||||
KEY_GO: 'key_go.png',
|
|
||||||
KEY_ADD: 'key_add.png',
|
|
||||||
KEY_DELETE: 'key_delete.png',
|
|
||||||
KEYBOARD: 'keyboard.png',
|
|
||||||
LAYOUT: 'layout.png',
|
|
||||||
LIGHTNING: 'lightning.png',
|
|
||||||
LINK: 'link.png',
|
|
||||||
LINK_ADD: 'link_add.png',
|
|
||||||
LINK_EDIT: 'link_edit.png',
|
|
||||||
LINK_DELETE: 'link_delete.png',
|
|
||||||
LOCK: 'lock.png',
|
|
||||||
LOCK_EDIT: 'lock_edit.png',
|
|
||||||
MAGNIFIER: 'magnifier.png',
|
|
||||||
MEDAL_GOLD: 'medal_gold_1.png',
|
|
||||||
MEDAL_GOLD_ADD: 'medal_gold_add.png',
|
|
||||||
MEDAL_GOLD_DELETE: 'medal_gold_delete.png',
|
|
||||||
PAGE: 'page.png',
|
|
||||||
PAGE_COPY: 'page_copy.png',
|
|
||||||
PAGE_GEAR:'page_gear.png',
|
|
||||||
PAGE_GO: 'page_go.png',
|
|
||||||
PAGE_DELETE: 'page_delete.png',
|
|
||||||
PAGE_EDIT: 'page_edit.png',
|
|
||||||
PAGE_LINK: 'page_link.png',
|
|
||||||
PAGE_REFRESH: 'page_refresh.png',
|
|
||||||
PAGE_SAVE: 'page_save.png',
|
|
||||||
PAGE_WHITE_COPY: 'page_white_copy.png',
|
|
||||||
PAGE_WHITE_CSHARP: 'page_white_csharp.png',
|
|
||||||
PAGE_WORLD: 'page_world.png',
|
|
||||||
PICTURES: 'pictures.png',
|
|
||||||
PILL: 'pill.png',
|
|
||||||
PLUGIN: 'plugin.png',
|
|
||||||
PRINTER: 'printer.png',
|
|
||||||
RAINBOW: 'rainbow.png',
|
|
||||||
ROUTING_TURNAROUND_RIGHT: 'routing_turnaround_right.png',
|
|
||||||
SCRIPT: 'script.png',
|
|
||||||
SERVER: 'server.png',
|
|
||||||
STORAGE: 'storage.png',
|
|
||||||
TABLE: 'table.png',
|
|
||||||
TABLE_ADD: 'table_add.png',
|
|
||||||
TABLE_EDIT: 'table_edit.png',
|
|
||||||
TABLE_DELETE: 'table_delete.png',
|
|
||||||
TABLE_REFRESH: 'table_refresh.png',
|
|
||||||
TABLE_RELATIONSHIP: 'table_relationship.png',
|
|
||||||
TAG_BLUE: 'tag_blue.png',
|
|
||||||
TAG_BLUE_ADD: 'tag_blue_add.png',
|
|
||||||
TAG_BLUE_DELETE: 'tag_blue_delete.png',
|
|
||||||
TAG_BLUE_EDIT: 'tag_blue_edit.png',
|
|
||||||
TEXT_DROPCAPS: 'text_dropcaps.png',
|
|
||||||
TEXT_STRIKETHROUGH: 'text_strikethrough.png',
|
|
||||||
TICK: 'tick.png',
|
|
||||||
TIME: 'time.png',
|
|
||||||
TIMELINE_MARKER: 'timeline_marker.png',
|
|
||||||
USER: 'user.png',
|
|
||||||
USER_ADD:'user_add.png',
|
|
||||||
USER_EDIT: 'user_edit.png',
|
|
||||||
USER_DELETE: 'user_delete.png',
|
|
||||||
VCARD: 'vcard.png',
|
|
||||||
VCARD_EDIT: 'vcard_edit.png',
|
|
||||||
WRENCH: 'wrench.png',
|
|
||||||
XHTML: 'xhtml.png',
|
|
||||||
XHTML_GO: 'xhtml_go.png',
|
|
||||||
XHTML_ADD: 'xhtml_add.png',
|
|
||||||
XHTML_DELETE: 'xhtml_delete.png',
|
|
||||||
ZOOM: 'zoom.png',
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
from __future__ import absolute_import
|
|
||||||
|
|
||||||
from .literals import DEFAULT_ICON_SET
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# #print '__file__', __file__
|
|
||||||
# ICON_SET = app.add_setting(
|
|
||||||
# name='ICON_SET',
|
|
||||||
# default=literals.DEFAULT_ICON_SET,
|
|
||||||
# )
|
|
||||||
|
|
||||||
ICON_SET = DEFAULT_ICON_SET
|
|
||||||
Reference in New Issue
Block a user