Skip to content

Commit

Permalink
Merge branch 'main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
katiam2 authored Dec 1, 2024
2 parents 390a8ed + 92a8f35 commit accbcd1
Show file tree
Hide file tree
Showing 91 changed files with 1,705 additions and 11,055 deletions.
31 changes: 31 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## Changes
$CHANGES
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
name: Build
on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
max-parallel: 5
matrix:
python-version: [3.7, 3.8, 3.9, '3.10']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
Expand All @@ -35,7 +35,7 @@ jobs:
run: tox

- name: cache deps
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.tox
key: deps-${{ hashFiles('**/pyproject.toml') }}
Expand Down
90 changes: 83 additions & 7 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,100 @@
name: Deploy to test.pypi.org
on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [main]

# Only allow the latest workflow to run and cancel all others. There is also job-level concurrency
# enabled (see below), which is specified slightly differently.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# Build the python package even on PRs to ensure we're able to build the package properly.
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: pip

- name: Install dependencies
run: python -m pip install --upgrade pip poetry

- name: Building the wheels
run: |
# Need to check both Test PyPi and GH releases as we need to version bump the patch
# version everytime we merge in a PR, but once we release a new production release, we
# need to bump from the new release. So we grab the latest releases from both sources,
# then reverse sort them to get highest version! Simples :D
LATEST_RELEASE_TEST_PYPI=$(curl -s https://test.pypi.org/rss/project/django-jazzmin/releases.xml | sed -n 's/\s*<title>\([{a,b}0-9.]*\).*/\1/p' | head -n 2 | xargs)
LATEST_RELEASE_GITHUB=$(curl -s "https://api.github.com/repos/farridav/django-jazzmin/tags" | jq -r '.[0].name[1:]')
LATEST_RELEASE=$(printf "${LATEST_RELEASE_GITHUB}\n${LATEST_RELEASE_TEST_PYPI}" | sort -V -r | head -n 1)
# Now we can bump the version correctly to release a new version nicely base on the
# latest GH release.
poetry version $LATEST_RELEASE
poetry version prerelease # Using `prerelease` rather than `prepatch` due to a bug in Poetry (latest checked 1.8.1 - https://github.com/python-poetry/poetry/issues/879)
poetry build
- name: Save build
uses: actions/cache/save@v4
id: build-cache
with:
path: |
dist/
key: cache-${{ github.run_id }}-${{ github.run_attempt }}

deploy:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: pip

- name: Install dependencies
run: python -m pip install --upgrade pip poetry

- name: Get build
uses: actions/cache/restore@v4
with:
path: |
dist/
key: cache-${{ github.run_id }}-${{ github.run_attempt }}

- name: Configure Poetry test repo
run: poetry config repositories.test_pypi https://test.pypi.org/legacy/

- name: Deploy to testpypi.org
run: |
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry publish --build -r testpypi --username ${{ secrets.TESTPYPI_USERNAME }} --password ${{ secrets.TESTPYPI_PASSWORD }} || :
if: github.ref == 'refs/heads/main'
run: poetry publish -r test_pypi --dist-dir dist/ --username __token__ --password ${{ secrets.TEST_PYPI_TOKEN }} || true

- name: Deploy to testpypi.org (Dry Run)
if: github.ref != 'refs/heads/main'
run: poetry publish -r test_pypi --dist-dir dist/ --username __token__ --password ${{ secrets.TEST_PYPI_TOKEN }} || true

update_release_draft:
permissions:
contents: write
pull-requests: read
runs-on: ubuntu-latest
needs: deploy
if: github.ref == 'refs/heads/main'
steps:
- uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter.yml
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
name: Deploy to pypi.org
on:
release:
types: [published, created, edited]
types: published

jobs:
deploy:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: pip
Expand All @@ -20,6 +20,6 @@ jobs:
run: python -m pip install --upgrade pip poetry

- name: Deploy to pypi.org
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish --build
run: |
poetry version ${GITHUB_REF_NAME/#v}
poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ admindocs_templates
*.sqlite3
tests/test_app/static/
.python-version
.mypy_cache
.ruff_cache
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ deps: ## Install dependencies
poetry install

lint: check-venv ## Lint the code
@printf "$(CYAN)Auto-formatting with black$(COFF)\n"
$(environment) black jazzmin tests
@printf "$(CYAN)Auto-formatting with ruff$(COFF)\n"
$(environment) ruff format jazzmin tests
$(environment) ruff check jazzmin tests --fix

check: check-venv ## Check code quality
@printf "$(CYAN)Running static code analysis$(COFF)\n"
$(environment) flake8
$(environment) black --check jazzmin tests
$(environment) ruff format --check jazzmin tests
$(environment) ruff check jazzmin tests
$(environment) mypy jazzmin tests --ignore-missing-imports

test: check-venv ## Run the test suite
Expand Down
67 changes: 46 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,102 +1,127 @@

# Django jazzmin (Jazzy Admin)

## Project Status

This project is being actively maintained, though with a reduced feature set, we are looking for contributors to help
maintain and improve the project, please get in touch if you would like to help.

Help needed with:

- Triaging issues
- Frontend fixes and UI improvements
- Testing
- Documentation

Pull requests are welcome, though ive been pre-occupied with other projects lately, so have not been able to review
them as quickly as I would like, but im trying to get through them all now, hopefully with some outside help.

[![Docs](https://readthedocs.org/projects/django-jazzmin/badge/?version=latest)](https://django-jazzmin.readthedocs.io)
![PyPI download month](https://img.shields.io/pypi/dm/django-jazzmin.svg)
[![PyPI version](https://badge.fury.io/py/django-jazzmin.svg)](https://pypi.python.org/pypi/django-jazzmin/)
![Python versions](https://img.shields.io/badge/python-%3E%3D3.6-brightgreen)
![Django Versions](https://img.shields.io/badge/django-%3E%3D2-brightgreen)
[![Coverage Status](https://coveralls.io/repos/github/farridav/django-jazzmin/badge.svg?branch=master)](https://coveralls.io/github/farridav/django-jazzmin?branch=master)
![Python versions](https://img.shields.io/badge/python-%3E=3.9-brightgreen)
![Django Versions](https://img.shields.io/badge/django-%3E=4.2-brightgreen)
[![Coverage Status](https://coveralls.io/repos/github/farridav/django-jazzmin/badge.svg?branch=main)](https://coveralls.io/github/farridav/django-jazzmin?branch=main)

Drop-in theme for django admin, that utilises AdminLTE 3 & Bootstrap 4 to make yo' admin look jazzy
Drop-in theme for django admin, that utilises AdminLTE 3.2 & Bootstrap 5 to make yo' admin look jazzy

## Installation
```

```bash
pip install django-jazzmin
```

## Documentation
See [Documentation](https://django-jazzmin.readthedocs.io) or [Test App](https://github.com/farridav/django-jazzmin/tree/master/tests/test_app/library/settings.py)

## Demo
Live demo https://django-jazzmin.herokuapp.com/admin

**Username**: test@test.com

**Password**: test

*Note: Data resets nightly*
See [Documentation](https://django-jazzmin.readthedocs.io) or [Test App](https://github.com/farridav/django-jazzmin/tree/main/tests/test_app/library/settings.py)

## Features

- Drop-in admin skin, all configuration optional
- Customisable side menu
- Customisable top menu
- Customisable user menu
- 4 different Change form templates (horizontal tabs, vertical tabs, carousel, collapsible)
- Bootstrap 4 modal (instead of the old popup window, optional)
- Bootstrap 5 modal (instead of the old popup window, optional)
- Search bar for any given model admin
- Customisable UI (via Live UI changes, or custom CSS/JS)
- Responsive
- Select2 drop-downs
- Bootstrap 4 & AdminLTE UI components
- Bootstrap 5 & AdminLTE UI components
- Using the latest [adminlte](https://adminlte.io/) + [bootstrap](https://getbootstrap.com/)

## Screenshots

## Dashboard

![dashboard](https://django-jazzmin.readthedocs.io/img/dashboard.png)

## List view

![table list](https://django-jazzmin.readthedocs.io/img/list_view.png)

## Change form templates

### Collapsed side menu

![form page](https://django-jazzmin.readthedocs.io/img/detail_view.png)

### Expanded side menu

![Single](https://django-jazzmin.readthedocs.io/img/changeform_single.png)

### Horizontal tabs

![Horizontal tabs](https://django-jazzmin.readthedocs.io/img/changeform_horizontal_tabs.png)

### Vertical tabs

![Vertical tabs](https://django-jazzmin.readthedocs.io/img/changeform_vertical_tabs.png)

### Collapsible

![Collapsible](https://django-jazzmin.readthedocs.io/img/changeform_collapsible.png)

### Carousel

![Carousel](https://django-jazzmin.readthedocs.io/img/changeform_carousel.png)

### Related modal

![Related modal](https://django-jazzmin.readthedocs.io/img/related_modal_bootstrap.png)

## History page

![form page](https://django-jazzmin.readthedocs.io/img/history_page.png)

## Login view

![login](https://django-jazzmin.readthedocs.io/img/login.png)

## UI Customiser

![ui_customiser](https://django-jazzmin.readthedocs.io/img/ui_customiser.png)

## Mobile layout

![mobile](https://django-jazzmin.readthedocs.io/img/dashboard_mobile.png)

## Tablet layout

![tablet](https://django-jazzmin.readthedocs.io/img/dashboard_tablet.png)

## Admin Docs (if installed)

![admin_docs](https://django-jazzmin.readthedocs.io/img/admin_docs.png)

## Thanks
This was initially a Fork of https://github.com/wuyue92tree/django-adminlte-ui that we refactored so much we thought it

This was initially a Fork of <https://github.com/wuyue92tree/django-adminlte-ui> that we refactored so much we thought it
deserved its own package, big thanks to @wuyue92tree for all of his initial hard work, we are still patching into that
project were possible, but this project has taken a different direction.

The javascript modal implementation uses some code from [django-admin-interface](https://github.com/fabiocaccamo/django-admin-interface/blob/master/admin_interface/static/admin/js/popup_response.js), so thanks to @fabiocaccamo for original work
The javascript modal implementation uses some code from [django-admin-interface](https://github.com/fabiocaccamo/django-admin-interface/blob/main/admin_interface/static/admin/js/popup_response.js), so thanks to @fabiocaccamo for original work

- Based on AdminLTE 3: https://adminlte.io/
- Using Bootstrap 4: https://getbootstrap.com/
- Using Font Awesome 5: https://fontawesome.com/
- Based on AdminLTE 3: <https://adminlte.io/>
- Using Bootstrap 5: <https://getbootstrap.com/>
- Using Font Awesome 5: <https://fontawesome.com/>
Loading

0 comments on commit accbcd1

Please sign in to comment.