fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update librarian
[redakcja.git]
/
apps
/
catalogue
/
forms.py
diff --git
a/apps/catalogue/forms.py
b/apps/catalogue/forms.py
index
bf51f40
..
ea6a4ae
100644
(file)
--- a/
apps/catalogue/forms.py
+++ b/
apps/catalogue/forms.py
@@
-7,6
+7,7
@@
from catalogue.models import User
from django.db.models import Count
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.db.models import Count
from django import forms
from django.utils.translation import ugettext_lazy as _
+from django.conf import settings
from catalogue.constants import MASTERS
from catalogue.models import Book, Chunk, Image
from catalogue.constants import MASTERS
from catalogue.models import Book, Chunk, Image
@@
-196,13
+197,13
@@
class ReadonlyImageForm(ImageForm):
class MarkFinalForm(forms.Form):
class MarkFinalForm(forms.Form):
- username = forms.CharField(initial=
'lipszyc'
)
+ username = forms.CharField(initial=
settings.LITERARY_DIRECTOR_USERNAME
)
comment = forms.CharField(initial=u'Ostateczna akceptacja merytoryczna przez kierownika literackiego.')
books = forms.CharField(widget=forms.Textarea, help_text=u'linki do książek w redakcji, po jednym na wiersz')
def clean_books(self):
books_value = self.cleaned_data['books']
comment = forms.CharField(initial=u'Ostateczna akceptacja merytoryczna przez kierownika literackiego.')
books = forms.CharField(widget=forms.Textarea, help_text=u'linki do książek w redakcji, po jednym na wiersz')
def clean_books(self):
books_value = self.cleaned_data['books']
- slugs = [line.s
plit('/')[-2
] for line in books_value.split('\n') if line.strip()]
+ slugs = [line.s
trip().strip('/').split('/')[-1
] for line in books_value.split('\n') if line.strip()]
books = Book.objects.filter(slug__in=slugs)
if len(books) != len(slugs):
raise forms.ValidationError(
books = Book.objects.filter(slug__in=slugs)
if len(books) != len(slugs):
raise forms.ValidationError(
@@
-226,3
+227,8
@@
class MarkFinalForm(forms.Form):
tags=[Chunk.tag_model.objects.get(slug='editor-proofreading')],
publishable=True
)
tags=[Chunk.tag_model.objects.get(slug='editor-proofreading')],
publishable=True
)
+
+
+class PublishOptionsForm(forms.Form):
+ days = forms.IntegerField(label=u'po ilu dniach udostępnienić (0 = od razu)', min_value=0, initial=0)
+ beta = forms.BooleanField(label=u'Opublikuj na wersji testowej', required=False)