From 35555c332147af4c5daba6b665a34a918ce1a17a Mon Sep 17 00:00:00 2001 From: Tris Date: Thu, 11 Mar 2021 09:33:51 +1100 Subject: [PATCH] Hooked up library app --- .gitignore | 3 +- interface/admin.py | 2 - .../migrations/0022_auto_20210303_2043.py | 34 ++++++++++++++++ interface/static/interface/css/polyphonic.css | 40 +++++++++++++++++++ interface/templates/base.html | 4 +- .../templates/interface/default_form.html | 2 +- .../templates/interface/ensemble_detail.html | 6 ++- interface/templates/interface/manage.html | 3 ++ .../templates/interface/project_base.html | 3 ++ .../templates/interface/project_detail.html | 4 +- interface/views.py | 1 - polyphonic/settings_default.py | 3 ++ polyphonic/urls.py | 7 ++++ 13 files changed, 103 insertions(+), 9 deletions(-) create mode 100644 interface/migrations/0022_auto_20210303_2043.py diff --git a/.gitignore b/.gitignore index 417c0fc..829fb00 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ polyphonic/settings.py env test.* static -teststore \ No newline at end of file +teststore +cache diff --git a/interface/admin.py b/interface/admin.py index 5fbe821..c7dd140 100644 --- a/interface/admin.py +++ b/interface/admin.py @@ -1,7 +1,5 @@ from django.contrib import admin -# Register your models here. - from . import models class EnsembleAdmin(admin.ModelAdmin): diff --git a/interface/migrations/0022_auto_20210303_2043.py b/interface/migrations/0022_auto_20210303_2043.py new file mode 100644 index 0000000..3f77f10 --- /dev/null +++ b/interface/migrations/0022_auto_20210303_2043.py @@ -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) + ] diff --git a/interface/static/interface/css/polyphonic.css b/interface/static/interface/css/polyphonic.css index e2995c9..1afc8c3 100644 --- a/interface/static/interface/css/polyphonic.css +++ b/interface/static/interface/css/polyphonic.css @@ -153,6 +153,14 @@ INPUT[type=checkbox] { color: white; } +.clickable { + cursor: pointer; +} + +.action { + margin: 0px 10px 0px 5px; +} + .pills { display: flex; flex-wrap: wrap; @@ -238,6 +246,10 @@ TABLE.horizontal TH { padding: 5px; } +TABLE SELECT { + width: 100%; +} + .resource-player { width: 100%; border-radius: 10px; @@ -276,4 +288,32 @@ TABLE.horizontal TH { width: 200px !important; margin-left: -100px !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; } \ No newline at end of file diff --git a/interface/templates/base.html b/interface/templates/base.html index ff83269..8ff933c 100644 --- a/interface/templates/base.html +++ b/interface/templates/base.html @@ -16,7 +16,7 @@