X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/3263fb5558f69c727e61a6d4c0b3575a0f081ef6..98e406af0cc6b5d9b94441ee3f6b67a64d4eb591:/apps/catalogue/views.py?ds=sidebyside diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index 4c1a21ce..1f3130a0 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -24,6 +24,7 @@ from django.views.decorators.http import require_POST from unidecode import unidecode from catalogue import forms +from catalogue.filters import DocumentFilterSet from catalogue.forms import TagMultipleForm, TagSingleForm from catalogue.helpers import active_tab from catalogue.models import Category @@ -94,6 +95,9 @@ def create_missing(request): doc = Document.objects.create(**kwargs) + for tag_form in tag_forms: + tag_form.save(instance=doc) + cover = request.FILES.get('cover') if cover: uppath = 'uploads/%d/' % doc.pk @@ -116,9 +120,7 @@ def create_missing(request): ''' + form.cleaned_data['publisher'] + ''' ''' + form.cleaned_data['description'] + ''' - ''' + form.cleaned_data['language'] + ''' - ''' + form.cleaned_data['rights'] + ''' - ''' + form.cleaned_data['audience'] + ''' + ''' + '\n'.join(tag_form.metadata_rows() for tag_form in tag_forms) + ''' ''' + cover_url + '''
''' + title + '''
@@ -509,12 +511,16 @@ def fork(request, pk): def upcoming(request): + f = DocumentFilterSet(request.GET, queryset=Document.objects.filter(deleted=False).filter(publish_log=None)) return render(request, "catalogue/upcoming.html", { - 'objects_list': Document.objects.filter(deleted=False).filter(publish_log=None), + 'filter_set': f, + 'link_url': 'catalogue_preview', }) def finished(request): + f = DocumentFilterSet(request.GET, queryset=Document.objects.filter(deleted=False).exclude(publish_log=None)) return render(request, "catalogue/finished.html", { - 'objects_list': Document.objects.filter(deleted=False).exclude(publish_log=None), + 'filter_set': f, + 'link_url': 'catalogue_html', })