from django.contrib import admin
from .models import AboutProfile, Experience, Education, Philosophy

@admin.register(AboutProfile)
class AboutProfileAdmin(admin.ModelAdmin):
    # Singleton protection
    def has_add_permission(self, request):
        return not AboutProfile.objects.exists()

@admin.register(Experience)
class ExperienceAdmin(admin.ModelAdmin):
    list_display = ('job_title', 'company', 'start_date', 'is_current')
    list_filter = ('is_current',)
    search_fields = ('job_title', 'company')

@admin.register(Education)
class EducationAdmin(admin.ModelAdmin):
    list_display = ('degree', 'institution', 'year_start')

@admin.register(Philosophy)
class PhilosophyAdmin(admin.ModelAdmin):
    list_display = ('title', 'order', 'icon_class')
    list_editable = ('order',)