# Path: adminlte_full/adminlte.py
# class ConfigWrapper(object):
# class Manager(AbstractManager):
#     def get(self, name, default=''):
#     def create_url(self, endpoint, *endpoint_args, **endpoint_kwargs):
#     def get_flash_messages(self):
#     def static(self, filename):
# 
# Path: adminlte_full/models.py
# class MenuModel(models.Model, MenuMixin):
#     title = models.CharField(max_length=500)
#     program_name = models.CharField(max_length=255, unique=True)
# 
#     @property
#     def items(self):
#         return self.menuitemmodel_set.select_related('parent')
# 
#     def __str__(self):
#         return f'{self.title} [{self.program_name}]'


from datetime import datetime, timedelta
from django.contrib import auth, messages
from django.shortcuts import render
from django import forms
from django.http import JsonResponse
from django.urls import reverse_lazy
from adminlte_base import MenuLoader, MenuItem, Message, Notification, Task, Dropdown, ThemeColor
from adminlte_full.adminlte import manager
from adminlte_full.models import MenuModel
@manager.menu_loader
class MyMenuLoader(MenuLoader):
    def __call__(self, program_name):
        return MenuModel.objects.get(program_name=program_name)

    # def navbar_menu(self):
    #     return self._create(
    #         self('navbar_menu'),
    #         active_path=self.context['request'].path
    #     )
    #
    # def sidebar_menu(self):
    #     menu = self._create(self('main_menu'), active_path=self.context['request'].path)
    #     menu.get_item(1).add_badge('new', ThemeColor.DANGER)
    #     menu.add_item(
    #         MenuItem('not_db', 'MosgInfo', url='https://mosg.info', icon='far fa-clock')
    #     )
    #     return menu


# @manager.home_page_getter
# def home_page(context):
#     user = context['user']
#
#     if user.username == 'kyzima-spb':
#         return '/blank', 'Dashboard'
#
#     return '/blank', 'Home'



# Path: adminlte_full/adminlte.py
# class ConfigWrapper(object):
# class Manager(AbstractManager):
#     def get(self, name, default=''):
#     def create_url(self, endpoint, *endpoint_args, **endpoint_kwargs):
#     def get_flash_messages(self):
#     def static(self, filename):
# 
# Path: adminlte_full/models.py
# class MenuModel(models.Model, MenuMixin):
#     title = models.CharField(max_length=500)
#     program_name = models.CharField(max_length=255, unique=True)
# 
#     @property
#     def items(self):
#         return self.menuitemmodel_set.select_related('parent')
# 
#     def __str__(self):
#         return f'{self.title} [{self.program_name}]'


# Path: example/demo/views.py
from datetime import datetime, timedelta
from django.contrib import auth, messages
from django.shortcuts import render
from django import forms
from django.http import JsonResponse
from django.urls import reverse_lazy
from adminlte_base import MenuLoader, MenuItem, Message, Notification, Task, Dropdown, ThemeColor
from adminlte_full.adminlte import manager
from adminlte_full.models import MenuModel

@manager.menu_loader
class MyMenuLoader(MenuLoader):
    def __call__(self, program_name):
        return MenuModel.objects.get(program_name=program_name)

    # def navbar_menu(self):
    #     return self._create(
    #         self('navbar_menu'),
    #         active_path=self.context['request'].path
    #     )
    #
    # def sidebar_menu(self):
    #     menu = self._create(self('main_menu'), active_path=self.context['request'].path)
    #     menu.get_item(1).add_badge('new', ThemeColor.DANGER)
    #     menu.add_item(
    #         MenuItem('not_db', 'MosgInfo', url='https://mosg.info', icon='far fa-clock')
    #     )
    #     return menu


# @manager.home_page_getter
# def home_page(context):
#     user = context['user']
#
#     if user.username == 'kyzima-spb':
#         return '/blank', 'Dashboard'
#
#     return '/blank', 'Home'



@manager.messages_loader