Update tailwind to v3, various wangling

This commit is contained in:
2023-05-16 17:48:25 +01:00
parent c55577e04e
commit 57c730a2cf
14 changed files with 6821 additions and 183615 deletions

View File

@@ -12,4 +12,4 @@ django-reversion = "*"
[dev-packages] [dev-packages]
[requires] [requires]
python_version = "3.8" python_version = "3.10"

57
Pipfile.lock generated
View File

@@ -1,11 +1,11 @@
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "6cab97299da689eabef18022a5ecc8898bc04de8cf1f66a3edae938c348e6976" "sha256": "68bdb29cd524e36b810214289b254227c5f1ca9d18c311b7e49f9d4cd1f3e7e3"
}, },
"pipfile-spec": 6, "pipfile-spec": 6,
"requires": { "requires": {
"python_version": "3.8" "python_version": "3.10"
}, },
"sources": [ "sources": [
{ {
@@ -18,58 +18,59 @@
"default": { "default": {
"asgiref": { "asgiref": {
"hashes": [ "hashes": [
"sha256:5ee950735509d04eb673bd7f7120f8fa1c9e2df495394992c73234d526907e17", "sha256:71e68008da809b957b7ee4b43dbccff33d1b23519fb8344e33f049897077afac",
"sha256:7162a3cb30ab0609f1a4c95938fd73e8604f63bdba516a7f7d64b83ff09478f0" "sha256:9567dfe7bd8d3c8c892227827c41cce860b368104c3431da67a0c5a65a949506"
], ],
"markers": "python_version >= '3.5'", "markers": "python_version >= '3.7'",
"version": "==3.3.1" "version": "==3.6.0"
}, },
"django": { "django": {
"hashes": [ "hashes": [
"sha256:169e2e7b4839a7910b393eec127fd7cbae62e80fa55f89c6510426abf673fe5f", "sha256:066b6debb5ac335458d2a713ed995570536c8b59a580005acb0732378d5eb1ee",
"sha256:c6c0462b8b361f8691171af1fb87eceb4442da28477e12200c40420176206ba7" "sha256:7efa6b1f781a6119a10ac94b4794ded90db8accbe7802281cd26f8664ffed59c"
], ],
"index": "pypi", "index": "pypi",
"version": "==3.1.6" "version": "==4.2.1"
},
"django-browser-reload": {
"hashes": [
"sha256:054ef5ce8b80f46e0beda1a3c847becdff51272cad6f2bda607e201a7afe7425",
"sha256:6db7e6c5807fff87e421b53926c50cfa3de0115e438f3c2de6103d3069557adb"
],
"markers": "python_version >= '3.7'",
"version": "==1.8.0"
}, },
"django-registration-redux": { "django-registration-redux": {
"hashes": [ "hashes": [
"sha256:e3d123354a1b8cbfa005d60f1ebb89ae8541f3eaffd6174d9f2aff529b57e430", "sha256:2213bbe8732be72724034f4146f0255a7bd666eb5a5e1b2d8d8aa633fe8af894",
"sha256:e94b8a945e1cbfa9ec6c32b549597270405328d4e26651985d287d0211120691" "sha256:56fbc7b01a7f0f48812fe4d4e0729d2dac916e16f8aaed36b3f10129f2df9d0f"
], ],
"index": "pypi", "index": "pypi",
"version": "==2.9" "version": "==2.12"
}, },
"django-reversion": { "django-reversion": {
"hashes": [ "hashes": [
"sha256:1b57127a136b969f4b843a915c72af271febe7f336469db6c27121f8adcad35c", "sha256:a591cbce8621b5d036a37617554668b5ef2eb9777682e3af20b6401ee87cfbc5",
"sha256:a5af55f086a3f9c38be2f049c251e06005b9ed48ba7a109473736b1fc95a066f" "sha256:c12bab452d31dd3c244456cf1df383acf14ba147cf99404c5e44412596de42fc"
], ],
"index": "pypi", "index": "pypi",
"version": "==3.0.9" "version": "==5.0.4"
}, },
"django-tailwind": { "django-tailwind": {
"hashes": [ "hashes": [
"sha256:2c1bf6c91fc54c844b85e8b379c211c971a2827c3d5b84f7e0464485ef9b8adf", "sha256:c089b05b47d0e9d19567a81a74949fde16cbbfd8e4264c1f8eb4216a644065b2",
"sha256:d3aadba6aa046ead22efc68584b9ddccd0f25ccfbad433bb4727bee684a02177" "sha256:dcc3b29463fff48a0e8ccd15c87fd467f0e746a7987bde0fdde6253dbb7861be"
], ],
"index": "pypi", "index": "pypi",
"version": "==1.1.1" "version": "==3.5.0"
},
"pytz": {
"hashes": [
"sha256:83a4a90894bf38e243cf052c8b58f381bfe9a7a483f6a9cab140bc7f702ac4da",
"sha256:eb10ce3e7736052ed3623d49975ce333bcd712c7bb19a58b9e2089d4057d0798"
],
"version": "==2021.1"
}, },
"sqlparse": { "sqlparse": {
"hashes": [ "hashes": [
"sha256:017cde379adbd6a1f15a61873f43e8274179378e95ef3fede90b5aa64d304ed0", "sha256:5430a4fe2ac7d0f93e66f1efc6e1338a41884b7ddf2a350cedd20ccc4d9d28f3",
"sha256:0f91fd2e829c44362cbcfab3e9ae12e22badaa8a29ad5ff599f9ec109f0454e8" "sha256:d446183e84b8349fa3061f0fe7f06ca94ba65b426946ffebe6e3e8295332420c"
], ],
"markers": "python_version >= '3.5'", "markers": "python_version >= '3.5'",
"version": "==0.4.1" "version": "==0.4.4"
} }
}, },
"develop": {} "develop": {}

View File

@@ -11,6 +11,8 @@ https://docs.djangoproject.com/en/3.1/ref/settings/
""" """
from pathlib import Path from pathlib import Path
from django.forms.renderers import TemplatesSetting
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = Path(__file__).resolve().parent.parent
@@ -35,6 +37,7 @@ if DEBUG:
INSTALLED_APPS = [ INSTALLED_APPS = [
# Django # Django
'django.forms',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
@@ -133,3 +136,8 @@ USE_TZ = True
STATIC_URL = '/static/' STATIC_URL = '/static/'
TAILWIND_APP_NAME = 'theme' TAILWIND_APP_NAME = 'theme'
class CustomFormRenderer(TemplatesSetting):
form_template_name = "custom_form.html"
FORM_RENDERER = "core.settings.CustomFormRenderer"

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

6475
theme/static_src/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -16,15 +16,19 @@
"author": "", "author": "",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"autoprefixer": "^10.0.2", "@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/line-clamp": "^0.4.4",
"@tailwindcss/typography": "^0.5.9",
"autoprefixer": "^10.4.14",
"clean-css-cli": "^4.3.0", "clean-css-cli": "^4.3.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"node-sass": "^5.0.0", "node-sass": "^5.0.0",
"postcss": "^8.1.9", "postcss": "^8.4.23",
"postcss-cli": "^8.3.0", "postcss-cli": "^8.3.0",
"postcss-scss": "^3.0.4", "postcss-scss": "^3.0.4",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"tailwindcss": "^2.0.1", "tailwindcss": "^3.3.2",
"watch": "^1.0.2" "watch": "^1.0.2"
} }
} }

View File

@@ -1,3 +1,7 @@
@tailwind base; @tailwind base;
@tailwind components; @tailwind components;
@tailwind utilities; @tailwind utilities;
input {
color: black;
}

View File

@@ -2,14 +2,10 @@
// If you need the full config, get it from here: // If you need the full config, get it from here:
// https://unpkg.com/browse/tailwindcss@latest/stubs/defaultConfig.stub.js // https://unpkg.com/browse/tailwindcss@latest/stubs/defaultConfig.stub.js
module.exports = { module.exports = {
purge: [ content: [
// Templates within theme app (e.g. base.html)
'../templates/**/*.html', '../templates/**/*.html',
// Templates in other apps. Uncomment the following line if it matches
// your project structure or change it to match.
'../../templates/**/*.html', '../../templates/**/*.html',
], ],
darkMode: 'media',
theme: { theme: {
extend: {}, extend: {},
}, },

View File

@@ -0,0 +1,3 @@
{% for field in form %}
{{ field.label_tag }} {{ field }} <br/>
{% endfor %}

View File

@@ -30,7 +30,7 @@ class Vehicle(models.Model):
name = models.CharField(max_length=50) name = models.CharField(max_length=50)
# color # color
yom = models.DateField() yom = models.DateField(verbose_name="Year of Manufacture")
first_registered = models.DateField() first_registered = models.DateField()
date_purchased = models.DateField() date_purchased = models.DateField()

View File

@@ -0,0 +1,9 @@
{% extends 'base.html' %}
{% block content %}
<form action="{% url 'vehicle_create' %}" method="post">
{% csrf_token %}
{{ form }}
<input type="submit" value="Submit">
</form>
{% endblock %}

View File

@@ -4,5 +4,6 @@ from . import views
urlpatterns = [ urlpatterns = [
path('list/', views.VehicleList.as_view(), name='vehicle_list'), path('list/', views.VehicleList.as_view(), name='vehicle_list'),
path('<int:pk>/', views.VehicleDetail.as_view(), name='vehicle_detail') path('<int:pk>/', views.VehicleDetail.as_view(), name='vehicle_detail'),
path('create/', views.VehicleCreate.as_view(), name='vehicle_create'),
] ]

View File

@@ -12,3 +12,9 @@ class VehicleList(generic.ListView):
class VehicleDetail(generic.DetailView): class VehicleDetail(generic.DetailView):
template_name = 'vehicle_detail.html' template_name = 'vehicle_detail.html'
model = Vehicle model = Vehicle
class VehicleCreate(generic.CreateView):
template_name = 'vehicle_form.html'
model = Vehicle
fields = "__all__"