diff --git a/.gitignore b/.gitignore index a93567f..b8e6050 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,7 @@ __pycache__ *.pyc db.sqlite3 credentials -polyphonic/settings.py \ No newline at end of file +polyphonic/settings.py +env +text.* +static \ No newline at end of file diff --git a/Makefile b/Makefile index 82928ef..0496122 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,27 @@ -DROPZONE=https://github.com/enyo/dropzone/archive/v5.7.0.zip - +PYTHON=env/bin/python +DROPZONE=5.7.0 dev-setup: - pip install -r requirements.txt - pip install -r dev-requirements.txt - ./manage.py migrate - ./manage.py createsuperuser --username admin --email admin@localhost + env/bin/pip install -r requirements.txt + env/bin/pip install -r dev-requirements.txt + ${PYTHON} manage.py migrate + ${PYTHON} manage.py createsuperuser --username admin --email admin@localhost -interface/static/dropzone/dropzone.js: - wget -O dropzone.zip ${DROPZONE} - unzip -d interface/static dropzone.zip \ No newline at end of file +upgrade: + ${PYTHON} manage.py migrate + ${PYTHON} manage.py collectstatic + ${MAKE} libraries + +libraries: static/dropzone static/fonts/Quicksand_Book.otf + +static/dropzone: + wget -O dropzone-${DROPZONE}.zip https://github.com/enyo/dropzone/archive/v${DROPZONE}.zip + unzip dropzone-${DROPZONE}.zip + mv dropzone-${DROPZONE}/dist static/dropzone + rm -rf dropzone-${DROPZONE} dropzone-${DROPZONE}.zip + +static/fonts/Quicksand_Book.otf: + wget -O quicksand.zip https://dl.dafont.com/dl/?f=quicksand + mkdir -p static/fonts + unzip -d static/fonts quicksand.zip + rm quicksand.zip \ No newline at end of file diff --git a/interface/migrations/0016_auto_20200910_2025.py b/interface/migrations/0016_auto_20200910_2025.py new file mode 100644 index 0000000..0ee32f9 --- /dev/null +++ b/interface/migrations/0016_auto_20200910_2025.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.1 on 2020-09-10 10:25 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('interface', '0015_resource_media_type'), + ] + + operations = [ + migrations.AlterField( + model_name='resource', + name='media_type', + field=models.CharField(choices=[('audio', 'Audio'), ('video', 'Video'), ('general', 'General')], default='*', max_length=10), + ), + ] diff --git a/interface/models.py b/interface/models.py index 2752ba8..0001fb6 100644 --- a/interface/models.py +++ b/interface/models.py @@ -18,7 +18,7 @@ BUCKET = settings.AWS_BUCKET MEDIA_TYPES = [ ('audio', "Audio"), ('video', "Video"), - ('*', "General"), + ('general', "General"), ] def generate_code(length=9): @@ -63,7 +63,12 @@ class Resource(models.Model): media_type = models.CharField(max_length=10, choices=MEDIA_TYPES, default='*') def key_template(self): - return "{}_${{filename}}".format(slugify(self.name)) + return "{}/${{filename}}".format(slugify(self.name)) + + def accept(self): + if self.media_type == 'general': + return ".*" + return f"{self.media_type}/*" def presigned_url(self): if not self.key: diff --git a/interface/static/interface/css/polyphonic.css b/interface/static/interface/css/polyphonic.css index 6dc44ce..6df8f6f 100644 --- a/interface/static/interface/css/polyphonic.css +++ b/interface/static/interface/css/polyphonic.css @@ -5,11 +5,6 @@ --light-blue: #c5eff7; } -@font-face { - font-family: 'DreamOrphans'; - src: url('../../fonts/dream orphans.ttf') format('truetype'); -} - @font-face { font-family: 'Quicksand'; src: url('../../fonts/Quicksand_Book.otf'); @@ -102,7 +97,7 @@ UL.nav-buttons > LI { /* FORMS */ -FORM { +FORM.vertical { display: flex; flex-direction: column; max-width: 400px; @@ -221,4 +216,8 @@ TABLE.horizontal TH { .resource-player { width: 100%; border-radius: 10px; +} + +.dz-clickable { + text-align: center; } \ No newline at end of file diff --git a/interface/templates/interface/project_form.html b/interface/templates/interface/project_form.html index 3fb6ecd..f9b7926 100644 --- a/interface/templates/interface/project_form.html +++ b/interface/templates/interface/project_form.html @@ -4,7 +4,7 @@
{{ instructions }}
-