fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Crisis banners
[wolnelektury.git]
/
src
/
club
/
admin.py
diff --git
a/src/club/admin.py
b/src/club/admin.py
index
2ba842a
..
fc715e2
100644
(file)
--- a/
src/club/admin.py
+++ b/
src/club/admin.py
@@
-1,5
+1,5
@@
-# This file is part of Wolne
l
ektury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja
Nowoczesna Polska
. See NOTICE for more information.
+# This file is part of Wolne
L
ektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja
Wolne Lektury
. See NOTICE for more information.
#
import json
from django.contrib import admin
#
import json
from django.contrib import admin
@@
-8,7
+8,6
@@
from django.db.models import Q
from django import forms
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
from django import forms
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
-from django.utils.translation import gettext_lazy as _
from fnpdjango.actions import export_as_csv_action
from modeltranslation.admin import TranslationAdmin
from wolnelektury.utils import YesNoFilter
from fnpdjango.actions import export_as_csv_action
from modeltranslation.admin import TranslationAdmin
from wolnelektury.utils import YesNoFilter
@@
-57,17
+56,23
@@
class PayUCardTokenInline(admin.TabularInline):
class PayedFilter(YesNoFilter):
class PayedFilter(YesNoFilter):
- title =
_('payment complete')
+ title =
'płatność zakończona'
parameter_name = 'payed'
q = ~Q(payed_at=None)
class ExpiredFilter(YesNoFilter):
parameter_name = 'payed'
q = ~Q(payed_at=None)
class ExpiredFilter(YesNoFilter):
- title =
_('schedule expired')
+ title =
'harmonogram przedawniony'
parameter_name = 'expired'
q = Q(expires_at__isnull=False, expires_at__lt=Now())
parameter_name = 'expired'
q = Q(expires_at__isnull=False, expires_at__lt=Now())
+class ActiveFilter(YesNoFilter):
+ title = 'płatność aktualna'
+ parameter_name = 'active'
+ q = Q(expires_at__gt=Now())
+
+
class ScheduleForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class ScheduleForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@@
-81,7
+86,7
@@
class ScheduleForm(forms.ModelForm):
class SourceFilter(admin.SimpleListFilter):
class SourceFilter(admin.SimpleListFilter):
- title =
_('Source')
# display title
+ title =
'Źródło'
# display title
parameter_name = 'source'
template = "admin/long_filter.html"
parameter_name = 'source'
template = "admin/long_filter.html"
@@
-112,7
+117,7
@@
class ScheduleAdmin(admin.ModelAdmin):
search_fields = ['email', 'source']
list_filter = [
'is_cancelled', 'monthly', 'yearly', 'method',
search_fields = ['email', 'source']
list_filter = [
'is_cancelled', 'monthly', 'yearly', 'method',
- PayedFilter, ExpiredFilter,
+ PayedFilter,
ActiveFilter,
ExpiredFilter,
SourceFilter,
]
filter_horizontal = ['consent']
SourceFilter,
]
filter_horizontal = ['consent']