from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import User
from markdownx.admin import MarkdownxModelAdmin
from . import models


class ProfileInline(admin.StackedInline):
    model = models.Profile
    can_delete = False
    verbose_name_plural = 'profile'


class UserAdmin(BaseUserAdmin):
    inlines = (ProfileInline,)


# Register your models here.
admin.site.unregister(User)
admin.site.register(User, UserAdmin)
admin.site.register(models.FrontItem, MarkdownxModelAdmin)
admin.site.register(models.NewsItem, MarkdownxModelAdmin)
admin.site.register(models.ContentSnippet, MarkdownxModelAdmin)
