Complete Refactor - Changed to Django
This commit is contained in:
0
theme/__init__.py
Normal file
0
theme/__init__.py
Normal file
BIN
theme/__pycache__/__init__.cpython-312.pyc
Normal file
BIN
theme/__pycache__/__init__.cpython-312.pyc
Normal file
Binary file not shown.
5
theme/apps.py
Normal file
5
theme/apps.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class ThemeConfig(AppConfig):
|
||||
name = 'theme'
|
||||
1
theme/static/css/dist/styles.css
vendored
Normal file
1
theme/static/css/dist/styles.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
theme/static_src/.gitignore
vendored
Normal file
1
theme/static_src/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
1498
theme/static_src/package-lock.json
generated
Normal file
1498
theme/static_src/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
28
theme/static_src/package.json
Normal file
28
theme/static_src/package.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "theme",
|
||||
"version": "3.8.0",
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"start": "npm run dev",
|
||||
"build": "npm run build:clean && npm run build:tailwind",
|
||||
"build:clean": "rimraf ../static/css/dist",
|
||||
"build:tailwind": "cross-env NODE_ENV=production tailwindcss --postcss -i ./src/styles.css -o ../static/css/dist/styles.css --minify",
|
||||
"dev": "cross-env NODE_ENV=development tailwindcss --postcss -i ./src/styles.css -o ../static/css/dist/styles.css -w",
|
||||
"tailwindcss": "node ./node_modules/tailwindcss/lib/cli.js"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@tailwindcss/aspect-ratio": "^0.4.2",
|
||||
"@tailwindcss/forms": "^0.5.7",
|
||||
"@tailwindcss/typography": "^0.5.10",
|
||||
"cross-env": "^7.0.3",
|
||||
"postcss": "^8.4.32",
|
||||
"postcss-import": "^15.1.0",
|
||||
"postcss-nested": "^6.0.1",
|
||||
"postcss-simple-vars": "^7.0.1",
|
||||
"rimraf": "^5.0.5",
|
||||
"tailwindcss": "^3.4.0"
|
||||
}
|
||||
}
|
||||
7
theme/static_src/postcss.config.js
Normal file
7
theme/static_src/postcss.config.js
Normal file
@@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
plugins: {
|
||||
"postcss-import": {},
|
||||
"postcss-simple-vars": {},
|
||||
"postcss-nested": {}
|
||||
},
|
||||
}
|
||||
3
theme/static_src/src/styles.css
Normal file
3
theme/static_src/src/styles.css
Normal file
@@ -0,0 +1,3 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
57
theme/static_src/tailwind.config.js
Normal file
57
theme/static_src/tailwind.config.js
Normal file
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* This is a minimal config.
|
||||
*
|
||||
* If you need the full config, get it from here:
|
||||
* https://unpkg.com/browse/tailwindcss@latest/stubs/defaultConfig.stub.js
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
content: [
|
||||
/**
|
||||
* HTML. Paths to Django template files that will contain Tailwind CSS classes.
|
||||
*/
|
||||
|
||||
/* Templates within theme app (<tailwind_app_name>/templates), e.g. base.html. */
|
||||
'../templates/**/*.html',
|
||||
|
||||
/*
|
||||
* Main templates directory of the project (BASE_DIR/templates).
|
||||
* Adjust the following line to match your project structure.
|
||||
*/
|
||||
'../../templates/**/*.html',
|
||||
|
||||
/*
|
||||
* Templates in other django apps (BASE_DIR/<any_app_name>/templates).
|
||||
* Adjust the following line to match your project structure.
|
||||
*/
|
||||
'../../**/templates/**/*.html',
|
||||
|
||||
/**
|
||||
* JS: If you use Tailwind CSS in JavaScript, uncomment the following lines and make sure
|
||||
* patterns match your project structure.
|
||||
*/
|
||||
/* JS 1: Ignore any JavaScript in node_modules folder. */
|
||||
// '!../../**/node_modules',
|
||||
/* JS 2: Process all JavaScript files in the project. */
|
||||
// '../../**/*.js',
|
||||
|
||||
/**
|
||||
* Python: If you use Tailwind CSS classes in Python, uncomment the following line
|
||||
* and make sure the pattern below matches your project structure.
|
||||
*/
|
||||
// '../../**/*.py'
|
||||
],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [
|
||||
/**
|
||||
* '@tailwindcss/forms' is the forms plugin that provides a minimal styling
|
||||
* for forms. If you don't like it or have own styling for forms,
|
||||
* comment the line below to disable '@tailwindcss/forms'.
|
||||
*/
|
||||
require('@tailwindcss/forms'),
|
||||
require('@tailwindcss/typography'),
|
||||
require('@tailwindcss/aspect-ratio'),
|
||||
],
|
||||
}
|
||||
19
theme/templates/base.html
Normal file
19
theme/templates/base.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{% load static tailwind_tags %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Django Tailwind</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
{% tailwind_css %}
|
||||
</head>
|
||||
|
||||
<body class="bg-gray-50 font-serif leading-normal tracking-normal">
|
||||
<div class="container mx-auto">
|
||||
<section class="flex items-center justify-center h-screen">
|
||||
<h1 class="text-5xl">Django + Tailwind = ❤️</h1>
|
||||
</section>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
13
theme/templates/unfold/dashboard.html
Normal file
13
theme/templates/unfold/dashboard.html
Normal file
@@ -0,0 +1,13 @@
|
||||
{% extends "unfold/admin/base_site.html" %}
|
||||
{% block content %}
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div class="bg-white dark:bg-gray-900 p-6 rounded-2xl shadow">
|
||||
<h2 class="text-xl font-semibold mb-2">Users</h2>
|
||||
<p class="text-3xl font-bold">{{ user_count }}</p>
|
||||
</div>
|
||||
<div class="bg-white dark:bg-gray-900 p-6 rounded-2xl shadow">
|
||||
<h2 class="text-xl font-semibold mb-2">Groups</h2>
|
||||
<p class="text-3xl font-bold">{{ group_count }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user