diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 00000000..654198f9
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,42 @@
+name: "CodeQL"
+
+on:
+ push:
+ branches: [ "main" ]
+ pull_request:
+ branches: [ "main" ]
+ schedule:
+ - cron: "3 23 * * 5"
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ubuntu-latest
+ permissions:
+ actions: read
+ contents: read
+ security-events: write
+
+ strategy:
+ fail-fast: false
+ matrix:
+ language: [ javascript, python ]
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v2
+ with:
+ languages: ${{ matrix.language }}
+ queries: +security-and-quality
+
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@v2
+ if: ${{ matrix.language == 'javascript' || matrix.language == 'python' }}
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v2
+ with:
+ category: "/language:${{ matrix.language }}"
diff --git a/backend/settings.py b/backend/settings.py
index eaf6fb24..19b80d8c 100644
--- a/backend/settings.py
+++ b/backend/settings.py
@@ -56,28 +56,28 @@
# some content plugins - optional, but used in most projects
'djangocms_file',
'djangocms_icon',
- 'djangocms_link',
'djangocms_picture',
'djangocms_style',
'djangocms_googlemap',
'djangocms_video',
- # optional django CMS Bootstrap 4 modules
- 'djangocms_bootstrap4',
- 'djangocms_bootstrap4.contrib.bootstrap4_alerts',
- 'djangocms_bootstrap4.contrib.bootstrap4_badge',
- 'djangocms_bootstrap4.contrib.bootstrap4_card',
- 'djangocms_bootstrap4.contrib.bootstrap4_carousel',
- 'djangocms_bootstrap4.contrib.bootstrap4_collapse',
- 'djangocms_bootstrap4.contrib.bootstrap4_content',
- 'djangocms_bootstrap4.contrib.bootstrap4_grid',
- 'djangocms_bootstrap4.contrib.bootstrap4_jumbotron',
- 'djangocms_bootstrap4.contrib.bootstrap4_link',
- 'djangocms_bootstrap4.contrib.bootstrap4_listgroup',
- 'djangocms_bootstrap4.contrib.bootstrap4_media',
- 'djangocms_bootstrap4.contrib.bootstrap4_picture',
- 'djangocms_bootstrap4.contrib.bootstrap4_tabs',
- 'djangocms_bootstrap4.contrib.bootstrap4_utilities',
+ # optional django CMS Frontend modules
+ 'djangocms_frontend',
+ 'djangocms_frontend.contrib.accordion',
+ 'djangocms_frontend.contrib.alert',
+ 'djangocms_frontend.contrib.badge',
+ 'djangocms_frontend.contrib.card',
+ 'djangocms_frontend.contrib.carousel',
+ 'djangocms_frontend.contrib.collapse',
+ 'djangocms_frontend.contrib.content',
+ 'djangocms_frontend.contrib.grid',
+ 'djangocms_frontend.contrib.jumbotron',
+ 'djangocms_frontend.contrib.link',
+ 'djangocms_frontend.contrib.listgroup',
+ 'djangocms_frontend.contrib.media',
+ 'djangocms_frontend.contrib.image',
+ 'djangocms_frontend.contrib.tabs',
+ 'djangocms_frontend.contrib.utilities',
]
MIDDLEWARE = [
@@ -123,14 +123,24 @@
},
]
+THUMBNAIL_PROCESSORS = (
+ 'easy_thumbnails.processors.colorspace',
+ 'easy_thumbnails.processors.autocrop',
+ #'easy_thumbnails.processors.scale_and_crop',
+ 'filer.thumbnail_processors.scale_and_crop_with_subject_location',
+ 'easy_thumbnails.processors.filters',
+)
+
+
CMS_TEMPLATES = [
# a minimal template to get started with
('minimal.html', 'Minimal template'),
- ('whitenoise-static-files-demo.html', 'Static File Demo'),
# optional templates that extend base.html, to be used with Bootstrap 5
- ('page.html', 'Bootstrap 4 Demo'),
- ('feature.html', 'Bootstrap 4 Demo with two placeholders')
+ ('bootstrap5.html', 'Bootstrap 5 Demo'),
+
+ # serving static files with whitenoise demo
+ ('whitenoise-static-files-demo.html', 'Static File Demo'),
]
WSGI_APPLICATION = 'backend.wsgi.application'
@@ -144,6 +154,7 @@
DATABASE_URL = os.environ.get('DATABASE_URL', 'sqlite://:memory:')
DATABASES = {'default': dj_database_url.parse(DATABASE_URL)}
+DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
diff --git a/backend/templates/base.html b/backend/templates/base.html
index f628a2a4..194eaf3a 100644
--- a/backend/templates/base.html
+++ b/backend/templates/base.html
@@ -1,37 +1,34 @@
-{% load cms_tags static sekizai_tags menu_tags %}
-
-
-
-
- {% block title %}This is my new project home page{% endblock title %}
-
-
-
- {% render_block "css" %}
+{% load cms_tags menu_tags sekizai_tags static i18n %}{% spaceless %}
+
+
+
+
+
+ {% block meta %}
+
+
+
+
+ {% endblock meta %}
+ {% block canonical_url %}
+
+
+ {% endblock canonical_url %}
+ {% block fb_meta %}{% endblock fb_meta %}
+ {% block title %}{% page_attribute "page_title" %}{% endblock %}
+ {% block base_css %}{% endblock %}
+{% endspaceless %}{% render_block 'css' %}{% spaceless %}
+ {% block page_head %}{% endblock %}
- {% block title %}This is my new project home page{% endblock title %}
- {% cms_toolbar %}
-
-
-
-
-
- {% show_menu 0 1 100 100 "menu.html" %}
-
-
-
- {% block content %}{% endblock content %}
-
-
-
-
-
-
- {% render_block "js" %}
+
+{% endspaceless %}{% cms_toolbar %}{% spaceless %}
+ {% block navbar %}{% endblock %}
+ {% block content %}
+ {% placeholder "Content" %}
+ {% endblock content %}
+ {% block base_js %}{% endblock %}
+{% endspaceless %}{% render_block 'js' %}{% spaceless %}
+ {% block end_js %}{% endblock %}
+ {% block bottom_css %}{% endblock %}
-
+ {% endspaceless %}
diff --git a/backend/templates/bootstrap5.html b/backend/templates/bootstrap5.html
new file mode 100644
index 00000000..c6341ae3
--- /dev/null
+++ b/backend/templates/bootstrap5.html
@@ -0,0 +1,21 @@
+{% extends "base.html" %}{% load cms_tags menu_tags %}
+{% block base_css %}
+
+{% endblock %}
+{% block base_js %}
+
+{% endblock %}
+{% block navbar %}
+
+{% endblock %}
diff --git a/backend/templates/feature.html b/backend/templates/feature.html
deleted file mode 100644
index 73bf355c..00000000
--- a/backend/templates/feature.html
+++ /dev/null
@@ -1,13 +0,0 @@
-{% extends "base.html" %}
-{% load cms_tags %}
-
-{% block title %}{% page_attribute "page_title" %}{% endblock title %}
-
-{% block content %}
-
- {% placeholder "feature" %}
-
-
- {% placeholder "content" %}
-
-{% endblock content %}
diff --git a/backend/templates/menu.html b/backend/templates/menu.html
deleted file mode 100644
index 34233cc5..00000000
--- a/backend/templates/menu.html
+++ /dev/null
@@ -1,19 +0,0 @@
-{% load i18n menu_tags cache %}
-
-{% for child in children %}
-
- {% if child.children %}
-
- {{ child.get_menu_title }}
-
-
- {% show_menu from_level to_level extra_inactive extra_active template "" "" child %}
-
- {% else %}
- {{ child.get_menu_title }}
- {% endif %}
-
- {% if class and forloop.last and not forloop.parentloop %}{% endif %}
-{% endfor %}
diff --git a/backend/templates/menu/dropdown.html b/backend/templates/menu/dropdown.html
new file mode 100644
index 00000000..2108ba0e
--- /dev/null
+++ b/backend/templates/menu/dropdown.html
@@ -0,0 +1,7 @@
+{% load i18n menu_tags cache %}
+{% for child in children %}
+ {% if child.get_menu_title|first == ' ' %}
+
+ {% endif %}
+ {{ child.get_menu_title }}
+{% endfor %}
diff --git a/backend/templates/menu/menu.html b/backend/templates/menu/menu.html
new file mode 100644
index 00000000..f8560c95
--- /dev/null
+++ b/backend/templates/menu/menu.html
@@ -0,0 +1,13 @@
+{% load i18n menu_tags cache %}{% spaceless %}
+ {% for child in children %}
+
+ {% if child.children %}
+
+ {% show_menu from_level to_level extra_inactive extra_active "menu/dropdown.html" "" "" child %}
+
+ {% else %}
+ {{ child.get_menu_title }}
+ {% endif %}
+
+ {% endfor %}
+{% endspaceless %}
diff --git a/backend/templates/minimal.html b/backend/templates/minimal.html
index 02bc1b90..df148364 100644
--- a/backend/templates/minimal.html
+++ b/backend/templates/minimal.html
@@ -6,7 +6,7 @@
{% cms_toolbar %}
- {% placeholder "content" %}
+ {% placeholder "Content" %}
{% render_block "js" %}
diff --git a/backend/templates/page.html b/backend/templates/page.html
deleted file mode 100644
index b095172d..00000000
--- a/backend/templates/page.html
+++ /dev/null
@@ -1,8 +0,0 @@
-{% extends "base.html" %}
-{% load cms_tags %}
-
-{% block title %}{% page_attribute "page_title" %}{% endblock title %}
-
-{% block content %}
- {% placeholder "content" %}
-{% endblock content %}
diff --git a/backend/templates/whitenoise-static-files-demo.html b/backend/templates/whitenoise-static-files-demo.html
index bf02b563..39cccfbb 100644
--- a/backend/templates/whitenoise-static-files-demo.html
+++ b/backend/templates/whitenoise-static-files-demo.html
@@ -9,7 +9,7 @@
- {% placeholder "content" %}
+ {% placeholder "Content" %}
{% render_block "js" %}