Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d46dfafc2 | |||
| 3f076578bb | |||
| cc4c379465 | |||
| c9f0795a95 | |||
| 042e93a84b | |||
| c9e800b5ab | |||
| 7257fbffb3 | |||
| 1f690978bf | |||
| 3d9cfd134d | |||
| 017f905330 | |||
| 796cea4a49 | |||
| 0178e0ccff | |||
| 70ed000f08 | |||
| 294f8520ab | |||
| 1b28c183f0 | |||
| 520dceaa97 | |||
| 2fa85eb964 | |||
| 3bc6e6fe3b | |||
| 3dc31df5f1 | |||
| 8ded8e160b | |||
| f4e5662e49 | |||
| dba9c35ac8 | |||
| 3431565f74 | |||
| 6a42df67b1 | |||
| 593709808f | |||
| 3a2b59f7cc | |||
| b7d9b969b4 | |||
| cacf0e0534 | |||
| e2239dcb99 | |||
| c769a449f2 | |||
| 3cff729a8a | |||
| c44db23b31 | |||
| 485f5400db | |||
| a2329fdae5 | |||
| a388ec234c |
@@ -0,0 +1,71 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ master ]
|
||||
schedule:
|
||||
- cron: '26 21 * * 0'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'javascript', 'python' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||
# Learn more:
|
||||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
@@ -0,0 +1,29 @@
|
||||
name: Create release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*.*.*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Extract release notes
|
||||
id: extract-release-notes
|
||||
uses: ffurrer2/extract-release-notes@v1
|
||||
|
||||
- name: Create release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: ${{ github.ref }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
body: ${{ steps.extract-release-notes.outputs.release_notes }}
|
||||
@@ -0,0 +1,47 @@
|
||||
name: Test package
|
||||
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10']
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: postgres
|
||||
ports:
|
||||
- 5432:5432
|
||||
# needed because the postgres container does not provide a healthcheck
|
||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: 'pip'
|
||||
|
||||
- name: Install psycopg2 prerequisites
|
||||
run: sudo apt-get install libpq-dev
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
pip install -r requirements-test.txt
|
||||
pip install tox tox-gh-actions
|
||||
|
||||
- name: Test with tox
|
||||
run: tox
|
||||
-171
@@ -1,171 +0,0 @@
|
||||
os: linux
|
||||
dist: xenial
|
||||
language: python
|
||||
cache: pip
|
||||
jobs:
|
||||
include:
|
||||
- python: "2.7"
|
||||
env: TOX_ENV=py27-dj17-sqlite
|
||||
- python: "2.7"
|
||||
env: TOX_ENV=py27-dj17-postgres
|
||||
- python: "2.7"
|
||||
env: TOX_ENV=py27-dj18-sqlite
|
||||
- python: "2.7"
|
||||
env: TOX_ENV=py27-dj18-postgres
|
||||
- python: "2.7"
|
||||
env: TOX_ENV=py27-dj19-sqlite
|
||||
- python: "2.7"
|
||||
env: TOX_ENV=py27-dj19-postgres
|
||||
- python: "2.7"
|
||||
env: TOX_ENV=py27-dj110-sqlite
|
||||
- python: "2.7"
|
||||
env: TOX_ENV=py27-dj110-postgres
|
||||
- python: "2.7"
|
||||
env: TOX_ENV=py27-dj111-sqlite
|
||||
- python: "2.7"
|
||||
env: TOX_ENV=py27-dj111-postgres
|
||||
- python: "3.5"
|
||||
env: TOX_ENV=py35-dj18-sqlite
|
||||
- python: "3.5"
|
||||
env: TOX_ENV=py35-dj18-postgres
|
||||
- python: "3.5"
|
||||
env: TOX_ENV=py35-dj19-sqlite
|
||||
- python: "3.5"
|
||||
env: TOX_ENV=py35-dj19-postgres
|
||||
- python: "3.5"
|
||||
env: TOX_ENV=py35-dj110-sqlite
|
||||
- python: "3.5"
|
||||
env: TOX_ENV=py35-dj110-postgres
|
||||
- python: "3.5"
|
||||
env: TOX_ENV=py35-dj111-sqlite
|
||||
- python: "3.5"
|
||||
env: TOX_ENV=py35-dj111-postgres
|
||||
- python: "3.5"
|
||||
env: TOX_ENV=py35-dj20-sqlite
|
||||
- python: "3.5"
|
||||
env: TOX_ENV=py35-dj20-postgres
|
||||
- python: "3.5"
|
||||
env: TOX_ENV=py35-dj21-sqlite
|
||||
- python: "3.5"
|
||||
env: TOX_ENV=py35-dj21-postgres
|
||||
# - python: "3.5"
|
||||
# env: TOX_ENV=py35-dj22-sqlite
|
||||
- python: "3.5"
|
||||
env: TOX_ENV=py35-dj22-postgres
|
||||
- python: "3.6"
|
||||
env: TOX_ENV=py36-dj111-sqlite
|
||||
- python: "3.6"
|
||||
env: TOX_ENV=py36-dj111-postgres
|
||||
- python: "3.6"
|
||||
env: TOX_ENV=py36-dj20-sqlite
|
||||
- python: "3.6"
|
||||
env: TOX_ENV=py36-dj20-postgres
|
||||
- python: "3.6"
|
||||
env: TOX_ENV=py36-dj21-sqlite
|
||||
- python: "3.6"
|
||||
env: TOX_ENV=py36-dj21-postgres
|
||||
- python: "3.6"
|
||||
env: TOX_ENV=py36-dj22-sqlite
|
||||
- python: "3.6"
|
||||
env: TOX_ENV=py36-dj22-postgres
|
||||
- python: "3.6"
|
||||
env: TOX_ENV=py36-dj30-sqlite
|
||||
- python: "3.6"
|
||||
env: TOX_ENV=py36-dj30-postgres
|
||||
- python: "3.6"
|
||||
env: TOX_ENV=py36-dj31-sqlite
|
||||
- python: "3.6"
|
||||
env: TOX_ENV=py36-dj31-postgres
|
||||
- python: "3.6"
|
||||
env: TOX_ENV=py36-dj32-sqlite
|
||||
- python: "3.6"
|
||||
env: TOX_ENV=py36-dj32-postgres
|
||||
- python: "3.6"
|
||||
env: TOX_ENV=py36-djmaster-sqlite
|
||||
- python: "3.6"
|
||||
env: TOX_ENV=py36-djmaster-postgres
|
||||
- python: "3.7"
|
||||
env: TOX_ENV=py37-dj20-sqlite
|
||||
- python: "3.7"
|
||||
env: TOX_ENV=py37-dj20-postgres
|
||||
- python: "3.7"
|
||||
env: TOX_ENV=py37-dj21-sqlite
|
||||
- python: "3.7"
|
||||
env: TOX_ENV=py37-dj21-postgres
|
||||
- python: "3.7"
|
||||
env: TOX_ENV=py37-dj22-sqlite
|
||||
- python: "3.7"
|
||||
env: TOX_ENV=py37-dj22-postgres
|
||||
- python: "3.7"
|
||||
env: TOX_ENV=py37-dj30-sqlite
|
||||
- python: "3.7"
|
||||
env: TOX_ENV=py37-dj30-postgres
|
||||
- python: "3.7"
|
||||
env: TOX_ENV=py37-dj31-sqlite
|
||||
- python: "3.7"
|
||||
env: TOX_ENV=py37-dj31-postgres
|
||||
- python: "3.7"
|
||||
env: TOX_ENV=py37-dj32-sqlite
|
||||
- python: "3.7"
|
||||
env: TOX_ENV=py37-dj32-postgres
|
||||
- python: "3.7"
|
||||
env: TOX_ENV=py37-djmaster-sqlite
|
||||
- python: "3.7"
|
||||
env: TOX_ENV=py37-djmaster-postgres
|
||||
- python: "3.8"
|
||||
env: TOX_ENV=py38-dj22-sqlite
|
||||
- python: "3.8"
|
||||
env: TOX_ENV=py38-dj22-postgres
|
||||
- python: "3.8"
|
||||
env: TOX_ENV=py38-dj30-sqlite
|
||||
- python: "3.8"
|
||||
env: TOX_ENV=py38-dj30-postgres
|
||||
- python: "3.8"
|
||||
env: TOX_ENV=py38-dj31-sqlite
|
||||
- python: "3.8"
|
||||
env: TOX_ENV=py38-dj31-postgres
|
||||
- python: "3.8"
|
||||
env: TOX_ENV=py38-dj32-sqlite
|
||||
- python: "3.8"
|
||||
env: TOX_ENV=py38-dj32-postgres
|
||||
- python: "3.8"
|
||||
env: TOX_ENV=py38-djmaster-sqlite
|
||||
- python: "3.8"
|
||||
env: TOX_ENV=py38-djmaster-postgres
|
||||
- python: "3.9"
|
||||
env: TOX_ENV=py39-dj22-sqlite
|
||||
- python: "3.9"
|
||||
env: TOX_ENV=py39-dj22-postgres
|
||||
- python: "3.9"
|
||||
env: TOX_ENV=py39-dj30-sqlite
|
||||
- python: "3.9"
|
||||
env: TOX_ENV=py39-dj30-postgres
|
||||
- python: "3.9"
|
||||
env: TOX_ENV=py39-dj31-sqlite
|
||||
- python: "3.9"
|
||||
env: TOX_ENV=py39-dj31-postgres
|
||||
- python: "3.9"
|
||||
env: TOX_ENV=py39-dj32-sqlite
|
||||
- python: "3.9"
|
||||
env: TOX_ENV=py39-dj32-postgres
|
||||
- python: "3.9"
|
||||
env: TOX_ENV=py39-djmaster-sqlite
|
||||
- python: "3.9"
|
||||
env: TOX_ENV=py39-djmaster-postgres
|
||||
allow_failures:
|
||||
- env: TOX_ENV=py36-djmaster-sqlite
|
||||
- env: TOX_ENV=py36-djmaster-postgres
|
||||
- env: TOX_ENV=py37-djmaster-sqlite
|
||||
- env: TOX_ENV=py37-djmaster-postgres
|
||||
- env: TOX_ENV=py38-djmaster-sqlite
|
||||
- env: TOX_ENV=py38-djmaster-postgres
|
||||
- env: TOX_ENV=py39-djmaster-sqlite
|
||||
- env: TOX_ENV=py39-djmaster-postgres
|
||||
install:
|
||||
- pip install tox
|
||||
services:
|
||||
- postgresql
|
||||
before_script:
|
||||
- psql -c 'create database admin_interface;' -U postgres
|
||||
script:
|
||||
- tox -e $TOX_ENV
|
||||
@@ -4,6 +4,41 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [0.18.4](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.18.4) - 2022-01-05
|
||||
- Added official django 4.0 support.
|
||||
- Added link to admin home page on logo and title. #147
|
||||
- Fixed collapsed inlines rounded bottom borders.
|
||||
- Fixed missing comma in tests settings `MIDDLEWARE_CLASSES`. #145
|
||||
|
||||
## [0.18.3](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.18.3) - 2021-12-07
|
||||
- Added official python 3.10 support.
|
||||
- Replaced travis with GitHub action workflow. #142
|
||||
- Fixed `check_installed_apps` checks.
|
||||
- Fixed django default appconfig deprecation warning. #141
|
||||
|
||||
## [0.18.2](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.18.2) - 2021-10-25
|
||||
- Fixed migration error.
|
||||
|
||||
## [0.18.1](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.18.1) - 2021-10-25
|
||||
- Removed wrong migration.
|
||||
|
||||
## [0.18.0](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.18.0) - 2021-10-24
|
||||
- Added foldable apps support. #117
|
||||
- Removed `css` field from `Theme` model.
|
||||
|
||||
## [0.17.3](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.17.3) - 2021-10-12
|
||||
- Fixed `FileExtensionValidator` `TypeError` on django < 1.11.
|
||||
|
||||
## [0.17.2](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.17.2) - 2021-10-08
|
||||
- Fixed `FileExtensionValidator` `TypeError` on django < 1.11.
|
||||
|
||||
## [0.17.1](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.17.1) - 2021-09-24
|
||||
- Fixed `TemplateDoesNotExist` error on `django==4.0.a1` removing checking condition for `colorfield` package. #134
|
||||
- Fixed favicon fetching incompatible with `django-storages` `S3`. #128
|
||||
|
||||
## [0.17.0](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.17.0) - 2021-09-16
|
||||
- Added `logo_max_width` and `logo_max_height`. #127
|
||||
|
||||
## [0.16.4](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.16.4) - 2021-09-04
|
||||
- Fixed `0020_module_selected_colors` migration for multiple dbs. #132
|
||||
- Fixed sticky pagination `width` and `border-bottom`.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
[](https://badges.pufler.dev)
|
||||
[](https://github.com/fabiocaccamo/django-admin-interface/blob/master/LICENSE.txt)
|
||||
|
||||
[](https://travis-ci.org/fabiocaccamo/django-admin-interface)
|
||||
[](https://github.com/fabiocaccamo/django-admin-interface)
|
||||
[](https://codecov.io/gh/fabiocaccamo/django-admin-interface)
|
||||
[](https://www.codacy.com/app/fabiocaccamo/django-admin-interface)
|
||||
[](https://codeclimate.com/github/fabiocaccamo/django-admin-interface/)
|
||||
@@ -18,6 +18,8 @@ django-admin-interface is a modern **responsive flat admin interface customizabl
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Features
|
||||
- Beautiful default **django-theme**
|
||||
- Themes management and customization *(you can **customize admin title, logo and colors**)*
|
||||
@@ -26,6 +28,7 @@ django-admin-interface is a modern **responsive flat admin interface customizabl
|
||||
- Environment name/marker
|
||||
- Language chooser
|
||||
- List filter dropdown
|
||||
- `NEW` **Foldable apps** *(accordions in the navigation bar)*
|
||||
- `NEW` **List filter sticky**
|
||||
- `NEW` **Form controls sticky** *(pagination and save/delete buttons)*
|
||||
- Compatibility / Style optimizations for:
|
||||
@@ -36,6 +39,8 @@ django-admin-interface is a modern **responsive flat admin interface customizabl
|
||||
- `django-tabbed-admin`
|
||||
- `sorl-thumbnail`
|
||||
|
||||
---
|
||||
|
||||
## Installation
|
||||
- Run `pip install django-admin-interface`
|
||||
- Add `admin_interface`, `flat_responsive`, `flat` and `colorfield` to `settings.INSTALLED_APPS` **before** `django.contrib.admin`
|
||||
@@ -65,6 +70,8 @@ SILENCED_SYSTEM_CHECKS = ['security.W019']
|
||||
- Run ``python manage.py collectstatic --clear``
|
||||
- Restart your application server
|
||||
|
||||
---
|
||||
|
||||
## Optional themes
|
||||
This package ships with optional themes as fixtures, they can be installed using the [loaddata admin command](https://docs.djangoproject.com/en/1.11/ref/django-admin/#django-admin-loaddata). Optional themes are activated on installation.
|
||||
|
||||
@@ -119,6 +126,7 @@ You can add **theme support to existing third-party libraries** using the follow
|
||||
- `--admin-interface-related-modal-background-color`
|
||||
- `--admin-interface-related-modal-background-opacity`
|
||||
|
||||
---
|
||||
|
||||
## Screenshots
|
||||
###### Admin login
|
||||
@@ -133,11 +141,50 @@ You can add **theme support to existing third-party libraries** using the follow
|
||||
###### Admin theme customization
|
||||

|
||||
|
||||
---
|
||||
|
||||
## FAQ
|
||||
- #### I already have a custom `base_site.html`, how can I make it work?
|
||||
|
||||
### Custom `base-site.html`
|
||||
> I already have a custom `base_site.html`, how can I make it work?
|
||||
|
||||
You can use [django-apptemplates](https://github.com/bittner/django-apptemplates), then add `{% extends "admin_interface:admin/base_site.html" %}` to your `base_site.html`
|
||||
|
||||
### Language Chooser not showing
|
||||
> I have enabled the **Language Chooser**, but it is not visible in the admin, what should I do?
|
||||
|
||||
You must configure multilanguage `settings` and `urls` correctly:
|
||||
```python
|
||||
LANGUAGES = (
|
||||
('en', _('English')),
|
||||
('it', _('Italiano')),
|
||||
('fr', _('Française')),
|
||||
# more than one language is expected here
|
||||
)
|
||||
LANGUAGE_CODE = 'en'
|
||||
USE_I18N = True
|
||||
MIDDLEWARE = [
|
||||
# ...
|
||||
'django.middleware.locale.LocaleMiddleware',
|
||||
# ...
|
||||
]
|
||||
```
|
||||
|
||||
```python
|
||||
from django.conf.urls.i18n import i18n_patterns
|
||||
from django.contrib import admin
|
||||
from django.urls import include, path
|
||||
|
||||
# ...
|
||||
|
||||
urlpatterns = [
|
||||
path('i18n/', include('django.conf.urls.i18n')),
|
||||
]
|
||||
urlpatterns += i18n_patterns(path('admin/', admin.site.urls))
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Testing
|
||||
```bash
|
||||
# create python virtual environment
|
||||
@@ -151,6 +198,7 @@ git clone https://github.com/fabiocaccamo/django-admin-interface.git src && cd s
|
||||
|
||||
# install dependencies
|
||||
pip install -r requirements.txt
|
||||
pip install -r requirements-test.txt
|
||||
|
||||
# run tests
|
||||
tox
|
||||
@@ -160,24 +208,13 @@ python setup.py test
|
||||
python -m django test --settings "tests.settings"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## License
|
||||
Released under [MIT License](LICENSE.txt).
|
||||
|
||||
---
|
||||
|
||||
## Supporting
|
||||
|
||||
I would like to spend more time on this project, especially to improve it and adding new features.
|
||||
|
||||
As everyone knows open-source projects takes up a lot of time that is unpaid. :money_with_wings:
|
||||
|
||||
If you are using this package in commercial project(s), please consider the idea to become a sponsor or donating once:
|
||||
|
||||
- [GitHub Sponsor](https://github.com/sponsors/fabiocaccamo)
|
||||
- [PayPal](https://www.paypal.me/fabiocaccamo)
|
||||
- BTC: bc1q2t0pv8z3udpyuvfnx5kskhqdad4dcvtfuzmvjw
|
||||
- ETH: 0x8B55Fb7798b5A9F797A4455C00821B6e53daca74
|
||||
|
||||
## See also
|
||||
|
||||
- [`django-colorfield`](https://github.com/fabiocaccamo/django-colorfield) - simple color field for models with a nice color-picker in the admin. 🎨
|
||||
@@ -194,4 +231,6 @@ If you are using this package in commercial project(s), please consider the idea
|
||||
|
||||
- [`python-codicefiscale`](https://github.com/fabiocaccamo/python-codicefiscale) - encode/decode Italian fiscal codes - codifica/decodifica del Codice Fiscale. 🇮🇹 💳
|
||||
|
||||
- [`python-fontbro`](https://github.com/fabiocaccamo/python-fontbro) - friendly font operations. 🧢
|
||||
|
||||
- [`python-fsutil`](https://github.com/fabiocaccamo/python-fsutil) - file-system utilities for lazy devs. 🧟♂️
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import django
|
||||
|
||||
default_app_config = 'admin_interface.apps.AdminInterfaceConfig'
|
||||
if django.VERSION < (3, 2):
|
||||
default_app_config = 'admin_interface.apps.AdminInterfaceConfig'
|
||||
|
||||
@@ -38,6 +38,8 @@ class ThemeAdmin(admin.ModelAdmin):
|
||||
'classes': ('wide', ),
|
||||
'fields': (
|
||||
'logo',
|
||||
'logo_max_width',
|
||||
'logo_max_height',
|
||||
'logo_color',
|
||||
'logo_visible',
|
||||
)
|
||||
@@ -98,6 +100,12 @@ class ThemeAdmin(admin.ModelAdmin):
|
||||
'css_delete_button_text_color',
|
||||
)
|
||||
}),
|
||||
(_('Navigation Bar'), {
|
||||
'classes': ('wide', ),
|
||||
'fields': (
|
||||
'foldable_apps',
|
||||
)
|
||||
}),
|
||||
(_('Related Modal'), {
|
||||
'classes': ('wide', ),
|
||||
'fields': (
|
||||
|
||||
@@ -12,4 +12,7 @@ else:
|
||||
if django.VERSION >= (1, 11):
|
||||
from django.core.validators import FileExtensionValidator
|
||||
else:
|
||||
FileExtensionValidator = lambda allowed_extensions: None
|
||||
def FileExtensionValidator(*args, **kwargs):
|
||||
def noop(*args, **kwargs):
|
||||
pass
|
||||
return noop
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
"css_delete_button_background_color": "#D9534F",
|
||||
"css_delete_button_background_hover_color": "#C9302C",
|
||||
"css_delete_button_text_color": "#FFFFFF",
|
||||
"css": "",
|
||||
"related_modal_active": true,
|
||||
"related_modal_background_color": "#503873",
|
||||
"related_modal_background_opacity": 0.2,
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
"css_delete_button_background_color": "#BA2121",
|
||||
"css_delete_button_background_hover_color": "#A41515",
|
||||
"css_delete_button_text_color": "#FFFFFF",
|
||||
"css": "",
|
||||
"related_modal_active": true,
|
||||
"related_modal_background_color": "#000000",
|
||||
"related_modal_background_opacity": 0.2,
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
"css_delete_button_background_color": "#CC4B37",
|
||||
"css_delete_button_background_hover_color": "#BF4634",
|
||||
"css_delete_button_text_color": "#FFFFFF",
|
||||
"css": "",
|
||||
"related_modal_active": true,
|
||||
"related_modal_background_color": "#000000",
|
||||
"related_modal_background_opacity": 0.2,
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
"css_delete_button_background_color": "#CD2026",
|
||||
"css_delete_button_background_hover_color": "#981B1E",
|
||||
"css_delete_button_text_color": "#FFFFFF",
|
||||
"css": "",
|
||||
"related_modal_active": true,
|
||||
"related_modal_background_color": "#000000",
|
||||
"related_modal_background_opacity": 0.8,
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
"css_delete_button_background_color": "#BA2121",
|
||||
"css_delete_button_background_hover_color": "#A41515",
|
||||
"css_delete_button_text_color": "#FFFFFF",
|
||||
"css": "",
|
||||
"related_modal_active": true,
|
||||
"related_modal_background_color": "#000000",
|
||||
"related_modal_background_opacity": 0.2,
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('admin_interface', '0021_file_extension_validator'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='theme',
|
||||
name='logo_max_height',
|
||||
field=models.PositiveSmallIntegerField(blank=True, default=100, verbose_name='max height'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='theme',
|
||||
name='logo_max_width',
|
||||
field=models.PositiveSmallIntegerField(blank=True, default=400, verbose_name='max width'),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('admin_interface', '0022_add_logo_max_width_and_height'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='theme',
|
||||
name='foldable_apps',
|
||||
field=models.BooleanField(default=True, verbose_name='foldable apps'),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('admin_interface', '0023_theme_foldable_apps'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='theme',
|
||||
name='css',
|
||||
),
|
||||
]
|
||||
@@ -103,6 +103,14 @@ class Theme(models.Model):
|
||||
help_text='#FFFFFF',
|
||||
max_length=10,
|
||||
verbose_name=_('color'))
|
||||
logo_max_width = models.PositiveSmallIntegerField(
|
||||
blank=True,
|
||||
default=400,
|
||||
verbose_name=_('max width'))
|
||||
logo_max_height = models.PositiveSmallIntegerField(
|
||||
blank=True,
|
||||
default=100,
|
||||
verbose_name=_('max height'))
|
||||
logo_visible = models.BooleanField(
|
||||
default=True,
|
||||
verbose_name=_('visible'))
|
||||
@@ -261,10 +269,6 @@ class Theme(models.Model):
|
||||
max_length=10,
|
||||
verbose_name=_('text color'))
|
||||
|
||||
css = models.TextField(
|
||||
blank=True,
|
||||
verbose_name=_('text color'))
|
||||
|
||||
related_modal_active = models.BooleanField(
|
||||
default=True,
|
||||
verbose_name=_('active'))
|
||||
@@ -305,6 +309,10 @@ class Theme(models.Model):
|
||||
default=True,
|
||||
verbose_name=_('sticky position'))
|
||||
|
||||
foldable_apps = models.BooleanField(
|
||||
default=True,
|
||||
verbose_name=_('foldable apps'))
|
||||
|
||||
recent_actions_visible = models.BooleanField(
|
||||
default=True,
|
||||
verbose_name=_('visible'))
|
||||
|
||||
@@ -5,24 +5,30 @@ from django.conf import settings
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
|
||||
|
||||
def check_installed_app(app, app_dj_version_limit):
|
||||
def check_installed_app(app, max_dj_version=None):
|
||||
dj_version = django.VERSION
|
||||
installed_apps = settings.INSTALLED_APPS
|
||||
if dj_version < app_dj_version_limit:
|
||||
if max_dj_version is None:
|
||||
if app not in installed_apps:
|
||||
raise ImproperlyConfigured(
|
||||
'\'{}\' needed before django {}.{}, '
|
||||
'\'{}\' is required, '
|
||||
'add it to settings.INSTALLED_APPS.'.format(
|
||||
app, *app_dj_version_limit))
|
||||
app))
|
||||
elif dj_version < max_dj_version:
|
||||
if app not in installed_apps:
|
||||
raise ImproperlyConfigured(
|
||||
'\'{}\' is required before django {}.{}, '
|
||||
'add it to settings.INSTALLED_APPS.'.format(
|
||||
app, *max_dj_version))
|
||||
else:
|
||||
if app in installed_apps:
|
||||
raise ImproperlyConfigured(
|
||||
'\'{}\' not needed since django {}.{}, '
|
||||
'\'{}\' is no more required since django {}.{}, '
|
||||
'remove it from settings.INSTALLED_APPS.'.format(
|
||||
app, *app_dj_version_limit))
|
||||
app, *max_dj_version))
|
||||
|
||||
|
||||
def check_installed_apps():
|
||||
check_installed_app('colorfield', (4, 0))
|
||||
check_installed_app('flat', (1, 9))
|
||||
check_installed_app('flat_responsive', (2, 0))
|
||||
check_installed_app('colorfield')
|
||||
check_installed_app('flat', max_dj_version=(1, 9))
|
||||
check_installed_app('flat_responsive', max_dj_version=(2, 0))
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
.admin-interface.foldable-apps [class^="app-"].module {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.admin-interface.foldable-apps [class^="app-"].module.foldable-apps-ready {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.admin-interface.foldable-apps [class^="app-"].module > table > caption {
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
/* pointer-events: none; */
|
||||
cursor: pointer;
|
||||
-webkit-touch-callout: none; /* iOS Safari */
|
||||
-webkit-user-select: none; /* Safari */
|
||||
-khtml-user-select: none; /* Konqueror HTML */
|
||||
-moz-user-select: none; /* Firefox */
|
||||
-ms-user-select: none; /* Internet Explorer/Edge */
|
||||
user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */
|
||||
}
|
||||
|
||||
.admin-interface.foldable-apps [class^="app-"].module > table > caption > a {
|
||||
display: inline-block;
|
||||
/* pointer-events: all !important; */
|
||||
margin-right: 30px;
|
||||
}
|
||||
|
||||
.admin-interface.foldable-apps [class^="app-"].module > table > caption::after {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
width: auto;
|
||||
height: 100%;
|
||||
content: "−";
|
||||
font-size: 16px;
|
||||
font-weight: lighter;
|
||||
text-align: center;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
cursor: pointer;
|
||||
pointer-events: all !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.admin-interface.foldable-apps [class^="app-"].module > table > caption::after {
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.admin-interface.foldable-apps [class^="app-"].module > table {
|
||||
display: table;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.admin-interface.foldable-apps [class^="app-"].module.collapsed {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.admin-interface.foldable-apps [class^="app-"].module.collapsed > table > caption::after {
|
||||
content: "+";
|
||||
}
|
||||
|
||||
.admin-interface.foldable-apps [class^="app-"].module.collapsed > table > tbody {
|
||||
display: none;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
(function() {
|
||||
window.onload = function() {
|
||||
for (let moduleEl of document.querySelectorAll('.admin-interface.foldable-apps [class^="app-"].module')) {
|
||||
// apply collapsed value from localstorage value
|
||||
let moduleAppClass = null;
|
||||
let moduleCollapsedClass = 'collapsed';
|
||||
moduleEl.classList.forEach(function(className) {
|
||||
if (className.startsWith('app-')) {
|
||||
moduleAppClass = className;
|
||||
}
|
||||
});
|
||||
if (moduleAppClass) {
|
||||
let moduleAppKey = 'admin-interface.foldable-apps_' + moduleAppClass + '_collapsed';
|
||||
let moduleCollapsed = Boolean(parseInt((localStorage.getItem(moduleAppKey) || 0)) || 0);
|
||||
if (moduleCollapsed === true) {
|
||||
moduleEl.classList.add(moduleCollapsedClass);
|
||||
} else {
|
||||
moduleEl.classList.remove(moduleCollapsedClass);
|
||||
}
|
||||
// attach click for togggle collapsed class
|
||||
for (let captionEl of moduleEl.querySelectorAll('caption')) {
|
||||
captionEl.onclick = function(event) {
|
||||
// only when not clicking on the app name link
|
||||
if (event.target.tagName.toLowerCase() === 'caption') {
|
||||
moduleEl.classList.toggle(moduleCollapsedClass);
|
||||
moduleCollapsed = moduleEl.classList.contains(moduleCollapsedClass);
|
||||
localStorage.setItem(moduleAppKey, (moduleCollapsed ? 1 : 0));
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
moduleEl.classList.add('foldable-apps-ready');
|
||||
}
|
||||
};
|
||||
})();
|
||||
@@ -29,11 +29,6 @@ https://github.com/fabiocaccamo/django-admin-interface
|
||||
{% include "admin_interface/css/tinymce.css" %}
|
||||
{% include "admin_interface/css/json-widget.css" %}
|
||||
{% include "admin_interface/css/rtl.css" %}
|
||||
|
||||
{% if theme.css %}
|
||||
{{ theme.css|safe }}
|
||||
{% endif %}
|
||||
|
||||
</style>
|
||||
|
||||
{% if current_lang == 'fa' %}
|
||||
@@ -51,24 +46,38 @@ https://github.com/fabiocaccamo/django-admin-interface
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/responsive.css' %}?v={{ version }}">
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/responsive_rtl.css' %}?v={{ version }}" />
|
||||
{% include "admin_interface/favicon.html" %}
|
||||
{% include "admin_interface/foldable-apps.html" %}
|
||||
{% include "admin_interface/related-modal.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block bodyclass %}admin-interface flat-theme {% get_admin_interface_theme as theme %}{% if theme.name %}{{ theme.name|slugify }}-theme{% endif %}{% if theme.form_submit_sticky %} sticky-submit {% endif %}{% if theme.form_pagination_sticky %} sticky-pagination {% endif %}{% endblock %}
|
||||
{% block extrahead %}
|
||||
{{ block.super }}
|
||||
{% endblock %}
|
||||
|
||||
{% block bodyclass %}
|
||||
{% get_admin_interface_theme as theme %}
|
||||
flat-theme admin-interface
|
||||
{% if theme.name %} {{ theme.name|slugify }}-theme {% endif %}
|
||||
{% if theme.foldable_apps %} foldable-apps {% endif %}
|
||||
{% if theme.form_submit_sticky %} sticky-submit {% endif %}
|
||||
{% if theme.form_pagination_sticky %} sticky-pagination {% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block branding %}
|
||||
{% get_admin_interface_theme as theme %}
|
||||
<h1 id="site-name">
|
||||
{% if theme.logo_visible %}
|
||||
{% if theme.logo %}
|
||||
<img class="logo" style="display:none;" src="{{ theme.logo.url }}" {% if theme.logo.width %}width="{{ theme.logo.width }}"{% endif %} {% if theme.logo.height %}height="{{ theme.logo.height }}"{% endif %}>
|
||||
{% else %}
|
||||
<img class="logo default" style="display:none;" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" width="104" height="36">
|
||||
<a href="{% url 'admin:index' %}">
|
||||
{% if theme.logo_visible %}
|
||||
{% if theme.logo %}
|
||||
<img class="logo" style="display:none;" src="{{ theme.logo.url }}" {% if theme.logo.width %}width="{{ theme.logo.width }}"{% endif %} {% if theme.logo.height %}height="{{ theme.logo.height }}"{% endif %}>
|
||||
{% else %}
|
||||
<img class="logo default" style="display:none;" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" width="104" height="36">
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if theme.title_visible %}
|
||||
<span>{% if theme.title %}{% trans theme.title %}{% else %}{{ site_header|default:_('Django administration') }}{% endif %}</span>
|
||||
{% endif %}
|
||||
{% if theme.title_visible %}
|
||||
<span>{% if theme.title %}{% trans theme.title %}{% else %}{{ site_header|default:_('Django administration') }}{% endif %}</span>
|
||||
{% endif %}
|
||||
</a>
|
||||
</h1>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@@ -87,8 +87,6 @@
|
||||
}
|
||||
|
||||
.admin-interface #branding h1 img.logo {
|
||||
max-width: 400px;
|
||||
max-height:100px;
|
||||
margin-top:10px;
|
||||
margin-bottom:10px;
|
||||
margin-right:15px;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
||||
{% load static %}
|
||||
|
||||
{% if theme.favicon %}
|
||||
<link rel="icon" href="{{ theme.favicon.url }}?v={{ version }}">
|
||||
<link rel="icon" href="{{ theme.favicon.url }}">
|
||||
{% if theme.env_visible_in_favicon %}
|
||||
<script type="text/javascript" src="{% static 'admin_interface/favico/favico-0.3.10-patched.min.js' %}?v={{ version }}"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{% load static %}
|
||||
|
||||
{% if theme.foldable_apps %}
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'admin_interface/foldable-apps/foldable-apps.css' %}?v={{ version }}">
|
||||
<script type="text/javascript" src="{% static 'admin_interface/foldable-apps/foldable-apps.js' %}?v={{ version }}"></script>
|
||||
{% endif %}
|
||||
@@ -1,3 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
__version__ = '0.16.4'
|
||||
__version__ = '0.18.4'
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
codecov
|
||||
coverage
|
||||
psycopg2
|
||||
tox
|
||||
@@ -1,8 +1,5 @@
|
||||
codecov
|
||||
coverage
|
||||
django>=1.7
|
||||
django-colorfield
|
||||
django-flat-theme
|
||||
django-flat-responsive
|
||||
six>=1.9.0
|
||||
tox
|
||||
@@ -56,6 +56,7 @@ setup(
|
||||
'Framework :: Django :: 3.0',
|
||||
'Framework :: Django :: 3.1',
|
||||
'Framework :: Django :: 3.2',
|
||||
'Framework :: Django :: 4.0',
|
||||
'Intended Audience :: Developers',
|
||||
'License :: OSI Approved :: MIT License',
|
||||
'Natural Language :: English',
|
||||
@@ -69,6 +70,7 @@ setup(
|
||||
'Programming Language :: Python :: 3.7',
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'Programming Language :: Python :: 3.9',
|
||||
'Programming Language :: Python :: 3.10',
|
||||
'Topic :: Software Development :: Build Tools',
|
||||
],
|
||||
license='MIT',
|
||||
|
||||
+7
-1
@@ -40,7 +40,7 @@ INSTALLED_APPS += [
|
||||
if django.VERSION < (2, 0):
|
||||
MIDDLEWARE_CLASSES = [
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware'
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
]
|
||||
@@ -89,6 +89,12 @@ database_config = {
|
||||
}
|
||||
}
|
||||
|
||||
github_workflow = os.environ.get('GITHUB_WORKFLOW')
|
||||
if github_workflow:
|
||||
database_config['postgres']['NAME'] = 'postgres'
|
||||
database_config['postgres']['HOST'] = '127.0.0.1'
|
||||
database_config['postgres']['PORT'] = '5432'
|
||||
|
||||
DATABASES = {
|
||||
'default': database_config.get(database_engine),
|
||||
}
|
||||
|
||||
@@ -1,13 +1,23 @@
|
||||
[tox]
|
||||
envlist =
|
||||
py27-{dj17,dj18,dj19,dj110,dj111}-{sqlite,postgres},
|
||||
py35-{dj18,dj19,dj110,dj111,dj20,dj21,dj22}-{sqlite,postgres},
|
||||
py36-{dj18,dj19,dj110,dj111,dj20,dj21,dj22,dj30,dj31,dj32,djmaster}-{sqlite,postgres},
|
||||
py37-{dj20,dj21,dj22,dj30,dj31,dj32,djmaster}-{sqlite,postgres},
|
||||
py38-{dj22,dj30,dj31,dj32,djmaster}-{sqlite,postgres},
|
||||
py39-{dj22,dj30,dj31,dj32,djmaster}-{sqlite,postgres},
|
||||
py36-{dj18,dj19,dj110,dj111,dj20,dj21,dj22,dj30,dj31,dj32}-{sqlite,postgres},
|
||||
py37-{dj20,dj21,dj22,dj30,dj31,dj32}-{sqlite,postgres},
|
||||
py38-{dj22,dj30,dj31,dj32}-{sqlite,postgres},
|
||||
py39-{dj22,dj30,dj31,dj32}-{sqlite,postgres},
|
||||
py310-{dj32,dj40}-{sqlite,postgres},
|
||||
|
||||
[gh-actions]
|
||||
python =
|
||||
2.7: py27
|
||||
3.6: py36
|
||||
3.7: py37
|
||||
3.8: py38
|
||||
3.9: py39
|
||||
3.10: py310
|
||||
|
||||
[testenv]
|
||||
passenv = CI TRAVIS TRAVIS_*
|
||||
passenv = CI GITHUB_WORKFLOW
|
||||
deps =
|
||||
dj17: Django == 1.7.*
|
||||
dj18: Django == 1.8.*
|
||||
@@ -20,7 +30,7 @@ deps =
|
||||
dj30: Django == 3.0.*
|
||||
dj31: Django == 3.1.*
|
||||
dj32: Django == 3.2.*
|
||||
djmaster: https://github.com/django/django/archive/master.tar.gz
|
||||
dj40: Django == 4.0.*
|
||||
# mysql: mysqlclient
|
||||
postgres: psycopg2-binary
|
||||
coverage
|
||||
|
||||
Reference in New Issue
Block a user