# Path: lfc/utils/registration.py
# def get_info(obj_or_type):
# def get_allowed_subtypes(obj_or_type=None):
# def register_sub_type(klass, name):
# def register_content_type(klass, name, sub_types=[], templates=[], default_template=None, global_addable=True, workflow=None):
# def unregister_content_type(name):
# def register_template(name, path, children_columns=0, images_columns=0):
# def unregister_template(name):
# def get_default_template(obj_or_type):
# def get_templates(obj_or_type):


from django import template
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import ObjectDoesNotExist
from django.forms import ChoiceField
from django.forms import FileField
from django.forms import CharField
from django.forms import Textarea
from django.forms import BooleanField
from django.http import Http404
from django.template import Node, TemplateSyntaxError
from django.template.loader import render_to_string
from django.utils import translation
from django.utils.translation import ugettext_lazy as _
from lfc.utils import registration
import lfc.utils
# django import

# lfc imports

register = template.Library()


@register.inclusion_tag('lfc/manage/templates.html', takes_context=True)
def templates(context):
    """Displays a selection box to select a available template for context
    on the fly.
    """
    lfc_context = context.get("lfc_context")
    if lfc_context is None:
        return {
            "display": False,
        }

    templates = registration.get_templates(lfc_context)
    if templates:
        display = True

# Path: lfc/utils/registration.py
# def get_info(obj_or_type):
# def get_allowed_subtypes(obj_or_type=None):
# def register_sub_type(klass, name):
# def register_content_type(klass, name, sub_types=[], templates=[], default_template=None, global_addable=True, workflow=None):
# def unregister_content_type(name):
# def register_template(name, path, children_columns=0, images_columns=0):
# def unregister_template(name):
# def get_default_template(obj_or_type):
# def get_templates(obj_or_type):


# Path: lfc/templatetags/lfc_tags.py
from django import template
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import ObjectDoesNotExist
from django.forms import ChoiceField
from django.forms import FileField
from django.forms import CharField
from django.forms import Textarea
from django.forms import BooleanField
from django.http import Http404
from django.template import Node, TemplateSyntaxError
from django.template.loader import render_to_string
from django.utils import translation
from django.utils.translation import ugettext_lazy as _
from lfc.utils import registration
import lfc.utils

# django import

# lfc imports

register = template.Library()


@register.inclusion_tag('lfc/manage/templates.html', takes_context=True)
def templates(context):
    """Displays a selection box to select a available template for context
    on the fly.
    """
    lfc_context = context.get("lfc_context")
    if lfc_context is None:
        return {
            "display": False,
        }

    templates = registration.get_templates(lfc_context)
    if templates:
        display = True

        template = lfc_context.template or registration.get_default_template(lfc_context)