2024-04-23 00:22:18 +02:00
|
|
|
# Copyright (C) 2024 by Animath
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
from django.contrib import admin
|
|
|
|
|
|
|
|
from .models import Channel, Message
|
|
|
|
|
|
|
|
|
|
|
|
@admin.register(Channel)
|
|
|
|
class ChannelAdmin(admin.ModelAdmin):
|
2024-05-26 22:08:34 +02:00
|
|
|
"""
|
|
|
|
Modèle d'administration des canaux de chat.
|
|
|
|
"""
|
2024-04-28 13:50:04 +02:00
|
|
|
list_display = ('name', 'category', 'read_access', 'write_access', 'tournament', 'private',)
|
|
|
|
list_filter = ('category', 'read_access', 'write_access', 'tournament', 'private',)
|
2024-04-23 00:22:18 +02:00
|
|
|
search_fields = ('name', 'tournament__name', 'team__name', 'team__trigram',)
|
|
|
|
autocomplete_fields = ('tournament', 'pool', 'team', 'invited', )
|
|
|
|
|
|
|
|
|
|
|
|
@admin.register(Message)
|
|
|
|
class MessageAdmin(admin.ModelAdmin):
|
2024-05-26 22:08:34 +02:00
|
|
|
"""
|
|
|
|
Modèle d'administration des messages de chat.
|
|
|
|
"""
|
2024-04-23 00:22:18 +02:00
|
|
|
list_display = ('channel', 'author', 'created_at', 'updated_at', 'content',)
|
|
|
|
list_filter = ('channel', 'created_at', 'updated_at',)
|
|
|
|
search_fields = ('author__username', 'author__first_name', 'author__last_name', 'content',)
|
2024-04-28 23:25:15 +02:00
|
|
|
autocomplete_fields = ('channel', 'author', 'users_read',)
|