diff --git a/club/admin.py b/club/admin.py index 10de0e67..d72a66b2 100644 --- a/club/admin.py +++ b/club/admin.py @@ -21,11 +21,24 @@ # Place - Suite 330, Boston, MA 02111-1307, USA. # # - +from ajax_select import make_ajax_form from django.contrib import admin from club.models import Club, Membership -admin.site.register(Club) -admin.site.register(Membership) +@admin.register(Club) +class ClubAdmin(admin.ModelAdmin): + list_display = ("name", "unix_name", "parent", "is_active") + + +@admin.register(Membership) +class MembershipAdmin(admin.ModelAdmin): + list_display = ("user", "club", "role", "start_date", "end_date") + search_fields = ( + "user__username", + "user__first_name", + "user__last_name", + "club__name", + ) + form = make_ajax_form(Membership, {"user": "users"}) diff --git a/com/admin.py b/com/admin.py index 43ca4e1e..f7ffbeb3 100644 --- a/com/admin.py +++ b/com/admin.py @@ -21,23 +21,37 @@ # Place - Suite 330, Boston, MA 02111-1307, USA. # # - +from ajax_select import make_ajax_form from django.contrib import admin from haystack.admin import SearchModelAdmin from com.models import * +@admin.register(News) class NewsAdmin(SearchModelAdmin): - search_fields = ["title", "summary", "content"] + list_display = ("title", "type", "club", "author") + search_fields = ("title", "summary", "content") + form = make_ajax_form( + News, + { + "author": "users", + "moderator": "users", + }, + ) +@admin.register(Poster) +class PosterAdmin(SearchModelAdmin): + list_display = ("name", "club", "date_begin", "date_end", "moderator") + form = make_ajax_form(Poster, {"moderator": "users"}) + + +@admin.register(Weekmail) class WeekmailAdmin(SearchModelAdmin): - search_fields = ["title"] + list_display = ("title", "sent") + search_fields = ("title",) admin.site.register(Sith) -admin.site.register(News, NewsAdmin) -admin.site.register(Weekmail, WeekmailAdmin) admin.site.register(Screen) -admin.site.register(Poster) diff --git a/com/templates/com/screen_slideshow.jinja b/com/templates/com/screen_slideshow.jinja index 14ca1b46..da429b6b 100644 --- a/com/templates/com/screen_slideshow.jinja +++ b/com/templates/com/screen_slideshow.jinja @@ -24,7 +24,7 @@
- +