from django.contrib import admin
from django.utils.translation import ugettext, ugettext_lazy as _

from .models import Squad, SquadMember


class SquadMemberInline(admin.TabularInline):
    model = SquadMember


@admin.register(Squad)
class SquadAdmin(admin.ModelAdmin):
    list_display = ('name', 'tag')
    search_fields = ('name', 'tag')
    inlines = (SquadMemberInline,)


@admin.register(SquadMember)
class SquadMemberAdmin(admin.ModelAdmin):
    list_display = ('squad', 'member', 'date_joined', 'is_admin')
    list_filter = ('is_admin',)
