Skip to content

Commit

Permalink
Tweak the styles and behavior a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Sep 24, 2024
1 parent 7ac2f61 commit 61a0760
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 51 deletions.
66 changes: 24 additions & 42 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]"]
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:
- [email protected]
- [email protected]
- "@babel/core"
- "@babel/eslint-parser"
- "@babel/preset-env"
- id: validate-pyproject
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
38 changes: 38 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
8 changes: 4 additions & 4 deletions fhadmin/static/fhadmin/fhadmin.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
}
}

#quickpanel .module,
#quickpanel th,
#quickpanel td {
border-color: var(--border-color);
Expand All @@ -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;
}
11 changes: 6 additions & 5 deletions fhadmin/static/fhadmin/fhadmin.js
Original file line number Diff line number Diff line change
@@ -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")
})
}
Expand Down

0 comments on commit 61a0760

Please sign in to comment.