Admin editing views
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
{% extends "interface/project_base.html" %}
|
||||
|
||||
{% block page %}
|
||||
<div>
|
||||
<h3>{{ title }}</h3>
|
||||
<form class="vertical" method="POST">
|
||||
{% csrf_token %}
|
||||
{{ form }}
|
||||
<div class="form-actions">
|
||||
<button>Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -4,8 +4,9 @@
|
||||
<div class="narrow">
|
||||
<h3>Manage {{ ensemble.name }}</h3>
|
||||
<p>
|
||||
Joining code for participants:<br/>
|
||||
<a href="{{ ensemble_url }}">{{ ensemble_url }}</a>
|
||||
Joining instructions for participants<br/><br/>
|
||||
URL: <a href="{{ ensemble_url }}">{{ ensemble_url }}</a><br/>
|
||||
Passphrase: {{ ensemble.passphrase }}
|
||||
</p>
|
||||
<p>
|
||||
Sorry, not much you can do here yet.
|
||||
|
||||
@@ -2,6 +2,13 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if request.is_admin %}
|
||||
<div class="admin-tools">
|
||||
{% block admin %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<h1>{{ project.name }}</h1>
|
||||
{% block page %}
|
||||
No content
|
||||
@@ -15,6 +22,9 @@ No content
|
||||
{% endfor %}
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,25 +3,21 @@
|
||||
{% block page %}
|
||||
<div class="narrow">
|
||||
<h3 class="text-center">Due in {{ project.deadline|timeuntil }}!</h3>
|
||||
<p>There have been {{ project.submissions.count }} submissions so far...</p>
|
||||
<div class="scrollable">
|
||||
<table>
|
||||
{% 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 %}
|
||||
{% for submission in project.submissions|slice:":5" %}
|
||||
<tr>
|
||||
<td>{{ submission.date|timesince }} ago</td>
|
||||
<td>{{ submission.name }} ({{ submission.instrument }})</td>
|
||||
{% if request.is_admin %}
|
||||
<td>
|
||||
<a href="{% url 'submission_detail' project=project.pk pk=submission.pk %}"><i class="fas fa-info-circle"></i></a>
|
||||
|
||||
<a href="{{ submission.presigned_url }}"><i class="fas fa-download"></i></a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -8,7 +8,7 @@
|
||||
{% csrf_token %}
|
||||
{{ form }}
|
||||
<div class="form-actions">
|
||||
<button>Create</button>
|
||||
<button>Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{% if not request.user.is_authenticated %}
|
||||
<a href="{% url 'login' %}" style="float: right"><i class="fa fa-key"></i></a>
|
||||
{% endif %}
|
||||
<div style="display: flex">
|
||||
<div class="collapse">
|
||||
{% if current %}
|
||||
<div>
|
||||
<h3>My Ensembles</h3>
|
||||
@@ -13,9 +13,9 @@
|
||||
<li><a href="/?code={{ ensemble.ensemble_code}}">{{ ensemble.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div
|
||||
</div>
|
||||
{% endif %}
|
||||
<div style="flex-grow: 4;">
|
||||
<div>
|
||||
<form action="" class="vertical" method="POST">
|
||||
<h3>Join an ensemble</h3>
|
||||
{% csrf_token %}
|
||||
|
||||
@@ -1,26 +1,40 @@
|
||||
{% extends "interface/project_base.html" %}
|
||||
|
||||
{% block page %}
|
||||
{% block admin %}
|
||||
<a href="{% url 'resource_create' project=project.pk %}"><i class="fas fa-plus-circle"></i> Add new</a>
|
||||
{% endblock %}
|
||||
|
||||
{% block page %}
|
||||
<div class="narrow">
|
||||
<h3>Resources</h3>
|
||||
<div class="list-group narrow">
|
||||
{% for resource in object_list %}
|
||||
{% with download=resource.presigned_url %}
|
||||
<div>
|
||||
{% if request.is_admin %}
|
||||
<div class="admin-tools">
|
||||
<a href="{% url 'resource_upload' project=project.pk pk=resource.pk %}">
|
||||
<i class="fas fa-upload"></i>
|
||||
</a>
|
||||
<a href="{% url 'resource_edit' project=project.pk pk=resource.pk %}">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<h3>
|
||||
{{ resource.name }}
|
||||
{% if download %}
|
||||
<a href="{{ download }}">
|
||||
<small><a href="{{ download }}">
|
||||
<i class="fas fa-download"></i> Download
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if request.is_admin %}
|
||||
<a href="{% url 'resource_upload' project=project.pk pk=resource.pk %}">
|
||||
<i class="fas fa-upload"></i> Upload
|
||||
</a>
|
||||
</a></small>
|
||||
{% endif %}
|
||||
</h3>
|
||||
<p><small>{{ resource.description }}</small></p>
|
||||
<p>
|
||||
<small>{{ resource.description }}</small>
|
||||
{% if not resource.visible %}
|
||||
<br/>(This resource is hidden from participants)
|
||||
{% endif %}
|
||||
</p>
|
||||
{% if download and resource.media_type == 'audio' %}
|
||||
<audio class="resource-player" controls src="{{ download }}"></audio>
|
||||
{% endif %}
|
||||
@@ -28,10 +42,5 @@
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% if request.is_admin %}
|
||||
<div class="admin-actions">
|
||||
<a href="{% url 'resource_create' project=project.pk %}"><i class="fas fa-plus-circle"></i> Add new</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,25 @@
|
||||
{% extends "interface/project_base.html" %}
|
||||
|
||||
{% block page %}
|
||||
<table style="max-width: 800px; margin: 10pt auto;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th><th>Time</th><th>Name</th><th>Instrument</th><th></th></tr>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for submission in object_list %}
|
||||
<tr>
|
||||
<td>{{ submission.date.date }}</td>
|
||||
<td>{{ submission.date.time }}</td>
|
||||
<td>{{ submission.name }}</td>
|
||||
<td>{{ submission.instrument }}</td>
|
||||
<td>
|
||||
<a href="{% url 'submission_detail' project=project.pk pk=submission.pk %}"><i class="fas fa-info-circle"></i></a>
|
||||
<a href="{{ submission.presigned_url }}"><i class="fas fa-download"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
@@ -1,5 +1,9 @@
|
||||
{% extends "interface/project_base.html" %}
|
||||
|
||||
{% block admin %}
|
||||
<a href="{% url 'wiki_edit' project=project.pk pk=object.pk %}" class="admin-tool"><i class="fas fa-edit"></i></a>
|
||||
{% endblock %}
|
||||
|
||||
{% block page %}
|
||||
<div class="wiki-page">
|
||||
{{ wiki_html|safe }}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{% extends "interface/project_base.html" %}
|
||||
|
||||
{% block page %}
|
||||
<style>
|
||||
TEXTAREA {
|
||||
height: 200px;
|
||||
}
|
||||
FORM.vertical {
|
||||
max-width: 90%;
|
||||
}
|
||||
</style>
|
||||
<div>
|
||||
<h3>{{ title }}</h3>
|
||||
<p>{{ instructions }}</p>
|
||||
<form class="vertical" method="POST">
|
||||
{% csrf_token %}
|
||||
{{ form }}
|
||||
<div class="form-actions">
|
||||
<button>Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user