[FEAT] Add Bootstrap theming through admin dashboard

This commit is contained in:
2023-02-24 19:43:34 +00:00
parent 86e18c399d
commit 843bdebabf
7 changed files with 23 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
[
{
"model": "bootstrap_customizer.sitebootstraptheme",
"pk": 1,
"fields": { "site": 1, "bootstrap_theme": 1, "updated": "2023-02-23T14:41:48.620Z" }
}
]

File diff suppressed because one or more lines are too long

View File

@@ -206,6 +206,7 @@ THIRD_PARTY_APPS = [
'allauth.socialaccount.providers.google',
'allauth.socialaccount.providers.microsoft',
'django_inlinecss',
'bootstrap_customizer',
]
FIRST_PARTY_APPS = [
@@ -227,6 +228,7 @@ MIDDLEWARE = [
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'hijack.middleware.HijackUserMiddleware',
'django.contrib.sites.middleware.CurrentSiteMiddleware',
'bootstrap_customizer.middleware.BootstrapThemeMiddleware',
]
FIXTURE_DIRS = [

View File

@@ -4,6 +4,7 @@
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
{% endif %}
{% load bootstrap_customizer %}
<html lang="{{ LANGUAGE_CODE|default:'en_us' }}">
{% load pwa %}
@@ -19,6 +20,9 @@
<!-- Bootstrap CSS -->
{% bootstrap_css %}
<style lang="css">
{% bootstrap_theme_css_above_the_fold %}
</style>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/fontawesome.min.css"
@@ -61,6 +65,7 @@
</head>
<body>
<link rel="stylesheet" type="text/css" href="{% bootstrap_theme_css_below_the_fold_url %}" />
<div class="content" style="display: flex; flex-direction: column">
{% block navbar %}
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">

View File

@@ -17,6 +17,7 @@ from django.contrib import admin
from django.conf import settings
from django.urls import include, path
from django.conf.urls.static import static
from bootstrap_customizer import urls as bootstrap_customizer_urls
from . import views
@@ -55,4 +56,7 @@ urlpatterns = [
path('accounts/',
include('allauth.urls')),
path('bootstrap_customizer',
include(bootstrap_customizer_urls)),
] # yapf: disable

View File

@@ -4,6 +4,8 @@ set -eo pipefail
python manage.py migrate
echo "[{\"model\": \"sites.site\",\"pk\": 1,\"fields\": { \"domain\": \"${SITE_URL}\", \"name\": \"${PROJECT_SHORT_NAME}\" }}]" | python manage.py loaddata --format=json -
python manage.py selectiveloaddata breccia_mapper/fixtures/bootstrap_customizer_theme.json
python manage.py loaddata --format=json bootstrap_customizer_sitetheme
python manage.py collectstatic --no-input
exec "$@"

View File

@@ -46,4 +46,5 @@ typed-ast
wrapt==1.14.1
Pillow==9.4.0
django-allauth
django-inlinecss-redux
django-inlinecss-redux
django-bootstrap-customizer