X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/ae60b2a3949e96357477cc04f90fd0873cee8a92..149903ae7da0968ef3b1b0dc0f329afeaa5a7007:/src/funding/admin.py?ds=inline

diff --git a/src/funding/admin.py b/src/funding/admin.py
index 5f552c45d..3e981d8a5 100644
--- a/src/funding/admin.py
+++ b/src/funding/admin.py
@@ -1,20 +1,22 @@
-# -*- coding: utf-8 -*-
 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
 #
 from django.utils.translation import ugettext_lazy as _
 from django.contrib import admin
+from modeltranslation.admin import TranslationAdmin
+from fnpdjango.actions import export_as_csv_action
 from .models import Offer, Perk, Funding, Spent
 
 
-class OfferAdmin(admin.ModelAdmin):
+class OfferAdmin(TranslationAdmin):
     model = Offer
     list_display = ['title', 'author', 'target', 'sum', 'is_win', 'start', 'end']
     search_fields = ['title', 'author']
     readonly_fields = ('cover_img_tag',)
+    autocomplete_fields = ['book']
 
 
-class PerkAdmin(admin.ModelAdmin):
+class PerkAdmin(TranslationAdmin):
     model = Perk
     search_fields = ['name', 'long_name']
     list_display = ['name', 'long_name', 'price', 'end_date', 'offer']
@@ -60,6 +62,7 @@ class FundingAdmin(admin.ModelAdmin):
     list_display = ['payed_at', 'offer', 'amount', 'name', 'email', 'perk_names']
     search_fields = ['name', 'email', 'offer__title', 'offer__author']
     list_filter = [PayedFilter, 'offer', PerksFilter]
+    actions = [export_as_csv_action()]
 
 
 class SpentAdmin(admin.ModelAdmin):