# -*- coding: utf-8 -*-

from django.contrib import admin

from group.models import (GroupInfo, GroupPhotoInfo, GroupPhotoOrderInfo, GroupUserInfo, PhotoCommentInfo,
                          PhotoThumbUpInfo)


class GroupInfoAdmin(admin.ModelAdmin):
    list_display = ('group_id', 'admin_id', 'group_name', 'group_desc', 'group_from', 'session_id', 'group_lock', 'status', 'created_at', 'updated_at')
    list_filter = ('group_from', 'group_lock', 'status')


class GroupUserInfoAdmin(admin.ModelAdmin):
    list_display = ('group_id', 'user_id', 'current_id', 'nickname', 'admin', 'user_status', 'passed_at', 'refused_at', 'status', 'created_at', 'updated_at')
    list_filter = ('user_status', 'status')


class GroupPhotoInfoAdmin(admin.ModelAdmin):
    list_display = ('group_id', 'user_id', 'nickname', 'photo_path', 'photo_thumbnail_path', 'photo_thumbnail2_path', 'status', 'created_at', 'updated_at')
    list_filter = ('photo_from', 'status')


class GroupPhotoOrderInfoAdmin(admin.ModelAdmin):
    list_display = ('group_id', 'user_id', 'photo_id', 'm_photo_path', 'l_photo_path', 'r_photo_path', 'status', 'created_at', 'updated_at')


class PhotoCommentInfoAdmin(admin.ModelAdmin):
    list_display = ('photo_id', 'user_id', 'nickname', 'to_uid', 'comment', 'status', 'created_at', 'updated_at')
    list_filter = ('status', )


class PhotoThumbUpInfoAdmin(admin.ModelAdmin):
    list_display = ('photo_id', 'user_id', 'nickname', 'thumbup', 'status', 'created_at', 'updated_at')
    list_filter = ('thumbup', 'status')


admin.site.register(GroupInfo, GroupInfoAdmin)
admin.site.register(GroupUserInfo, GroupUserInfoAdmin)
admin.site.register(GroupPhotoInfo, GroupPhotoInfoAdmin)
admin.site.register(GroupPhotoOrderInfo, GroupPhotoOrderInfoAdmin)
admin.site.register(PhotoCommentInfo, PhotoCommentInfoAdmin)
admin.site.register(PhotoThumbUpInfo, PhotoThumbUpInfoAdmin)
