# 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
#     if user.username == 'kyzima-spb':
#         return '/blank', 'Dashboard'
#
#     return '/blank', 'Home'


@manager.messages_loader
def load_messages(context):
    now = datetime.now()
    sender = context['user']

    messages = Dropdown('#', 15)
    messages.add(Message(sender, 'Тестовое сообщение 1', '#', sent_at=now - timedelta(seconds=16)),)
    messages.add(Message(sender, 'Тестовое сообщение 2', '#', sent_at=now - timedelta(weeks=2)),)
    messages.add(Message(sender, 'Тестовое сообщение 3', '#'))

    return messages


@manager.notifications_loader
def load_notifications(context):
    notifications = Dropdown('#', 10)
    notifications.add(Notification(
        '4 new messages',
        datetime.now() - timedelta(seconds=16),
        icon='fas fa-envelope',
        color=ThemeColor.SUCCESS
    ))
    notifications.add(Notification(
        '8 friend requests',

# 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

#     if user.username == 'kyzima-spb':
#         return '/blank', 'Dashboard'
#
#     return '/blank', 'Home'


@manager.messages_loader
def load_messages(context):
    now = datetime.now()
    sender = context['user']

    messages = Dropdown('#', 15)
    messages.add(Message(sender, 'Тестовое сообщение 1', '#', sent_at=now - timedelta(seconds=16)),)
    messages.add(Message(sender, 'Тестовое сообщение 2', '#', sent_at=now - timedelta(weeks=2)),)
    messages.add(Message(sender, 'Тестовое сообщение 3', '#'))

    return messages


@manager.notifications_loader
def load_notifications(context):
    notifications = Dropdown('#', 10)
    notifications.add(Notification(
        '4 new messages',
        datetime.now() - timedelta(seconds=16),
        icon='fas fa-envelope',
        color=ThemeColor.SUCCESS
    ))
    notifications.add(Notification(
        '8 friend requests',

        datetime.now() - timedelta(hours=3),