- {% if project.description %}
-
{{ project.description|markdown }}
- {% else %}
-
No description
+
+
+
+
+ {% if project.event_date %}
+
+ {{ project.event_date|date:"l jS F Y, g:i A" }}
+ {% if project.has_happened %}
+ ({{ project.event_date|roughtimesince }} ago)
+ {% else %}
+ (in {{ project.event_date|roughtimeuntil }})
+ {% endif %}
+
{% endif %}
+
+
+ {% if project.description %}
+
{{ project.description|markdown }}
+ {% else %}
+
No description
+ {% endif %}
+
+
+ {% if project.owner %}
+
+ {% if project.owner.email %}
+ The project owner is
{{ project.owner }}
+ {% else %}
+ The project owner is {{ project.owner }}.
+ {% endif %}
+
+ {% endif %}
+
-
-
{% if 'library' in modules %}
-
+
{% include 'library/project_detail.html' %}
-
+
{% endif %}
{% if 'submission' in modules %}
-
+
{% include 'submissions/project_detail.html' %}
-
- {% endif %}
-
- {% if project.owner %}
-
- {% if project.owner.email %}
- The project owner is
{{ project.owner }}
- {% else %}
- The project owner is {{ project.owner }}.
- {% endif %}
-
- {% endif %}
-
- {% if request.is_admin %}
-
+
{% endif %}
+{% if request.is_admin %}
+
+{% endif %}
+
+
{% endblock %}
diff --git a/app/interface/templates/interface/resource_list.html b/app/interface/templates/interface/resource_list.html
index 56102d4..6e825bb 100644
--- a/app/interface/templates/interface/resource_list.html
+++ b/app/interface/templates/interface/resource_list.html
@@ -9,6 +9,7 @@
{% endblock %}
{% block page %}
+
Resources
{% for resource in object_list %}
{% with download=resource.file.url %}
@@ -51,7 +52,7 @@
{% endwith %}
{% empty %}
-
There are resources for this project
+
There are no resources for this project
{% endfor %}
diff --git a/app/library/models.py b/app/library/models.py
index facc972..acb5cbc 100644
--- a/app/library/models.py
+++ b/app/library/models.py
@@ -9,6 +9,7 @@ from django.core.files.storage import get_storage_class
from django.db.models import Q, Count, Min, Max
import re
+import os.path
from byostorage.user import BYOStorage
from byostorage.cached import CachedStorage
@@ -218,6 +219,9 @@ class Work(models.Model):
#return [ s[1] for s in sections ]
sections = list(dict(sections).items()) # primitive unique()
return sections
+
+ def pdfs(self):
+ return self.docs.filter(doctype=Document.DOCTYPE_PDF)
@property
def physical_parts(self):
@@ -344,6 +348,9 @@ class Document(models.Model):
def delete(self, *args, **kwargs):
self.upload.delete(save=False)
return super().delete(*args, **kwargs)
+
+ def filename(self):
+ return os.path.basename(self.upload.name)
def __str__(self):
return self.upload.name
diff --git a/app/library/templates/library/document_annotate.html b/app/library/templates/library/document_annotate.html
index a6f463d..204066e 100644
--- a/app/library/templates/library/document_annotate.html
+++ b/app/library/templates/library/document_annotate.html
@@ -78,8 +78,8 @@
{% for tag, inst in document.work.music_tags %}
{{ inst }}
{% endfor %}
-
Add instrument
+
Add Tag
@@ -122,7 +122,7 @@
-
+
@@ -301,7 +301,14 @@
variant.value = '';
name.value = '';
+ let li = document.createElement('li');
+ li.classList.add("is-clickable");
+ li.addEventListener('click', () => assignInstrument(tag, li));
+ li.innerHTML = get_instrument(tag);
+ document.getElementById('unassigned-area').appendChild(li);
+
addTag(tag, pageNum, pageNum);
+ closeAddModal();
}
function assignInstrument(tag, el) {
@@ -334,11 +341,6 @@
del.className = "icon is-action";
del.innerHTML = '
';
del.addEventListener('click', () => {
- let li = document.createElement('li');
- li.classList.add("is-clickable");
- li.addEventListener('click', () => assignInstrument(tag, li));
- li.innerHTML = get_instrument(el.dataset.tag);
- document.getElementById('unassigned-area').appendChild(li);
el.remove();
dirty=true;
});
diff --git a/app/library/templates/library/item_list.html b/app/library/templates/library/item_list.html
index 7744e07..d465f60 100644
--- a/app/library/templates/library/item_list.html
+++ b/app/library/templates/library/item_list.html
@@ -1,21 +1,14 @@
{% extends "interface/project_base.html" %}
-{% block admin %}
-
-
- Change items
-
-{% endblock %}
-
{% block page %}