from django.contrib import admin
from models import *


class AttractionAdmin(admin.ModelAdmin):
    raw_id_fields = ("point", "place")
    list_display = (
        "name",
        "point",
    )
    list_filter = ("categories",)
    search_fields = (
        "name",
        "description",
    )
    filter_horizontal = (
        "features",
        "categories",
    )


admin.site.register(Attraction, AttractionAdmin)


class SectionAdmin(admin.ModelAdmin):
    list_display = ("title", "pub_date", "published", "featured", "featured_on")
    list_filter = (
        "published",
        "featured",
    )
    search_fields = (
        "title",
        "description",
    )
    filter_horizontal = (
        "businesses",
        "attractions",
    )


admin.site.register(Section, SectionAdmin)


class VisitorsEditionAdmin(admin.ModelAdmin):
    list_display = (
        "title",
        "published_on",
        "published",
    )
    list_filter = ("published",)
    search_fields = (
        "title",
        "brief_description",
    )
    filter_horizontal = (
        "stories",
        "galleries",
        "movies",
        "slideshows",
        "pdfdocuments",
        "guides",
        "sections",
        "photos",
    )


admin.site.register(VisitorsEdition, VisitorsEditionAdmin)

admin.site.register(Category)
admin.site.register(Feature)
