from django.contrib import admin

from .models import GislabUser, Project_registry


class UserAdmin(admin.ModelAdmin):
    list_display = ('username', 'first_name', 'last_name', 'email')
    search_fields = ['username', 'first_name', 'last_name']


class ProjectAdmin(admin.ModelAdmin):
    fieldsets = [
        (None,               {'fields': ['project']}),
        ('Date information', {'fields': ['publish_date']}),
    ]

    list_display = ('project', 'gislab_user', 'publish_date')
    list_filter = ['publish_date']
    search_fields = ['project', 'gislab_user']

admin.site.register(GislabUser, UserAdmin)
admin.site.register(Project_registry, ProjectAdmin)
