summaryrefslogtreecommitdiffstats
path: root/agenda/admin.py
diff options
context:
space:
mode:
Diffstat (limited to 'agenda/admin.py')
-rw-r--r--agenda/admin.py109
1 files changed, 109 insertions, 0 deletions
diff --git a/agenda/admin.py b/agenda/admin.py
new file mode 100644
index 0000000..df5cd5a
--- /dev/null
+++ b/agenda/admin.py
@@ -0,0 +1,109 @@
+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 Billboard(models.Model):
+ title = models.CharField(max_length=100)
+ groups = models.ManyToManyField(Group, null=True,blank=True,related_name='cartel')
+ refresh = models.IntegerField(help_text=_('In seconds'),max_length=3)
+ published = models.BooleanField(null=True,blank=True)
+ location = models.ManyToManyField(Location, null=True,blank=True, related_name='cartel')
+ timespan = models.CharField(max_length=1, choices=TIMESPAN_CHOICES)
+ color1 = models.CharField(max_length=6)
+ color2 = models.CharField(max_length=6)
+ color3 = models.CharField(max_length=6)
+ color4 = models.CharField(max_length=6)
+ csstitle = models.TextField(max_length=500, help_text="decide the style of the title here",blank=True,default="padding: 30px;font-family: verdana, arial, sans-serif;text-transform: capitalize;BORder: 10px dotted;")
+ cssdate = models.TextField(max_length=500, help_text="decide the style of the date here",blank=True,default="padding: 30px;")
+ csslocation = models.TextField(max_length=500, help_text="decide the style of the location here",blank=True,default="padding: 30px;text-transform: capitalize;")
+ cssdescription = models.TextField(max_length=500, help_text="decide the style of the description here",blank=True)
+
+ def __unicode__(self):
+ return self.title
+
+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)
+