diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 515b020..aa39001 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,57 +1,39 @@ -exclude: ".yarn/|yarn.lock" +exclude: ".yarn/|yarn.lock|\\.min\\.(css|js)$" repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.6.0 hooks: - id: check-added-large-files + - id: check-builtin-literals + - id: check-executables-have-shebangs - id: check-merge-conflict + - id: check-toml + - id: check-yaml + - id: detect-private-key - id: end-of-file-fixer + - id: mixed-line-ending - id: trailing-whitespace - - repo: local - hooks: - - id: django-check - name: django check - entry: sh -c 'stat venv/bin/python && venv/bin/python manage.py check || echo "Skipped"' - pass_filenames: false - language: system - always_run: true - - repo: https://github.com/asottile/pyupgrade - rev: v2.31.0 - hooks: - - id: pyupgrade - args: [--py39-plus] - repo: https://github.com/adamchainz/django-upgrade - rev: 1.4.0 + rev: 1.21.0 hooks: - id: django-upgrade args: [--target-version, "3.2"] - - repo: https://github.com/pycqa/isort - rev: 5.10.1 - hooks: - - id: isort - args: [--profile=black, --lines-after-imports=2, --combine-as] - - repo: https://github.com/psf/black - rev: 22.1.0 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.6.4" hooks: - - id: black - - repo: https://github.com/pycqa/flake8 - rev: 4.0.1 + - id: ruff + - id: ruff-format + - repo: https://github.com/biomejs/pre-commit + rev: "v0.4.0" hooks: - - id: flake8 - args: ["--ignore=E203,E501,W503"] - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.5.1 + - id: biome-check + additional_dependencies: ["@biomejs/biome@1.8.1"] + args: [--unsafe] + - repo: https://github.com/tox-dev/pyproject-fmt + rev: 2.2.3 hooks: - - id: prettier - args: [--list-different, --no-semi] - exclude: "^conf/|.*\\.html$" - - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.9.0 + - id: pyproject-fmt + - repo: https://github.com/abravalheri/validate-pyproject + rev: v0.19 hooks: - - id: eslint - additional_dependencies: - - eslint@8.9.0 - - eslint-config-prettier@8.3.0 - - "@babel/core" - - "@babel/eslint-parser" - - "@babel/preset-env" + - id: validate-pyproject diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 40df3ae..ecb41e9 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,6 +15,9 @@ Change log - Started raising an ``ImproperlyConfigured`` exception when encountering a ``FHADMIN_GROUPS`` configuration without ``FHADMIN_GROUPS_REMAINING``. - Added Python 3.12, Django 4.2, Django 5.1. +- Tweaked the styles a bit. +- Avoided navigating to the admin index when clicking the main title, expand + the panel instead. `2.2`_ (2022-02-24) diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..051d02c --- /dev/null +++ b/biome.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.8.1/schema.json", + "organizeImports": { + "enabled": false + }, + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentWidth": 2 + }, + "javascript": { + "formatter": { + "semicolons": "asNeeded" + } + }, + "css": { + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentWidth": 2 + }, + "linter": { + "enabled": true + } + }, + "linter": { + "enabled": true, + "rules": { + "complexity": { + "noForEach": "off", + "useOptionalChain": "off" + }, + "suspicious": { + "noAssignInExpressions": "off" + } + } + } +} diff --git a/fhadmin/static/fhadmin/fhadmin.css b/fhadmin/static/fhadmin/fhadmin.css index 5bef74a..79d9716 100644 --- a/fhadmin/static/fhadmin/fhadmin.css +++ b/fhadmin/static/fhadmin/fhadmin.css @@ -86,7 +86,6 @@ } } -#quickpanel .module, #quickpanel th, #quickpanel td { border-color: var(--border-color); @@ -95,16 +94,17 @@ #quickpanel .module table th { width: 100%; } + #quickpanel tr:last-child td, #quickpanel tr:last-child th { border-bottom: none; } -#quickpanel .caption { - color: #3b3b3b; +#quickpanel caption { + background: var(--breadcrumbs-bg); } .groups a.addlink { position: relative; - right: -10px; + right: -4px; } diff --git a/fhadmin/static/fhadmin/fhadmin.js b/fhadmin/static/fhadmin/fhadmin.js index 7037adf..be63539 100644 --- a/fhadmin/static/fhadmin/fhadmin.js +++ b/fhadmin/static/fhadmin/fhadmin.js @@ -1,13 +1,14 @@ -document.addEventListener("DOMContentLoaded", function () { - document - .querySelectorAll(".groups a.addlink") - .forEach((el) => (el.innerHTML = " ")) +document.addEventListener("DOMContentLoaded", () => { + for (const el of document.querySelectorAll(".groups a.addlink")) { + el.innerText = "" + } const quickpanel = document.getElementById("quickpanel") const header = document.querySelector("#header h1") if (quickpanel && header) { document.body.classList.add("qp-active") - header.addEventListener("click", () => { + header.addEventListener("click", (e) => { + e.preventDefault() document.body.classList.toggle("qp-open") }) }