Library working:

This commit is contained in:
Tris
2021-03-22 10:30:13 +11:00
parent 35555c3321
commit 1581f56b74
32 changed files with 511 additions and 211 deletions
+1
View File
@@ -5,6 +5,7 @@
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" type="image/png" href="{% static 'interface/icon.png' %}" />
<link rel="stylesheet" href="{% static 'interface/css/polyphonic.css' %}"></link>
<title>{% block title %}Polyphonic{% endblock %}</title>
@@ -1,11 +1,11 @@
{% extends "base.html" %}
{% extends "interface/project_base.html" %}
{% block content %}
{% block page %}
<div style="flex-grow: 1">
<h1>Projects for {{ ensemble.name }}</h1>
<div class="list-group narrow">
{% for project in ensemble.active_projects %}
<a class="" href="{% url 'project_detail' pk=project.id %}">
<a class="" href="{% url 'project_detail' project=project.id %}">
<h3>{{ project.name }}</h3>
<p><small>
{% if project.deadline %}In {{ project.deadline|timeuntil }}<br/>{% endif %}
@@ -15,7 +15,7 @@
</a>
{% endfor %}
</div>
<div style="text-align: right; margin-top: 10px; color: #999;">
<div style="float: right; margin-top: 10px; color: #999;">
<small>{{ ensemble.ensemble_code }}</small>
</div>
</div>
@@ -10,25 +10,32 @@
{% endif %}
<h1>{{ project.name }}</h1>
{% block page %}
No content
{% endblock %}
{% if project %}
<div class="project-links">
<div class="pills" role="tablist">
<a role="tab" href="{% url 'project_detail' pk=project.id %}">Project info</a>
{% if project %}
<a role="tab" href="{% url 'project_detail' project=project.id %}">Project info</a>
{% for page in project.wiki_pages.all %}
<a class="nav-link {% if page.id == wiki_id %}active{% endif %}"
href="{% url 'wiki' project=project.id pk=page.id %}">{{ page.title }}</a>
{% endfor %}
{% endif %}
{% if project and project.enable_submissions%}
<a role="tab" href="{% url 'resource_list' project=project.pk %}">Resources</a>
<!--a role="tab" href="">Record a submission</a-->
{% if request.is_admin %}
<a role="tab" href="{% url 'submission_list' project=project.id %}">Submissions</a>
{% endif %}
<a role="tab" href="{% url 'submission_create' project=project.id %}">Send a file</a>
{% endif %}
{% include "library/project_menu.html" %}
</div>
</div>
{% endif %}
{% endblock %}
@@ -2,30 +2,25 @@
{% load md2 %}
{% block page %}
{% block page %}
<div class="narrow">
{% if project.deadline %}
<h3 class="text-center">In {{ project.deadline|timeuntil }}</h3>
{% if project.event_date %}
<h3 class="text-center">{{ project.when }}</h3>
{% endif %}
<p>{{ project.description|markdown }}</p>
<p>{{ project.description|markdown }}</p>
{% if project.owner %}
<p>Project email: <a href="mailto:{{ project.owner }}">{{ project.owner }}</a></p>
<p>Project email: <a href="mailto:{{ project.owner }}">{{ project.owner }}</a></p>
{% endif %}
{% with sub_count=project.submissions.count %}
<p>There have been {{ sub_count }} submission{{ sub_count|pluralize }} so far...</p>
{% if sub_count %}
<h4>Recent submissions</h4>
<table style="width: 100%">
<tbody">
{% for submission in project.submissions|slice:":5" %}
<tr>
<td>{{ submission.date|timesince }} ago</td>
<td>{{ submission.name }} ({{ submission.instrument }})</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if project.enable_submissions %}
{% include 'submissions/project_detail.html' %}
{% endif %}
{% endwith %}
{% if project.enable_library %}
{% include 'library/project_detail.html' %}
{% endif %}
</div>
{% endblock %}
{% endblock %}