2017-10-22 18:04:59 -04:00
|
|
|
from django.contrib import admin
|
2017-10-22 20:53:51 -04:00
|
|
|
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
|
2017-10-22 21:59:10 -04:00
|
|
|
from .models import Key, Profile, Site, User
|
2017-10-22 21:33:24 -04:00
|
|
|
|
|
|
|
|
2017-10-29 07:44:11 -04:00
|
|
|
class SiteAdmin(admin.ModelAdmin):
|
2017-10-30 22:46:52 -04:00
|
|
|
list_display = ('name', 'icon', 'domain', 'url_template')
|
2017-10-29 07:44:11 -04:00
|
|
|
|
|
|
|
|
2017-10-22 21:33:24 -04:00
|
|
|
class KeyInline(admin.TabularInline):
|
|
|
|
model = Key
|
|
|
|
extra = 1
|
2017-10-22 18:04:59 -04:00
|
|
|
|
|
|
|
|
2017-10-22 21:59:10 -04:00
|
|
|
class ProfileInline(admin.TabularInline):
|
|
|
|
model = Profile
|
|
|
|
extra = 1
|
|
|
|
|
|
|
|
|
2017-10-22 20:53:51 -04:00
|
|
|
class UserAdmin(BaseUserAdmin):
|
|
|
|
fieldsets = BaseUserAdmin.fieldsets + (
|
2017-11-06 06:02:12 -05:00
|
|
|
('Profile', {'fields': ('avatar', 'xmpp', 'note')}),
|
2017-10-22 20:53:51 -04:00
|
|
|
)
|
2017-10-22 21:33:24 -04:00
|
|
|
inlines = (
|
|
|
|
KeyInline,
|
2017-10-22 21:59:10 -04:00
|
|
|
ProfileInline,
|
2017-10-22 21:33:24 -04:00
|
|
|
)
|
2017-10-22 20:53:51 -04:00
|
|
|
|
|
|
|
|
2017-10-29 07:44:11 -04:00
|
|
|
admin.site.register(Site, SiteAdmin)
|
2017-10-22 18:04:59 -04:00
|
|
|
admin.site.register(User, UserAdmin)
|