From 2cbd101c85c5e7e39a992f8e60ec7ecaaca3fe6a Mon Sep 17 00:00:00 2001 From: j Date: Mon, 11 Oct 2021 13:26:51 +0100 Subject: [PATCH] page backend --- app/static/js/menu.js | 8 ++++ app/templates/page.html | 8 ++++ .../migrations/0003_auto_20211011_1222.py | 47 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 app/static/js/menu.js create mode 100644 app/templates/page.html create mode 100644 app/text/migrations/0003_auto_20211011_1222.py diff --git a/app/static/js/menu.js b/app/static/js/menu.js new file mode 100644 index 0000000..b54beeb --- /dev/null +++ b/app/static/js/menu.js @@ -0,0 +1,8 @@ +document.querySelectorAll(".topnav a.icon").forEach(a => { + a.onclick = (event) => { + var nav = document.querySelector('.topnav nav') + nav.style.display = nav.style.display === 'block' ? 'none' : 'block' + event.preventDefault() + event.stopPropagation() + } +}) diff --git a/app/templates/page.html b/app/templates/page.html new file mode 100644 index 0000000..f09788e --- /dev/null +++ b/app/templates/page.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} +{% block title %}{{ page.title }}– Phantas.ma/polis{% endblock title %} +{% block main %} +
+ {{ page.body | safe }} +
+{% endblock %} + diff --git a/app/text/migrations/0003_auto_20211011_1222.py b/app/text/migrations/0003_auto_20211011_1222.py new file mode 100644 index 0000000..335ee72 --- /dev/null +++ b/app/text/migrations/0003_auto_20211011_1222.py @@ -0,0 +1,47 @@ +# Generated by Django 3.2.7 on 2021-10-11 12:22 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('text', '0002_rename_essay_text'), + ] + + operations = [ + migrations.RemoveField( + model_name='page', + name='teaser', + ), + migrations.AlterField( + model_name='page', + name='body', + field=models.TextField(blank=True), + ), + migrations.AlterField( + model_name='page', + name='data', + field=models.JSONField(blank=True, default=dict), + ), + migrations.AlterField( + model_name='page', + name='slug', + field=models.SlugField(blank=True), + ), + migrations.AlterField( + model_name='page', + name='title', + field=models.TextField(blank=True), + ), + migrations.AlterField( + model_name='text', + name='body', + field=models.TextField(blank=True, default=''), + ), + migrations.AlterField( + model_name='text', + name='teaser', + field=models.TextField(blank=True, default=''), + ), + ]