def register_desktop_menu(): metarole = app_ui.GENERIC_USER users_pack = ControllerCache.find_pack(UsersPack) DesktopLoader.add( metarole, DesktopLoader.TOOLBOX, DesktopShortcut(pack=users_pack.logout_action, name=u'Выход', index=256))
def register_desktop_menu(): generic_metarole = metaroles.get_metarole(GENERIC_USER) reports_root = DesktopShortcut(name=ReportListActionPack.title, pack=find_pack(ReportListActionPack), index=20) DesktopLoader.add( metarole=generic_metarole, place=DesktopLoader.TOPTOOLBAR, element=reports_root, )
def register_desktop_menu(): generic_metarole = metaroles.get_metarole(GENERIC_USER) designer_root = DesktopShortcut(name=CreadocDesignerActionPack.title, pack=find_pack(CreadocDesignerActionPack), index=10) DesktopLoader.add( metarole=generic_metarole, place=DesktopLoader.TOPTOOLBAR, element=designer_root, )
def register_desktop_menu(): metarole = app_ui.GENERIC_USER users_pack = ControllerCache.find_pack(UsersPack) DesktopLoader.add( metarole, DesktopLoader.TOOLBOX, DesktopShortcut( pack=users_pack.logout_action, name=u'Выход', index=256 ) )
def _get_desktop(cls, request): """ Формирует элементы Рабочего Стола :param request: request :type request: Request """ desktop_model = DesktopModel(request, cls.filter_factory) ControllerCache.populate() DesktopLoader._success = False if hasattr(request, 'user'): DesktopLoader.populate(request.user, desktop=desktop_model) else: DesktopLoader.populate_desktop(desktop=desktop_model) return { 'desktopItems': list(desktop_model.desktop.subitems), 'menuItems': list(desktop_model.start_menu.subitems), 'topToolbarItems': list(desktop_model.toptoolbar.subitems), 'toolboxItems': list(desktop_model.toolbox.subitems), }