2010-03-03 14:28:00 +00:00
|
|
|
from django.contrib import admin
|
|
|
|
from models import *
|
2011-12-01 21:11:11 +00:00
|
|
|
from markitup.widgets import MarkItUpWidget
|
2010-03-03 14:28:00 +00:00
|
|
|
|
|
|
|
class AudioInline(admin.StackedInline):
|
|
|
|
model = Audio
|
|
|
|
extra = 2
|
|
|
|
|
|
|
|
class ImageInline(admin.StackedInline):
|
|
|
|
model = Image
|
|
|
|
extra = 3
|
|
|
|
|
2010-05-14 02:33:11 +00:00
|
|
|
class PadmaVideoInline(admin.StackedInline):
|
|
|
|
model = PadmaVideo
|
|
|
|
extra = 3
|
|
|
|
|
2010-03-03 14:28:00 +00:00
|
|
|
class DocumentInline(admin.StackedInline):
|
|
|
|
model = Document
|
|
|
|
extra = 2
|
|
|
|
|
2010-05-14 02:33:11 +00:00
|
|
|
class PadmaVideoAdmin(admin.ModelAdmin):
|
|
|
|
pass
|
|
|
|
|
2010-03-03 14:28:00 +00:00
|
|
|
class TalkAdmin(admin.ModelAdmin):
|
2010-05-14 02:33:11 +00:00
|
|
|
inlines = [AudioInline, ImageInline, DocumentInline, PadmaVideoInline]
|
2010-03-03 14:28:00 +00:00
|
|
|
save_on_top = True
|
|
|
|
list_display = ('__unicode__', 'presenter', 'session',)
|
|
|
|
list_filter = ['session']
|
|
|
|
search_fields = ('title', 'intro', 'presenter',)
|
2011-12-01 21:11:11 +00:00
|
|
|
formfield_overrides = {models.TextField: {'widget': MarkItUpWidget}}
|
2010-03-03 14:28:00 +00:00
|
|
|
#hide meeting field
|
|
|
|
|
|
|
|
class MeetingDayInline(admin.StackedInline):
|
|
|
|
model = MeetingDay
|
|
|
|
extra = 3
|
|
|
|
|
|
|
|
class ParticipantInline(admin.StackedInline):
|
|
|
|
model = Participant
|
|
|
|
extra = 3
|
|
|
|
|
|
|
|
class MeetingAdmin(admin.ModelAdmin):
|
2011-12-01 21:11:11 +00:00
|
|
|
formfield_overrides = {models.TextField: {'widget': MarkItUpWidget}}
|
2010-03-03 14:28:00 +00:00
|
|
|
inlines = [MeetingDayInline, ImageInline, DocumentInline, ParticipantInline]
|
|
|
|
prepopulated_fields = {"slug": ("title",)}
|
|
|
|
save_on_top = True
|
|
|
|
|
|
|
|
class ProjectAdmin(admin.ModelAdmin):
|
2011-12-01 21:11:11 +00:00
|
|
|
formfield_overrides = {models.TextField: {'widget': MarkItUpWidget}}
|
2010-03-03 14:28:00 +00:00
|
|
|
prepopulated_fields = {"slug": ("title",)}
|
|
|
|
save_on_top = True
|
|
|
|
|
|
|
|
class SessionAdmin(admin.ModelAdmin):
|
|
|
|
search_fields = ('title', 'intro',)
|
|
|
|
list_filter = ['day']
|
|
|
|
list_display = ('__unicode__',)
|
2011-12-01 21:11:11 +00:00
|
|
|
formfield_overrides = {models.TextField: {'widget': MarkItUpWidget}}
|
2010-03-03 14:28:00 +00:00
|
|
|
|
|
|
|
class ParticipantAdmin(admin.ModelAdmin):
|
|
|
|
search_fields = ('title', 'short_bio',)
|
|
|
|
list_display = ('name', 'title', 'meeting',)
|
|
|
|
list_filter = ['meeting']
|
2011-12-01 21:16:07 +00:00
|
|
|
formfield_overrides = {models.TextField: {'widget': MarkItUpWidget}}
|
2010-03-03 14:28:00 +00:00
|
|
|
|
|
|
|
class CommentAdmin(admin.ModelAdmin):
|
|
|
|
list_display = ('__unicode__', 'is_displayed',)
|
|
|
|
list_editable = ('is_displayed',)
|
|
|
|
list_filter = ['meeting']
|
|
|
|
|
|
|
|
class SignupAdmin(admin.ModelAdmin):
|
|
|
|
search_fields = ('email',)
|
|
|
|
|
|
|
|
class ImageAdmin(admin.ModelAdmin):
|
|
|
|
search_fields = ('title', 'intro',)
|
|
|
|
list_filter = ['meeting', 'talk']
|
|
|
|
|
|
|
|
class AudioAdmin(admin.ModelAdmin):
|
|
|
|
search_fields = ('title', 'intro',)
|
|
|
|
list_filter = ['meeting', 'talk']
|
|
|
|
|
|
|
|
class VideoAdmin(admin.ModelAdmin):
|
|
|
|
search_fields = ('title', 'intro',)
|
|
|
|
list_filter = ['meeting', 'talk']
|
|
|
|
|
2011-11-23 16:08:20 +00:00
|
|
|
class DocumentAdmin(admin.ModelAdmin):
|
|
|
|
list_display = ('__unicode__', 'subject',)
|
|
|
|
list_editable = ('subject',)
|
2011-12-13 20:49:15 +00:00
|
|
|
formfield_overrides = {models.TextField: {'widget': MarkItUpWidget}}
|
2011-11-23 16:08:20 +00:00
|
|
|
|
2010-03-03 14:28:00 +00:00
|
|
|
admin.site.register(Comment, CommentAdmin)
|
|
|
|
admin.site.register(Meeting, MeetingAdmin)
|
|
|
|
admin.site.register(Audio, AudioAdmin)
|
|
|
|
admin.site.register(Video, VideoAdmin)
|
2010-05-14 02:33:11 +00:00
|
|
|
admin.site.register(Image, ImageAdmin)
|
|
|
|
admin.site.register(PadmaVideo, PadmaVideoAdmin)
|
2011-11-23 16:08:20 +00:00
|
|
|
admin.site.register(Document, DocumentAdmin)
|
2011-11-23 16:04:21 +00:00
|
|
|
admin.site.register(DocumentSubject)
|
2010-03-03 14:28:00 +00:00
|
|
|
admin.site.register(Project, ProjectAdmin)
|
|
|
|
#admin.site.register(MeetingDay)
|
|
|
|
admin.site.register(Session, SessionAdmin)
|
|
|
|
admin.site.register(Talk, TalkAdmin)
|
|
|
|
admin.site.register(Participant, ParticipantAdmin)
|
|
|
|
admin.site.register(Signup, SignupAdmin)
|
|
|
|
admin.site.register(CommentCaptcha)
|