diff --git a/.gitignore b/.gitignore index 67709bf..189d8b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ __pycache__ *.pyc *.sqlite3 +*.swp credentials.json credentials local_settings.py diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..cc992ab --- /dev/null +++ b/TODO.md @@ -0,0 +1,19 @@ +## Polyphonic TODO + +## Core interface + +* Shift from crispy forms to native component templates +* Make long running calls async (Django 5) +* Deprecate Django 4 portions + +### Library App + +* Remove music tags and replace with strings vn1 -> 'Violin 1' +* GDrive selector +* Move upload to modal from 'Upload' button +* Tagging app - migrate to AlpineJS +* Allow other tags (movements, sections, pieces) + +### Submissions App + +* None currently pending diff --git a/app/library/migrations/0015_collection_settings_alter_document_doctype.py b/app/library/migrations/0015_collection_settings_alter_document_doctype.py new file mode 100644 index 0000000..999e512 --- /dev/null +++ b/app/library/migrations/0015_collection_settings_alter_document_doctype.py @@ -0,0 +1,23 @@ +# Generated by Django 5.0.6 on 2024-06-18 05:57 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('library', '0014_auto_20230223_1422'), + ] + + operations = [ + migrations.AddField( + model_name='collection', + name='settings', + field=models.JSONField(default=dict, help_text='Storage specific settings'), + ), + migrations.AlterField( + model_name='document', + name='doctype', + field=models.PositiveSmallIntegerField(choices=[(1, 'PDF'), (2, 'Audio'), (3, 'Video'), (4, 'Misc')], default=1), + ), + ] diff --git a/app/library/models.py b/app/library/models.py index acb5cbc..26a362c 100644 --- a/app/library/models.py +++ b/app/library/models.py @@ -86,14 +86,14 @@ class ProjectItem(models.Model): def __str__(self): return f"<{self.project_id}:{slugify(self.work.name)}>" - + class Collection(models.Model): """ A logical collection of works, typically owned by an organisation or person (physical or virtual) """ name = models.CharField(max_length=255, help_text="Name of the collection") - prefix = models.SlugField(max_length=30, default="default", + prefix = models.CharField(max_length=255, default="default", help_text="Folder to store works in") administrators = models.ManyToManyField('auth.User', related_name="collections", help_text="Administrators for this collection") @@ -103,6 +103,8 @@ class Collection(models.Model): help_text="User storage for documents") notes = models.TextField(blank=True, help_text="Publicly visible notes about collection and loans policy (markdown format)") + settings = models.JSONField(default=dict, blank=True, + help_text="Storage specific settings") nonce = models.SmallIntegerField(default=1, help_text="Increment this to reset the authentication links") @@ -405,4 +407,4 @@ class Section(models.Model): return "all" def __str__(self): - return self.name \ No newline at end of file + return self.name diff --git a/app/library/templates/library/document_annotate.html b/app/library/templates/library/document_annotate.html index 204066e..64dc371 100644 --- a/app/library/templates/library/document_annotate.html +++ b/app/library/templates/library/document_annotate.html @@ -139,7 +139,7 @@ crossorigin="anonymous"> {{ json_data|json_script:"data" }} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/app/library/templates/library/storage_browser.html b/app/library/templates/library/storage_browser.html new file mode 100644 index 0000000..baef259 --- /dev/null +++ b/app/library/templates/library/storage_browser.html @@ -0,0 +1,12 @@ +{% load path_filters %} +
{% firstof work.composer "Unattributed" %}{% if work.edition %} - {{ work.edition }}{% endif %}
-{{ work.notes }}
- --
| Location: | {{ work.collection }} [{{ work.identifier }}] | -Orchestration: | {{ work.orchestration }} | -
|---|---|---|---|
| Running time: | {% firstof work.duration 'Unknown' %} | -Licence: | {{ work.get_licence_display }} | -
| - {% for meta in work.meta %} - - {{ meta.get_name_display }}: - {{ meta.value }} - - {% endfor %} - | -|||
From {{ work.parent.name }} - {{ work.parent.composer }} -
- {% endif %} - - {% if work.related_works.count %} -{{ work.notes }}
+ ++
| Location: | {{ work.collection }} [{{ work.identifier }}] | +Orchestration: | {{ work.orchestration }} | +
|---|---|---|---|
| Running time: | {% firstof work.duration 'Unknown' %} | +Licence: | {{ work.get_licence_display }} | +
| + {% for meta in work.meta %} + + {{ meta.get_name_display }}: + {{ meta.value }} + + {% endfor %} + | +|||
From {{ work.parent.name }} - {{ work.parent.composer }} +
+ {% endif %} + + {% if work.related_works.count %} +
More details...
diff --git a/app/library/urls.py b/app/library/urls.py
index 3e2cb82..34f5051 100644
--- a/app/library/urls.py
+++ b/app/library/urls.py
@@ -35,10 +35,13 @@ urlpatterns = [
path('collections/