from django.contrib import admin
from ldt.management import test_cms

"""
site admin pour cms page
"""
if test_cms():
    class AdminSite(admin.AdminSite):
        index_template = 'admin/page_index.html'
        login_template = 'admin/page_login.html'
        app_index_template = 'admin/page_app_index.html'    
        
    admin_site = AdminSite()

    from cms.models import Page
    from cms.admin import pageadmin

    class CmsPageAdmin(pageadmin.PageAdmin):
        change_list_template = "admin/cms_change_list.html"
        change_form_template = "admin/cms_change_form.html"

    admin_site.register(Page, CmsPageAdmin)

    from cms.plugins.snippet.models import Snippet
    from cms.plugins.snippet.admin import SnippetAdmin

    class CmsSnippetAdmin(SnippetAdmin):
          change_form_template = "admin/page_change_form.html"
          change_list_template = "admin/page_change_list.html"
    admin_site.register(Snippet, CmsSnippetAdmin)