Hooked up library app
This commit is contained in:
parent
526ae4f59b
commit
35555c3321
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,3 +7,4 @@ env
|
|||||||
test.*
|
test.*
|
||||||
static
|
static
|
||||||
teststore
|
teststore
|
||||||
|
cache
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
# Register your models here.
|
|
||||||
|
|
||||||
from . import models
|
from . import models
|
||||||
|
|
||||||
class EnsembleAdmin(admin.ModelAdmin):
|
class EnsembleAdmin(admin.ModelAdmin):
|
||||||
|
|||||||
34
interface/migrations/0022_auto_20210303_2043.py
Normal file
34
interface/migrations/0022_auto_20210303_2043.py
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# Generated by Django 3.1.1 on 2021-03-03 09:43
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
from django.utils.text import slugify
|
||||||
|
|
||||||
|
def create_slugs(apps, schema_editor):
|
||||||
|
for model in ('Ensemble', 'Project'):
|
||||||
|
M = apps.get_model('interface', model)
|
||||||
|
for instance in M.objects.all():
|
||||||
|
if instance.slug == '':
|
||||||
|
instance.slug = slugify(instance.name)
|
||||||
|
instance.save()
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('interface', '0021_project_description'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='ensemble',
|
||||||
|
name='slug',
|
||||||
|
field=models.SlugField(default='', editable=False, max_length=100),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='project',
|
||||||
|
name='slug',
|
||||||
|
field=models.SlugField(default='', editable=False, max_length=100),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
migrations.RunPython(create_slugs)
|
||||||
|
]
|
||||||
@ -153,6 +153,14 @@ INPUT[type=checkbox] {
|
|||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.clickable {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action {
|
||||||
|
margin: 0px 10px 0px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
.pills {
|
.pills {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@ -238,6 +246,10 @@ TABLE.horizontal TH {
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TABLE SELECT {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.resource-player {
|
.resource-player {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
@ -277,3 +289,31 @@ TABLE.horizontal TH {
|
|||||||
margin-left: -100px !important;
|
margin-left: -100px !important;
|
||||||
margin-top: 24px !important;
|
margin-top: 24px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.item-table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-table TD {
|
||||||
|
border: 1px solid #999;
|
||||||
|
}
|
||||||
|
TD.select-cell {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-cell SELECT {
|
||||||
|
border: none;
|
||||||
|
background-color: white;
|
||||||
|
height: 30px;
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: inherit;
|
||||||
|
}
|
||||||
|
#tag-list DIV {
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
DIV.selected {
|
||||||
|
background-color: #EEE;
|
||||||
|
border: 1px solid #999;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
@ -16,7 +16,7 @@
|
|||||||
<nav class="navigation">
|
<nav class="navigation">
|
||||||
<div>
|
<div>
|
||||||
<a class="brand" href="/"><i class="fas fa-random smhide"></i> Polyphonic</a>
|
<a class="brand" href="/"><i class="fas fa-random smhide"></i> Polyphonic</a>
|
||||||
<span class="mdhide">Virtual Ensemble Manager</span>
|
<span class="mdhide">Ensemble Manager</span>
|
||||||
</div>
|
</div>
|
||||||
<ul class="nav-buttons">
|
<ul class="nav-buttons">
|
||||||
{% if request.ensemble_id %}
|
{% if request.ensemble_id %}
|
||||||
@ -25,7 +25,7 @@
|
|||||||
Projects</span></a>
|
Projects</span></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="{% url 'register' %}"><i class="fas fa-users" title="Ensembles"></i> <span class="smhide">My
|
<a class="nav-link" href="{% url 'register' %}"><i class="fas fa-users" title="Ensembles"></i> <span class="mdhide">My
|
||||||
Ensembles</span></a>
|
Ensembles</span></a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
{% block page %}
|
{% block page %}
|
||||||
<div>
|
<div>
|
||||||
<h3>{{ title }}</h3>
|
<h3>{{ title }}</h3>
|
||||||
<form class="vertical" method="POST">
|
<form class="vertical" method="POST" enctype="multipart/form-data">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{ form }}
|
{{ form }}
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
|
|||||||
@ -7,7 +7,11 @@
|
|||||||
{% for project in ensemble.active_projects %}
|
{% for project in ensemble.active_projects %}
|
||||||
<a class="" href="{% url 'project_detail' pk=project.id %}">
|
<a class="" href="{% url 'project_detail' pk=project.id %}">
|
||||||
<h3>{{ project.name }}</h3>
|
<h3>{{ project.name }}</h3>
|
||||||
<p><small>Due in {{ project.deadline|timeuntil }}, {{ project.submissions.count }} submissions.</small></p>
|
<p><small>
|
||||||
|
{% if project.deadline %}In {{ project.deadline|timeuntil }}<br/>{% endif %}
|
||||||
|
{% if project.works.count %}{{ project.works.count }} works<br/>{% endif %}
|
||||||
|
{% if project.submissions.count %}{{ project.submissions.count }} submissions<br/>{% endif %}
|
||||||
|
</small></p>
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -8,6 +8,9 @@
|
|||||||
URL: <a href="{{ ensemble_url }}">{{ ensemble_url }}</a><br/>
|
URL: <a href="{{ ensemble_url }}">{{ ensemble_url }}</a><br/>
|
||||||
Passphrase: {{ ensemble.passphrase }}
|
Passphrase: {{ ensemble.passphrase }}
|
||||||
</p>
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li><a href="{% url 'work_list' %}">Library</a></li>
|
||||||
|
</ul>
|
||||||
<p>
|
<p>
|
||||||
Sorry, not much you can do here yet.
|
Sorry, not much you can do here yet.
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
{% block page %}
|
{% block page %}
|
||||||
No content
|
No content
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
{% if project %}
|
||||||
<div class="project-links">
|
<div class="project-links">
|
||||||
<div class="pills" role="tablist">
|
<div class="pills" role="tablist">
|
||||||
<a role="tab" href="{% url 'project_detail' pk=project.id %}">Project info</a>
|
<a role="tab" href="{% url 'project_detail' pk=project.id %}">Project info</a>
|
||||||
@ -26,6 +27,8 @@ No content
|
|||||||
<a role="tab" href="{% url 'submission_list' project=project.id %}">Submissions</a>
|
<a role="tab" href="{% url 'submission_list' project=project.id %}">Submissions</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a role="tab" href="{% url 'submission_create' project=project.id %}">Send a file</a>
|
<a role="tab" href="{% url 'submission_create' project=project.id %}">Send a file</a>
|
||||||
|
{% include "library/project_menu.html" %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -4,7 +4,9 @@
|
|||||||
|
|
||||||
{% block page %}
|
{% block page %}
|
||||||
<div class="narrow">
|
<div class="narrow">
|
||||||
<h3 class="text-center">Due in {{ project.deadline|timeuntil }}!</h3>
|
{% if project.deadline %}
|
||||||
|
<h3 class="text-center">In {{ project.deadline|timeuntil }}</h3>
|
||||||
|
{% endif %}
|
||||||
<p>{{ project.description|markdown }}</p>
|
<p>{{ project.description|markdown }}</p>
|
||||||
{% if project.owner %}
|
{% 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>
|
||||||
|
|||||||
@ -372,7 +372,6 @@ class ResourceCreateView(ProjectMixin, CreateView):
|
|||||||
admin_required = True
|
admin_required = True
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
|
|
||||||
self.object = form.save(commit=False)
|
self.object = form.save(commit=False)
|
||||||
self.object.project = self.get_project()
|
self.object.project = self.get_project()
|
||||||
self.object.save()
|
self.object.save()
|
||||||
|
|||||||
@ -39,6 +39,7 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
'django_markdown2',
|
'django_markdown2',
|
||||||
'interface',
|
'interface',
|
||||||
|
'library',
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
@ -123,3 +124,5 @@ STATIC_URL = '/static/'
|
|||||||
|
|
||||||
# Need to set this
|
# Need to set this
|
||||||
AWS_BUCKET = ''
|
AWS_BUCKET = ''
|
||||||
|
|
||||||
|
MEDIA_ROOT = 'media'
|
||||||
@ -19,4 +19,11 @@ from django.urls import path, include
|
|||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
path('', include('interface.urls')),
|
path('', include('interface.urls')),
|
||||||
|
path('', include('library.urls')),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
try:
|
||||||
|
import debug_toolbar
|
||||||
|
urlpatterns.append(path('__debug__', include(debug_toolbar.urls)))
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user