"""
Admin classes for content-related models like external links and plans
"""

from django.contrib import admin

from ..models import ExternalLink, ExternalLinkOffering, Plan


class PlanInline(admin.StackedInline):
    """Inline admin for Plan model"""

    model = Plan
    extra = 1
    fieldsets = (
        (None, {"fields": ("name", "description", "pricing", "plan_description")}),
    )


class ExternalLinkOfferingInline(admin.TabularInline):
    """Inline admin for ExternalLinkOffering model"""

    model = ExternalLinkOffering
    extra = 1
    fields = ("description", "url", "order")
    ordering = ("order", "description")


class ExternalLinkInline(admin.TabularInline):
    """Inline admin for ExternalLink model"""

    model = ExternalLink
    extra = 1
    fields = ("description", "url", "order")
    ordering = ("order", "description")
