diff --git a/web-app/django/VIM/apps/instruments/management/commands/import_instruments.py b/web-app/django/VIM/apps/instruments/management/commands/import_instruments.py index bc477b1..a0a32d6 100644 --- a/web-app/django/VIM/apps/instruments/management/commands/import_instruments.py +++ b/web-app/django/VIM/apps/instruments/management/commands/import_instruments.py @@ -86,7 +86,7 @@ def get_instrument_data(self, instrument_ids: list[str]) -> list[dict]: def create_database_objects(self, instrument_attrs: dict, ins_img_url: str) -> None: """ - Given a dictionary of instrument attributes and a url to an instrument image, + Given a dictionary of instrument attributes and a url to an instrument image, create the corresponding database objects. instrument_attrs [dict]: Dictionary of instrument attributes. See diff --git a/web-app/django/VIM/apps/instruments/management/commands/import_languages.py b/web-app/django/VIM/apps/instruments/management/commands/import_languages.py index f22ee35..da9d52d 100644 --- a/web-app/django/VIM/apps/instruments/management/commands/import_languages.py +++ b/web-app/django/VIM/apps/instruments/management/commands/import_languages.py @@ -6,10 +6,10 @@ class Command(BaseCommand): """ The import_languages command populates the database with languages in which instrument names can be provided in VIM. - + NOTE: For now, this script only imports English and French. """ - + help = "Imports possible languages for instrument names from Wikidata." def handle(self, *args, **options): diff --git a/web-app/django/VIM/apps/instruments/migrations/0001_initial.py b/web-app/django/VIM/apps/instruments/migrations/0001_initial.py index d2932b5..54f5491 100644 --- a/web-app/django/VIM/apps/instruments/migrations/0001_initial.py +++ b/web-app/django/VIM/apps/instruments/migrations/0001_initial.py @@ -5,64 +5,188 @@ class Migration(migrations.Migration): - initial = True - dependencies = [ - ] + dependencies = [] operations = [ migrations.CreateModel( - name='AVResource', + name="AVResource", fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('type', models.CharField(choices=[('audio', 'Audio'), ('video', 'Video'), ('image', 'Image')], help_text='What type of audiovisual resource is this?', max_length=5)), - ('format', models.CharField()), - ('url', models.URLField(max_length=1000)), - ('instrument_date', models.DateField(blank=True, help_text='When was this instrument made?', null=True)), - ('instrument_maker', models.CharField(blank=True, help_text='Who made this instrument?')), - ('instrument_description', models.TextField(blank=True, help_text='Additional information about the instrument.')), - ('source_name', models.CharField(help_text='What is the name of the source of this AVResource?')), + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "type", + models.CharField( + choices=[ + ("audio", "Audio"), + ("video", "Video"), + ("image", "Image"), + ], + help_text="What type of audiovisual resource is this?", + max_length=5, + ), + ), + ("format", models.CharField()), + ("url", models.URLField(max_length=1000)), + ( + "instrument_date", + models.DateField( + blank=True, + help_text="When was this instrument made?", + null=True, + ), + ), + ( + "instrument_maker", + models.CharField(blank=True, help_text="Who made this instrument?"), + ), + ( + "instrument_description", + models.TextField( + blank=True, + help_text="Additional information about the instrument.", + ), + ), + ( + "source_name", + models.CharField( + help_text="What is the name of the source of this AVResource?" + ), + ), ], ), migrations.CreateModel( - name='Instrument', + name="Instrument", fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('wikidata_id', models.CharField(max_length=20, unique=True)), - ('hornbostel_sachs_class', models.CharField(blank=True, help_text='Hornbostel-Sachs classification', max_length=50)), - ('mimo_class', models.CharField(blank=True, help_text='Musical Instrument Museums Online classification', max_length=50)), - ('default_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='default_image_of', to='instruments.avresource')), + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("wikidata_id", models.CharField(max_length=20, unique=True)), + ( + "hornbostel_sachs_class", + models.CharField( + blank=True, + help_text="Hornbostel-Sachs classification", + max_length=50, + ), + ), + ( + "mimo_class", + models.CharField( + blank=True, + help_text="Musical Instrument Museums Online classification", + max_length=50, + ), + ), + ( + "default_image", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.PROTECT, + related_name="default_image_of", + to="instruments.avresource", + ), + ), ], ), migrations.CreateModel( - name='Language', + name="Language", fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('wikidata_code', models.CharField(help_text='Language code in Wikidata', unique=True)), - ('wikidata_id', models.CharField(help_text='Language ID (Q number) in Wikidata', unique=True)), - ('en_label', models.CharField(help_text='Language label in English')), - ('autonym', models.CharField(help_text='Language label in the language itself')), + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "wikidata_code", + models.CharField( + help_text="Language code in Wikidata", unique=True + ), + ), + ( + "wikidata_id", + models.CharField( + help_text="Language ID (Q number) in Wikidata", unique=True + ), + ), + ("en_label", models.CharField(help_text="Language label in English")), + ( + "autonym", + models.CharField(help_text="Language label in the language itself"), + ), ], ), migrations.CreateModel( - name='InstrumentName', + name="InstrumentName", fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=50)), - ('source_name', models.CharField(help_text='Who or what called the instrument this?', max_length=50)), - ('instrument', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='instruments.instrument')), - ('language', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='instruments.language')), + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=50)), + ( + "source_name", + models.CharField( + help_text="Who or what called the instrument this?", + max_length=50, + ), + ), + ( + "instrument", + models.ForeignKey( + on_delete=django.db.models.deletion.PROTECT, + to="instruments.instrument", + ), + ), + ( + "language", + models.ForeignKey( + on_delete=django.db.models.deletion.PROTECT, + to="instruments.language", + ), + ), ], ), migrations.AddField( - model_name='avresource', - name='instrument', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='instruments.instrument'), + model_name="avresource", + name="instrument", + field=models.ForeignKey( + on_delete=django.db.models.deletion.PROTECT, to="instruments.instrument" + ), ), migrations.AddField( - model_name='avresource', - name='instrument_description_language', - field=models.ForeignKey(blank=True, help_text='What language is Instrument Description written in?', null=True, on_delete=django.db.models.deletion.PROTECT, to='instruments.language'), + model_name="avresource", + name="instrument_description_language", + field=models.ForeignKey( + blank=True, + help_text="What language is Instrument Description written in?", + null=True, + on_delete=django.db.models.deletion.PROTECT, + to="instruments.language", + ), ), ] diff --git a/web-app/django/VIM/apps/instruments/models/instrument.py b/web-app/django/VIM/apps/instruments/models/instrument.py index 26d42e5..f7a6d3b 100644 --- a/web-app/django/VIM/apps/instruments/models/instrument.py +++ b/web-app/django/VIM/apps/instruments/models/instrument.py @@ -10,5 +10,11 @@ class Instrument(models.Model): null=True, related_name="default_image_of", ) - hornbostel_sachs_class = models.CharField(max_length=50, blank=True, help_text = "Hornbostel-Sachs classification") - mimo_class = models.CharField(max_length=50, blank=True, help_text = "Musical Instrument Museums Online classification") + hornbostel_sachs_class = models.CharField( + max_length=50, blank=True, help_text="Hornbostel-Sachs classification" + ) + mimo_class = models.CharField( + max_length=50, + blank=True, + help_text="Musical Instrument Museums Online classification", + ) diff --git a/web-app/django/VIM/apps/instruments/static/instruments/css/index.css b/web-app/django/VIM/apps/instruments/static/instruments/css/index.css new file mode 100644 index 0000000..e25b5ce --- /dev/null +++ b/web-app/django/VIM/apps/instruments/static/instruments/css/index.css @@ -0,0 +1,120 @@ + +@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css"); + +h4 { + color: #435334; + font-size: 20px; + font-weight: 700; +} + +h5 { + color: #435334; +} + +hr { + border: 1.5px solid #435334; + margin-top: 0; +} + +/* sidebar */ +.sidebar-container { + background-color: white; + border: 3px solid #9EB384; + border-radius: 30px; + height: auto !important; +} + +.info-block { + background-color: #FAF1E4; + border: 1.5px solid #CEDEBD; + border-radius: 10px; + height: auto !important; +} + +.list-group-item { + border: none !important; + background-color: transparent !important; + color: #9EB384; +} + +.toggle-more{ + color: #435334; +} + +.toggle-more:hover { + cursor: pointer; + color: #9EB384; +} + +/* body */ +.body-container { + background-color: white; + border: 3px solid #9EB384; + border-radius: 30px; +} + +.display-btn { + font-weight: bold; + color: #435334; + font-size: 20px; +} + +.display-btn:focus { + border-color:#435334; +} + +.card { + background-color: #FAF1E4; +} + +.card-title { + color: #435334; +} + +.pagination-container { + color: #435334; +} + +.page-link { + color: #435334; +} + +.page-number, +.page-link:hover { + color: #9EB384; +} + +/* list view */ +.list-item-container { + min-height: 200px; + max-height: 300px; + overflow: hidden; +} + +.card-title h5:hover { + color: #9EB384; +} + +.more-info { + color: #435334; +} + +.more-info:hover { + border: 1px solid #435334; +} + +/* standard view */ +.square-box { + position: relative; + padding-top: 100%; + overflow: hidden; +} + +.square-box img { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + object-fit: cover; +} \ No newline at end of file diff --git a/web-app/django/VIM/apps/instruments/static/instruments/js/DisplayMode.js b/web-app/django/VIM/apps/instruments/static/instruments/js/DisplayMode.js new file mode 100644 index 0000000..6b5566b --- /dev/null +++ b/web-app/django/VIM/apps/instruments/static/instruments/js/DisplayMode.js @@ -0,0 +1,87 @@ + +const masonryBtn = document.getElementById("masonry-btn"); +const listBtn = document.getElementById("list-btn"); +const stdBtn = document.getElementById("std-btn"); + +const masonryView = document.getElementById('masonry-view'); +const listView = document.getElementById('list-view'); +const stdView = document.getElementById('std-view'); + +updateDisplayMode(); + +function setDisplayMode(displayMode) { + localStorage.setItem('displayMode', displayMode); +} + +function getDisplayMode() { + return localStorage.getItem('displayMode'); +} + +function updateDisplayMode() { + const currentDisplayMode = getDisplayMode() || 'masonry'; + switch (currentDisplayMode) { + case 'masonry': + setMasonryView(); + masonryBtn.style.display = ""; + listBtn.style.display = "none"; + stdBtn.style.display = "none"; + masonryView.style.display = ""; + listView.style.display = "none"; + stdView.style.display = "none"; + break; + case 'list': + masonryBtn.style.display = "none"; + listBtn.style.display = ""; + stdBtn.style.display = "none"; + masonryView.style.display = "none"; + listView.style.display = ""; + stdView.style.display = "none"; + break; + case 'standard': + masonryBtn.style.display = "none"; + listBtn.style.display = "none"; + stdBtn.style.display = ""; + masonryView.style.display = "none"; + listView.style.display = "none"; + stdView.style.display = ""; + break; + default: + break; + } +} + +// Switch to the next mode +masonryBtn.addEventListener("click", () => { + setDisplayMode('list'); + updateDisplayMode(); +}); + +listBtn.addEventListener("click", () => { + setDisplayMode('standard'); + updateDisplayMode(); +}); + +stdBtn.addEventListener("click", () => { + setDisplayMode('masonry'); + updateDisplayMode(); +}); + + +function setMasonryView() { + // Wait for the DOM to be fully loaded + document.addEventListener("DOMContentLoaded", function () { + // Initialize Masonry + var masonryGrid = document.getElementById("masonry-view"); + var masonry = new Masonry(masonryGrid, { + percentPosition: true, + }); + + // Initialize ImagesLoaded + var imgLoad = imagesLoaded(masonryGrid); + + // When all images are loaded, relayout Masonry + imgLoad.on("always", function () { + masonry.layout(); + }); + }); +} \ No newline at end of file diff --git a/web-app/django/VIM/apps/instruments/templates/instrument_list.html b/web-app/django/VIM/apps/instruments/templates/instrument_list.html deleted file mode 100644 index 5251fae..0000000 --- a/web-app/django/VIM/apps/instruments/templates/instrument_list.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -

Instrument List

- - - \ No newline at end of file diff --git a/web-app/django/VIM/apps/instruments/templates/instruments/index.html b/web-app/django/VIM/apps/instruments/templates/instruments/index.html new file mode 100644 index 0000000..4dc6f7a --- /dev/null +++ b/web-app/django/VIM/apps/instruments/templates/instruments/index.html @@ -0,0 +1,163 @@ +{% extends "base.html" %} +{% load static %} + +{% block title %} + Instrument List +{% endblock %} + +{% block css_files %} + +{% endblock %} + +{% block content %} +
+
+
+ +
+ +
+ +
+
+ {% include "instruments/masonryView.html" %} + {% include "instruments/listView.html" %} + {% include "instruments/stdView.html" %} +
+ +
+
    + {% if page_obj.has_previous %} +
  • + + + +
  • +
  • + + + +
  • + {% endif %} + +
  • + + Page + {{ page_obj.number }} + of + {{ page_obj.paginator.num_pages }} + +
  • + + {% if page_obj.has_next %} +
  • + + + +
  • +
  • + + + +
  • + {% endif %} +
+
+
+
+
+ +{% endblock %} + +{% block script %} + + + +{% endblock %} \ No newline at end of file diff --git a/web-app/django/VIM/apps/instruments/templates/instruments/listView.html b/web-app/django/VIM/apps/instruments/templates/instruments/listView.html new file mode 100644 index 0000000..4ecad36 --- /dev/null +++ b/web-app/django/VIM/apps/instruments/templates/instruments/listView.html @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/web-app/django/VIM/apps/instruments/templates/instruments/masonryView.html b/web-app/django/VIM/apps/instruments/templates/instruments/masonryView.html new file mode 100644 index 0000000..84353b8 --- /dev/null +++ b/web-app/django/VIM/apps/instruments/templates/instruments/masonryView.html @@ -0,0 +1,20 @@ +
+ {% for instrument in instruments %} +
+ +
+ instrument image +
+

+ {% for instrumentname in instrument.instrumentname_set.all %} + {% if instrumentname.language.en_label == "english" %} + {{ instrumentname.name|title }} + {% endif %} + {% endfor %} +

+
+
+
+
+ {% endfor %} +
\ No newline at end of file diff --git a/web-app/django/VIM/apps/instruments/templates/instruments/stdView.html b/web-app/django/VIM/apps/instruments/templates/instruments/stdView.html new file mode 100644 index 0000000..50ee72a --- /dev/null +++ b/web-app/django/VIM/apps/instruments/templates/instruments/stdView.html @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/web-app/django/VIM/apps/instruments/views/instrument_list.py b/web-app/django/VIM/apps/instruments/views/instrument_list.py index 3e6870b..3e5d6de 100644 --- a/web-app/django/VIM/apps/instruments/views/instrument_list.py +++ b/web-app/django/VIM/apps/instruments/views/instrument_list.py @@ -1,6 +1,7 @@ from django.views.generic import ListView from VIM.apps.instruments.models import Instrument + class InstrumentList(ListView): """ Provides a paginated list of all instruments in the database. @@ -8,7 +9,8 @@ class InstrumentList(ListView): Pass `page` and `paginate_by` as query parameters to control pagination. Defaults to 20 instruments per page. """ - template_name = "instrument_list.html" + + template_name = "instruments/index.html" context_object_name = "instruments" model = Instrument @@ -18,4 +20,9 @@ def get_paginate_by(self, queryset) -> int: paginate_by = int(pag_by_param) except ValueError: paginate_by = 20 - return paginate_by \ No newline at end of file + return paginate_by + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context["active_tab"] = "instruments" + return context diff --git a/web-app/django/VIM/apps/main/__init__.py b/web-app/django/VIM/apps/main/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/web-app/django/VIM/apps/main/admin.py b/web-app/django/VIM/apps/main/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/web-app/django/VIM/apps/main/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/web-app/django/VIM/apps/main/apps.py b/web-app/django/VIM/apps/main/apps.py new file mode 100644 index 0000000..a2d899c --- /dev/null +++ b/web-app/django/VIM/apps/main/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class MainConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "VIM.apps.main" diff --git a/web-app/django/VIM/apps/main/migrations/__init__.py b/web-app/django/VIM/apps/main/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/web-app/django/VIM/apps/main/models.py b/web-app/django/VIM/apps/main/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/web-app/django/VIM/apps/main/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/web-app/django/VIM/apps/main/static/main/index.css b/web-app/django/VIM/apps/main/static/main/index.css new file mode 100644 index 0000000..e69de29 diff --git a/web-app/django/VIM/apps/main/templates/main/about.html b/web-app/django/VIM/apps/main/templates/main/about.html new file mode 100644 index 0000000..9a4e811 --- /dev/null +++ b/web-app/django/VIM/apps/main/templates/main/about.html @@ -0,0 +1,16 @@ +{% extends "base.html" %} +{% load static %} + +{% block title %} + About +{% endblock %} + +{% block css_files %} + +{% endblock %} + +{% block content %} +{% endblock %} + +{% block script %} +{% endblock %} \ No newline at end of file diff --git a/web-app/django/VIM/apps/main/templates/main/index.html b/web-app/django/VIM/apps/main/templates/main/index.html new file mode 100644 index 0000000..a6d92ca --- /dev/null +++ b/web-app/django/VIM/apps/main/templates/main/index.html @@ -0,0 +1,16 @@ +{% extends "base.html" %} +{% load static %} + +{% block title %} + VIM +{% endblock %} + +{% block css_files %} + +{% endblock %} + +{% block content %} +{% endblock %} + +{% block script %} +{% endblock %} \ No newline at end of file diff --git a/web-app/django/VIM/apps/main/tests.py b/web-app/django/VIM/apps/main/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/web-app/django/VIM/apps/main/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/web-app/django/VIM/apps/main/urls.py b/web-app/django/VIM/apps/main/urls.py new file mode 100644 index 0000000..14baff0 --- /dev/null +++ b/web-app/django/VIM/apps/main/urls.py @@ -0,0 +1,9 @@ +from django.urls import path +from . import views + +app_name = "main" + +urlpatterns = [ + path("", views.home, name="home"), + path("about/", views.about, name="about"), +] diff --git a/web-app/django/VIM/apps/main/views.py b/web-app/django/VIM/apps/main/views.py new file mode 100644 index 0000000..70423e5 --- /dev/null +++ b/web-app/django/VIM/apps/main/views.py @@ -0,0 +1,9 @@ +from django.shortcuts import render + + +def home(request): + return render(request, "main/index.html", {"active_tab": "home"}) + + +def about(request): + return render(request, "main/about.html", {"active_tab": "about"}) diff --git a/web-app/django/VIM/settings.py b/web-app/django/VIM/settings.py index 6991da1..3c3e873 100644 --- a/web-app/django/VIM/settings.py +++ b/web-app/django/VIM/settings.py @@ -34,6 +34,7 @@ "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", + "VIM.apps.main", "VIM.apps.instruments", ] @@ -52,7 +53,9 @@ TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", - "DIRS": [], + "DIRS": [ + BASE_DIR / "VIM" / "templates", + ], "APP_DIRS": True, "OPTIONS": { "context_processors": [ @@ -115,6 +118,8 @@ STATIC_URL = "static/" +STATICFILES_DIRS = [BASE_DIR / "VIM" / "static"] + # Default primary key field type # https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field diff --git a/web-app/django/VIM/static/css/app.css b/web-app/django/VIM/static/css/app.css new file mode 100644 index 0000000..0552a41 --- /dev/null +++ b/web-app/django/VIM/static/css/app.css @@ -0,0 +1,89 @@ +@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@300;400;700&display=swap'); + +html { + font-family: 'Noto Sans', sans-serif; +} + +/* header */ +header { + background-color: #9EB384; +} + +.nav-link { + color: #FAF1E4; +} + +.nav-link:hover, +.nav-link:focus { + color: #435334; +} + +.active { + color: #435334 !important; + font-weight: 400 !important; + border-color: #435334 !important; +} + +.nav-home, +.nav-home:hover, +.nav-home:not(:hover) { /* on mouse leave */ + text-decoration: none; + color:#435334; + border-bottom: 0; +} + +.search-input { + background-color: #FAF1E4; + color: #435334; +} + +.search-input::placeholder{ + color: #435334; +} + +.search-input:focus { + background-color: #FAF1E4; + outline: none; /* Remove the outline */ + border: 1px solid #FAF1E4; +} + +.login-btn { + color: #FAF1E4; + border: 1px solid #FAF1E4; +} + +.login-btn:hover { + color: #435334; + border: 1px solid #FAF1E4; + background-color: #FAF1E4; +} + +.signup-btn { + color: #435334; +} + +.language-btn { + color:#435334; +} + +.language-btn:focus { + border-color:#435334; +} + +.dropdown-menu { + background-color: #FAF1E4; +} + +.dropdown-item:hover { + background-color: #CEDEBD; +} + +/* main */ +main { + background-color: #FAF1E4; +} + +/* footer */ +footer { + background-color: #FAF1E4; +} \ No newline at end of file diff --git a/web-app/django/VIM/static/images/lab-logo.png b/web-app/django/VIM/static/images/lab-logo.png new file mode 100644 index 0000000..ed6d9ee Binary files /dev/null and b/web-app/django/VIM/static/images/lab-logo.png differ diff --git a/web-app/django/VIM/static/images/logo.svg b/web-app/django/VIM/static/images/logo.svg new file mode 100644 index 0000000..a7d8233 --- /dev/null +++ b/web-app/django/VIM/static/images/logo.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/web-app/django/VIM/templates/404.html b/web-app/django/VIM/templates/404.html new file mode 100644 index 0000000..6069969 --- /dev/null +++ b/web-app/django/VIM/templates/404.html @@ -0,0 +1,10 @@ +{% extends "base.html" %} + +{% block title %} + Oops +{% endblock %} + +{% block content %} +

Oops

+

We can't seem to find the page you are looking for.

+{% endblock%} \ No newline at end of file diff --git a/web-app/django/VIM/templates/base.html b/web-app/django/VIM/templates/base.html new file mode 100644 index 0000000..bdcefe1 --- /dev/null +++ b/web-app/django/VIM/templates/base.html @@ -0,0 +1,74 @@ +{% load static %} + + + + + + + {% block title %}{% endblock %} + + + + + + {% block css_files %}{% endblock %} + + + + +
+
+
+ + + + +
+ + +
+ {% comment %} TODO: add language button {% endcomment %} + +
+
+
+ +
+ {% block content %} {% endblock %} +
+ + + + + {% block script %} {% endblock %} + + \ No newline at end of file diff --git a/web-app/django/VIM/urls.py b/web-app/django/VIM/urls.py index 7fd745b..eb49f92 100644 --- a/web-app/django/VIM/urls.py +++ b/web-app/django/VIM/urls.py @@ -16,9 +16,11 @@ """ from django.contrib import admin from django.urls import path +from django.urls import include from VIM.apps.instruments.views.instrument_list import InstrumentList urlpatterns = [ path("admin/", admin.site.urls), + path("", include("VIM.apps.main.urls", namespace="main")), path("instruments/", InstrumentList.as_view(), name="instrument-list"), ]