You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.1 KiB
30 lines
1.1 KiB
from django.contrib import admin
|
|
from django.utils.translation import gettext_lazy as _
|
|
from unfold.admin import ModelAdmin
|
|
from unfold.decorators import display
|
|
|
|
from .models import AppVersion, SupportMessage
|
|
from utils.admin import project_admin_site
|
|
|
|
|
|
@admin.register(AppVersion)
|
|
class AppVersionAdmin(ModelAdmin):
|
|
list_display = ['version', 'app_type', 'is_active', 'downloads_count', 'created_at']
|
|
list_display_links = ['version', 'app_type']
|
|
list_filter = ['app_type', 'is_active']
|
|
search_fields = ['version', 'description']
|
|
ordering = ['-created_at']
|
|
|
|
|
|
@admin.register(SupportMessage)
|
|
class SupportMessageAdmin(ModelAdmin):
|
|
list_display = ['sender_name', 'sender_email', 'subject', 'is_resolved', 'created_at']
|
|
list_display_links = ['sender_name', 'sender_email', 'subject']
|
|
list_filter = ['is_resolved', 'created_at']
|
|
search_fields = ['sender_name', 'sender_email', 'subject', 'message']
|
|
ordering = ['-created_at']
|
|
|
|
|
|
# Register to Unfold custom admin site
|
|
project_admin_site.register(AppVersion, AppVersionAdmin)
|
|
project_admin_site.register(SupportMessage, SupportMessageAdmin)
|