# Path: ndc/models.py
# class Tag(models.Model):
#     name = models.CharField(max_length=100)
#     uid = models.CharField(max_length=100, blank=True, null=True)
#     image = models.ImageField(upload_to='tag', blank=True, null=True)
#     is_category = models.BooleanField(default=False)
# 
#     def html(self):
#         return mark_safe('<div id=\'%s\' class=\'tag tag-%s tag-icon-%s\'>%s</div>' % (self.uid, self.uid, self.uid, self.name))
# 
#     def __unicode__(self):
#         return self.name


from django.core.urlresolvers import resolve
from collections import OrderedDict
from ndc.models import Tag


def menus(request):
    menus = OrderedDict([
        ('timetable', {'title': 'Timetable', 'icon': 'calendar', 'color': 'blue'}),
        ('sessions', {'title': 'Session', 'icon': 'video', 'color': 'green'}),
        ('speakers', {'title': 'Speaker', 'icon': 'man', 'color': 'yellow'}),
        ('companies', {'title': 'Company', 'icon': 'cmd', 'color': 'pink'}),
    ])

    try:
        name = resolve(request.path).url_name
        if name in menus:
            menus[name]['active'] = True
    except:
        pass

    return {
        'menus': menus,
    }


def tags(request):
    return {

# Path: ndc/models.py
# class Tag(models.Model):
#     name = models.CharField(max_length=100)
#     uid = models.CharField(max_length=100, blank=True, null=True)
#     image = models.ImageField(upload_to='tag', blank=True, null=True)
#     is_category = models.BooleanField(default=False)
# 
#     def html(self):
#         return mark_safe('<div id=\'%s\' class=\'tag tag-%s tag-icon-%s\'>%s</div>' % (self.uid, self.uid, self.uid, self.name))
# 
#     def __unicode__(self):
#         return self.name


# Path: ndc/context_processors.py
from django.core.urlresolvers import resolve
from collections import OrderedDict
from ndc.models import Tag



def menus(request):
    menus = OrderedDict([
        ('timetable', {'title': 'Timetable', 'icon': 'calendar', 'color': 'blue'}),
        ('sessions', {'title': 'Session', 'icon': 'video', 'color': 'green'}),
        ('speakers', {'title': 'Speaker', 'icon': 'man', 'color': 'yellow'}),
        ('companies', {'title': 'Company', 'icon': 'cmd', 'color': 'pink'}),
    ])

    try:
        name = resolve(request.path).url_name
        if name in menus:
            menus[name]['active'] = True
    except:
        pass

    return {
        'menus': menus,
    }


def tags(request):
    return {

        'tags': Tag.objects.all(),