diff --git a/polyphonic/interface/templates/interface/project_items.html b/polyphonic/interface/templates/interface/project_items.html index 6db05e6..561048a 100644 --- a/polyphonic/interface/templates/interface/project_items.html +++ b/polyphonic/interface/templates/interface/project_items.html @@ -33,4 +33,4 @@ {% endfor %} - \ No newline at end of file + diff --git a/polyphonic/library/templates/library/item_list.html b/polyphonic/library/templates/library/item_list.html index 7207fa5..ab88d32 100644 --- a/polyphonic/library/templates/library/item_list.html +++ b/polyphonic/library/templates/library/item_list.html @@ -31,12 +31,6 @@ - - - @@ -45,6 +39,7 @@ Piece + Composer Running time Part @@ -61,6 +56,7 @@ {{ item.work.name }} {% endif %} + {{ item.work.composer }} {% firstof item.work.running_time "------" %} @@ -74,8 +70,9 @@ - - + + + Get @@ -85,13 +82,11 @@ - {% firstof running_time "------" %} - - + {% firstof running_time "------" %} + + + diff --git a/polyphonic/library/views/__init__.py b/polyphonic/library/views/__init__.py index 995ba22..e36dc5d 100644 --- a/polyphonic/library/views/__init__.py +++ b/polyphonic/library/views/__init__.py @@ -38,7 +38,8 @@ class ProjectItemListView(ProjectMixin, ListView): project_works = self.project.works.all() - instruments = request.POST.getlist("instruments") + print(request.POST) + instruments = request.POST.getlist("instrument-selection") works = request.POST.getlist("works") request.session["part"] = request.POST.get("part", "") @@ -65,13 +66,16 @@ class ProjectItemListView(ProjectMixin, ListView): (part.doc.upload.path, part.doc.work.name, part.start, part.end, 1) ) - result = extract_and_concat(sections) + action = request.POST.get("action") + if action == "pdf": + result = extract_and_concat(sections) + download_name = f"{self.project.name}.pdf" - download_name = f"{self.project.name}.pdf" + response = FileResponse(result, content_type="application/pdf") + response["Content-Disposition"] = f'inline; filename="{download_name}"' + return response - response = FileResponse(result, content_type="application/pdf") - response["Content-Disposition"] = f'inline; filename="{download_name}"' - return response + return HttpResponse(f"Unknown action: {action}", status=400) def get_queryset(self): return (