summaryrefslogtreecommitdiffstats
path: root/agenda/admin.py
blob: 8763ab582673ee815dd3802171af39af0c45d55d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
from django.contrib import admin
from infopoint.agenda.models import *
from django.utils.translation import ugettext as _
class LocationInline(admin.TabularInline):
        model = Location

class TodoInline(admin.TabularInline):
        model = Todo

class EventInline(admin.TabularInline):
	model = Event
	extra = 1

class GroupInline(admin.TabularInline):
	model = Group

class AttendanceInline(admin.TabularInline):
	model = Attendance

class NetworkInline(admin.TabularInline):
	model = Network

class AttendanceAdmin(admin.ModelAdmin):
	list_display = ('event', 'person', 'attendance' )
admin.site.register(Attendance,AttendanceAdmin)

class LocationAdmin(admin.ModelAdmin):
	list_display = ('title', 'description', 'size' , 'picture')
	inlines = [EventInline]
admin.site.register(Location,LocationAdmin)

class TodoAdmin(admin.ModelAdmin):
	list_display = ('title', 'public','due_date','creator', 'done')
	date_hierarchy = 'due_date'

admin.site.register(Todo,TodoAdmin)

class WishAdmin(admin.ModelAdmin):
	list_display = ('title', 'public','due_date','creator', 'done')
	date_hierarchy = 'due_date'

admin.site.register(Wish,WishAdmin)

class EventAdmin(admin.ModelAdmin):
        list_display = ('title', 'confirmed','description', 'location', 'start_date', 'public')
	list_filter = ('location', 'public')
	save_as = True
admin.site.register(Event,EventAdmin)

class NetworkAdmin(admin.ModelAdmin):
	list_display = ('event', 'group')
admin.site.register(Network,NetworkAdmin)


class BillboardInline(admin.TabularInline):
        model = Billboard

class BillboardAdmin(admin.ModelAdmin):
	list_display = ('title', 'refresh','timespan','published')
	fieldsets = (
		(None, {
		'fields': (('title', 'refresh'), ('published'))
		}),
				('content', {
		'fields': (('groups', 'location'), ('timespan'))
		}),
		('css', {
		'classes': ('collapse','small'),
		'fields': (('csstitle', 'cssdescription'),('cssdate', 'csslocation'))
		}),
		('colors', {
		'fields': (('color1', 'color2'), ('color3', 'color4'))
		}),

	)

admin.site.register(Billboard,BillboardAdmin)



databrowse.site.register(Event)
databrowse.site.register(Location)
databrowse.site.register(Comment)
databrowse.site.register(Billboard)
databrowse.site.register(ContentType)
databrowse.site.register(Group)
databrowse.site.register(Network)
databrowse.site.register(Todo)
databrowse.site.register(Wish)
databrowse.site.register(User)