from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from .models import User, RegistrationDomainRule, RegistrationRestrictionSetting

@admin.register(User)
class UserAdmin(BaseUserAdmin):
    fieldsets = BaseUserAdmin.fieldsets + (
        ('Zusatzinfos', {'fields': ('display_name', 'skills', 'is_admin_user')}),
    )
    list_display = ['username', 'email', 'display_name', 'is_admin_user', 'is_staff', 'is_superuser']

@admin.register(RegistrationDomainRule)
class RegistrationDomainRuleAdmin(admin.ModelAdmin):
    list_display = ['domain', 'is_active', 'created_at']
    list_filter = ['is_active']
    search_fields = ['domain']

@admin.register(RegistrationRestrictionSetting)
class RegistrationRestrictionSettingAdmin(admin.ModelAdmin):
    list_display = ['is_restriction_enabled']
