Compare commits

...

30 Commits

Author SHA1 Message Date
Fabio Caccamo 6d46dfafc2 Updated version and CHANGELOG. 2022-01-05 18:48:55 +01:00
Micah Walter 3f076578bb Added link to admin home page on logo and title. #147 2022-01-05 18:31:07 +01:00
Fabio Caccamo cc4c379465 Fixed missing comma in tests settings MIDDLEWARE_CLASSES. #145 2022-01-04 18:16:53 +01:00
Fabio Caccamo c9f0795a95 Updated workflows.
- Added `create-release.yml` workflow.
- Renamed `pythonpackage.yml` to `test-package.yml`.
2021-12-22 21:56:47 +01:00
Fabio Caccamo 042e93a84b Fixed collapsed inlines rounded bottom borders. 2021-12-21 15:58:39 +01:00
Fabio Caccamo c9e800b5ab Updated README. #115 2021-12-15 11:14:29 +01:00
Fabio Caccamo 7257fbffb3 Merge branch 'master' of https://github.com/fabiocaccamo/django-admin-interface 2021-12-08 15:52:44 +01:00
Fabio Caccamo 1f690978bf Added django 4.0 to CI. 2021-12-08 15:52:41 +01:00
Fabio Caccamo 3d9cfd134d Update pythonpackage.yml 2021-12-07 21:07:33 +01:00
Fabio Caccamo 017f905330 Update pythonpackage.yml 2021-12-07 18:48:23 +01:00
Fabio Caccamo 796cea4a49 Updated CHANGELOG and version. [ci skip] 2021-12-07 11:08:57 +01:00
Fabio Caccamo 0178e0ccff Fixed check_installed_apps checks. 2021-12-07 10:59:57 +01:00
Fabio Caccamo 70ed000f08 Replaced travis with GitHub action workflow. #142 2021-12-07 10:43:46 +01:00
Éric 294f8520ab Fix django default appconfig deprecation warning (#141) 2021-12-06 22:33:33 +01:00
Fabio Caccamo 1b28c183f0 Update README.md 2021-12-06 21:19:21 +01:00
Fabio Caccamo 520dceaa97 Updated CHANGELOG and version. 2021-11-25 11:58:11 +01:00
Fabio Caccamo 2fa85eb964 Fixed migration error. 2021-11-25 11:58:00 +01:00
Fabio Caccamo 3bc6e6fe3b Revert "Removed wrong migration."
This reverts commit 8ded8e160b.
2021-11-25 11:55:57 +01:00
Fabio Caccamo 3dc31df5f1 Updated CHANGELOG and version. 2021-11-25 11:49:22 +01:00
Fabio Caccamo 8ded8e160b Removed wrong migration. 2021-11-25 11:49:13 +01:00
Fabio Caccamo f4e5662e49 Updated README.md. [ci skip] 2021-11-24 18:49:47 +01:00
Fabio Caccamo dba9c35ac8 Updated CHANGELOG and version. 2021-11-24 18:47:05 +01:00
Fabio Caccamo 3431565f74 Removed theme css field. 2021-11-24 18:44:28 +01:00
Fabio Caccamo 6a42df67b1 Updated migration code generated by django. 2021-11-24 18:44:15 +01:00
Fabio Caccamo 593709808f Added foldable apps support. #117 2021-11-23 22:32:01 +01:00
Fabio Caccamo 3a2b59f7cc Create codeql-analysis.yml 2021-10-14 12:23:34 +02:00
Fabio Caccamo b7d9b969b4 Updated CHANGELOG and version. 2021-10-12 10:28:36 +02:00
Fabio Caccamo cacf0e0534 Fixed FileExtensionValidator TypeError on django < 1.11. 2021-10-12 10:28:19 +02:00
Fabio Caccamo e2239dcb99 Updated CHANGELOG and version. 2021-10-08 16:57:29 +02:00
Fabio Caccamo c769a449f2 Fixed FileExtensionValidator TypeError on django < 1.11. 2021-10-08 16:29:44 +02:00
29 changed files with 478 additions and 233 deletions
+71
View File
@@ -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
+29
View File
@@ -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 }}
+47
View File
@@ -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
View File
@@ -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
+28
View File
@@ -4,6 +4,34 @@ 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/), 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). 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 ## [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 `TemplateDoesNotExist` error on `django==4.0.a1` removing checking condition for `colorfield` package. #134
- Fixed favicon fetching incompatible with `django-storages` `S3`. #128 - Fixed favicon fetching incompatible with `django-storages` `S3`. #128
+54 -15
View File
@@ -7,7 +7,7 @@
[![](https://badges.pufler.dev/visits/fabiocaccamo/django-admin-interface?label=visitors&color=blue)](https://badges.pufler.dev) [![](https://badges.pufler.dev/visits/fabiocaccamo/django-admin-interface?label=visitors&color=blue)](https://badges.pufler.dev)
[![](https://img.shields.io/pypi/l/django-admin-interface.svg?color=blue)](https://github.com/fabiocaccamo/django-admin-interface/blob/master/LICENSE.txt) [![](https://img.shields.io/pypi/l/django-admin-interface.svg?color=blue)](https://github.com/fabiocaccamo/django-admin-interface/blob/master/LICENSE.txt)
[![](https://img.shields.io/travis/fabiocaccamo/django-admin-interface?logo=travis&label=build)](https://travis-ci.org/fabiocaccamo/django-admin-interface) [![](https://img.shields.io/github/workflow/status/fabiocaccamo/django-admin-interface/Python%20package?label=build&logo=github)](https://github.com/fabiocaccamo/django-admin-interface)
[![](https://img.shields.io/codecov/c/gh/fabiocaccamo/django-admin-interface?logo=codecov)](https://codecov.io/gh/fabiocaccamo/django-admin-interface) [![](https://img.shields.io/codecov/c/gh/fabiocaccamo/django-admin-interface?logo=codecov)](https://codecov.io/gh/fabiocaccamo/django-admin-interface)
[![](https://img.shields.io/codacy/grade/21cb657283c04e70b56fb935277a1ad1?logo=codacy)](https://www.codacy.com/app/fabiocaccamo/django-admin-interface) [![](https://img.shields.io/codacy/grade/21cb657283c04e70b56fb935277a1ad1?logo=codacy)](https://www.codacy.com/app/fabiocaccamo/django-admin-interface)
[![](https://img.shields.io/codeclimate/maintainability/fabiocaccamo/django-admin-interface?logo=code-climate)](https://codeclimate.com/github/fabiocaccamo/django-admin-interface/) [![](https://img.shields.io/codeclimate/maintainability/fabiocaccamo/django-admin-interface?logo=code-climate)](https://codeclimate.com/github/fabiocaccamo/django-admin-interface/)
@@ -18,6 +18,8 @@ django-admin-interface is a modern **responsive flat admin interface customizabl
![django-admin-interface-preview](https://user-images.githubusercontent.com/1035294/35631521-64b0cab8-06a4-11e8-8f57-c04fdfbb7e8b.gif) ![django-admin-interface-preview](https://user-images.githubusercontent.com/1035294/35631521-64b0cab8-06a4-11e8-8f57-c04fdfbb7e8b.gif)
---
## Features ## Features
- Beautiful default **django-theme** - Beautiful default **django-theme**
- Themes management and customization *(you can **customize admin title, logo and colors**)* - 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 - Environment name/marker
- Language chooser - Language chooser
- List filter dropdown - List filter dropdown
- `NEW` **Foldable apps** *(accordions in the navigation bar)*
- `NEW` **List filter sticky** - `NEW` **List filter sticky**
- `NEW` **Form controls sticky** *(pagination and save/delete buttons)* - `NEW` **Form controls sticky** *(pagination and save/delete buttons)*
- Compatibility / Style optimizations for: - Compatibility / Style optimizations for:
@@ -36,6 +39,8 @@ django-admin-interface is a modern **responsive flat admin interface customizabl
- `django-tabbed-admin` - `django-tabbed-admin`
- `sorl-thumbnail` - `sorl-thumbnail`
---
## Installation ## Installation
- Run `pip install django-admin-interface` - Run `pip install django-admin-interface`
- Add `admin_interface`, `flat_responsive`, `flat` and `colorfield` to `settings.INSTALLED_APPS` **before** `django.contrib.admin` - 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`` - Run ``python manage.py collectstatic --clear``
- Restart your application server - Restart your application server
---
## Optional themes ## 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. 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-color`
- `--admin-interface-related-modal-background-opacity` - `--admin-interface-related-modal-background-opacity`
---
## Screenshots ## Screenshots
###### Admin login ###### Admin login
@@ -133,11 +141,50 @@ You can add **theme support to existing third-party libraries** using the follow
###### Admin theme customization ###### Admin theme customization
![django-admin-interface_theme_customization](https://cloud.githubusercontent.com/assets/1035294/11240250/7350d942-8df1-11e5-9b28-f2f54c333cdc.gif) ![django-admin-interface_theme_customization](https://cloud.githubusercontent.com/assets/1035294/11240250/7350d942-8df1-11e5-9b28-f2f54c333cdc.gif)
---
## FAQ ## 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` 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 ## Testing
```bash ```bash
# create python virtual environment # create python virtual environment
@@ -151,6 +198,7 @@ git clone https://github.com/fabiocaccamo/django-admin-interface.git src && cd s
# install dependencies # install dependencies
pip install -r requirements.txt pip install -r requirements.txt
pip install -r requirements-test.txt
# run tests # run tests
tox tox
@@ -160,24 +208,13 @@ python setup.py test
python -m django test --settings "tests.settings" python -m django test --settings "tests.settings"
``` ```
---
## License ## License
Released under [MIT License](LICENSE.txt). 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 ## See also
- [`django-colorfield`](https://github.com/fabiocaccamo/django-colorfield) - simple color field for models with a nice color-picker in the admin. 🎨 - [`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-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. 🧟‍♂️ - [`python-fsutil`](https://github.com/fabiocaccamo/python-fsutil) - file-system utilities for lazy devs. 🧟‍♂️
+3 -2
View File
@@ -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'
+6
View File
@@ -100,6 +100,12 @@ class ThemeAdmin(admin.ModelAdmin):
'css_delete_button_text_color', 'css_delete_button_text_color',
) )
}), }),
(_('Navigation Bar'), {
'classes': ('wide', ),
'fields': (
'foldable_apps',
)
}),
(_('Related Modal'), { (_('Related Modal'), {
'classes': ('wide', ), 'classes': ('wide', ),
'fields': ( 'fields': (
+4 -1
View File
@@ -12,4 +12,7 @@ else:
if django.VERSION >= (1, 11): if django.VERSION >= (1, 11):
from django.core.validators import FileExtensionValidator from django.core.validators import FileExtensionValidator
else: 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_color": "#D9534F",
"css_delete_button_background_hover_color": "#C9302C", "css_delete_button_background_hover_color": "#C9302C",
"css_delete_button_text_color": "#FFFFFF", "css_delete_button_text_color": "#FFFFFF",
"css": "",
"related_modal_active": true, "related_modal_active": true,
"related_modal_background_color": "#503873", "related_modal_background_color": "#503873",
"related_modal_background_opacity": 0.2, "related_modal_background_opacity": 0.2,
@@ -27,7 +27,6 @@
"css_delete_button_background_color": "#BA2121", "css_delete_button_background_color": "#BA2121",
"css_delete_button_background_hover_color": "#A41515", "css_delete_button_background_hover_color": "#A41515",
"css_delete_button_text_color": "#FFFFFF", "css_delete_button_text_color": "#FFFFFF",
"css": "",
"related_modal_active": true, "related_modal_active": true,
"related_modal_background_color": "#000000", "related_modal_background_color": "#000000",
"related_modal_background_opacity": 0.2, "related_modal_background_opacity": 0.2,
@@ -27,7 +27,6 @@
"css_delete_button_background_color": "#CC4B37", "css_delete_button_background_color": "#CC4B37",
"css_delete_button_background_hover_color": "#BF4634", "css_delete_button_background_hover_color": "#BF4634",
"css_delete_button_text_color": "#FFFFFF", "css_delete_button_text_color": "#FFFFFF",
"css": "",
"related_modal_active": true, "related_modal_active": true,
"related_modal_background_color": "#000000", "related_modal_background_color": "#000000",
"related_modal_background_opacity": 0.2, "related_modal_background_opacity": 0.2,
@@ -27,7 +27,6 @@
"css_delete_button_background_color": "#CD2026", "css_delete_button_background_color": "#CD2026",
"css_delete_button_background_hover_color": "#981B1E", "css_delete_button_background_hover_color": "#981B1E",
"css_delete_button_text_color": "#FFFFFF", "css_delete_button_text_color": "#FFFFFF",
"css": "",
"related_modal_active": true, "related_modal_active": true,
"related_modal_background_color": "#000000", "related_modal_background_color": "#000000",
"related_modal_background_opacity": 0.8, "related_modal_background_opacity": 0.8,
@@ -27,7 +27,6 @@
"css_delete_button_background_color": "#BA2121", "css_delete_button_background_color": "#BA2121",
"css_delete_button_background_hover_color": "#A41515", "css_delete_button_background_hover_color": "#A41515",
"css_delete_button_text_color": "#FFFFFF", "css_delete_button_text_color": "#FFFFFF",
"css": "",
"related_modal_active": true, "related_modal_active": true,
"related_modal_background_color": "#000000", "related_modal_background_color": "#000000",
"related_modal_background_opacity": 0.2, "related_modal_background_opacity": 0.2,
@@ -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',
),
]
+4 -4
View File
@@ -269,10 +269,6 @@ class Theme(models.Model):
max_length=10, max_length=10,
verbose_name=_('text color')) verbose_name=_('text color'))
css = models.TextField(
blank=True,
verbose_name=_('text color'))
related_modal_active = models.BooleanField( related_modal_active = models.BooleanField(
default=True, default=True,
verbose_name=_('active')) verbose_name=_('active'))
@@ -313,6 +309,10 @@ class Theme(models.Model):
default=True, default=True,
verbose_name=_('sticky position')) verbose_name=_('sticky position'))
foldable_apps = models.BooleanField(
default=True,
verbose_name=_('foldable apps'))
recent_actions_visible = models.BooleanField( recent_actions_visible = models.BooleanField(
default=True, default=True,
verbose_name=_('visible')) verbose_name=_('visible'))
+15 -8
View File
@@ -5,23 +5,30 @@ from django.conf import settings
from django.core.exceptions import ImproperlyConfigured 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 dj_version = django.VERSION
installed_apps = settings.INSTALLED_APPS installed_apps = settings.INSTALLED_APPS
if dj_version < app_dj_version_limit: if max_dj_version is None:
if app not in installed_apps: if app not in installed_apps:
raise ImproperlyConfigured( raise ImproperlyConfigured(
'\'{}\' needed before django {}.{}, ' '\'{}\' is required, '
'add it to settings.INSTALLED_APPS.'.format( '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: else:
if app in installed_apps: if app in installed_apps:
raise ImproperlyConfigured( raise ImproperlyConfigured(
'\'{}\' not needed since django {}.{}, ' '\'{}\' is no more required since django {}.{}, '
'remove it from settings.INSTALLED_APPS.'.format( 'remove it from settings.INSTALLED_APPS.'.format(
app, *app_dj_version_limit)) app, *max_dj_version))
def check_installed_apps(): def check_installed_apps():
check_installed_app('flat', (1, 9)) check_installed_app('colorfield')
check_installed_app('flat_responsive', (2, 0)) 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');
}
};
})();
+24 -15
View File
@@ -29,11 +29,6 @@ https://github.com/fabiocaccamo/django-admin-interface
{% include "admin_interface/css/tinymce.css" %} {% include "admin_interface/css/tinymce.css" %}
{% include "admin_interface/css/json-widget.css" %} {% include "admin_interface/css/json-widget.css" %}
{% include "admin_interface/css/rtl.css" %} {% include "admin_interface/css/rtl.css" %}
{% if theme.css %}
{{ theme.css|safe }}
{% endif %}
</style> </style>
{% if current_lang == 'fa' %} {% 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.css' %}?v={{ version }}">
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/responsive_rtl.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/favicon.html" %}
{% include "admin_interface/foldable-apps.html" %}
{% include "admin_interface/related-modal.html" %} {% include "admin_interface/related-modal.html" %}
{% endblock %} {% 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 %} {% block branding %}
{% get_admin_interface_theme as theme %} {% get_admin_interface_theme as theme %}
<h1 id="site-name"> <h1 id="site-name">
{% if theme.logo_visible %} <a href="{% url 'admin:index' %}">
{% if theme.logo %} {% if theme.logo_visible %}
<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 %}> {% if theme.logo %}
{% else %} <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 %}>
<img class="logo default" style="display:none;" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" width="104" height="36"> {% else %}
<img class="logo default" style="display:none;" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" width="104" height="36">
{% endif %}
{% endif %} {% endif %}
{% endif %} {% if theme.title_visible %}
{% if theme.title_visible %} <span>{% if theme.title %}{% trans theme.title %}{% else %}{{ site_header|default:_('Django administration') }}{% endif %}</span>
<span>{% if theme.title %}{% trans theme.title %}{% else %}{{ site_header|default:_('Django administration') }}{% endif %}</span> {% endif %}
{% endif %} </a>
</h1> </h1>
{% endblock %} {% endblock %}
@@ -137,6 +137,10 @@
color: {{ theme.title_color }}; color: {{ theme.title_color }};
} }
.admin-interface #branding h1 a {
color: inherit;
}
.admin-interface #branding h1 .logo.default { .admin-interface #branding h1 .logo.default {
background-color: transparent; background-color: transparent;
background-repeat: no-repeat; background-repeat: no-repeat;
@@ -431,6 +435,14 @@
border-bottom-right-radius:0; border-bottom-right-radius:0;
{% endif %} {% endif %}
} }
.admin-interface .module.collapse.collapsed h2 {
/* fix collapsed inlines rounded bottom borders */
{% if theme.css_module_rounded_corners %}
border-bottom-left-radius:4px;
border-bottom-right-radius:4px;
{% endif %}
}
/* end fix */ /* end fix */
.admin-interface #content-related { .admin-interface #content-related {
@@ -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 -1
View File
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
__version__ = '0.17.1' __version__ = '0.18.4'
+4
View File
@@ -0,0 +1,4 @@
codecov
coverage
psycopg2
tox
-3
View File
@@ -1,8 +1,5 @@
codecov
coverage
django>=1.7 django>=1.7
django-colorfield django-colorfield
django-flat-theme django-flat-theme
django-flat-responsive django-flat-responsive
six>=1.9.0 six>=1.9.0
tox
+2
View File
@@ -56,6 +56,7 @@ setup(
'Framework :: Django :: 3.0', 'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1', 'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2', 'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Intended Audience :: Developers', 'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License', 'License :: OSI Approved :: MIT License',
'Natural Language :: English', 'Natural Language :: English',
@@ -69,6 +70,7 @@ setup(
'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Software Development :: Build Tools', 'Topic :: Software Development :: Build Tools',
], ],
license='MIT', license='MIT',
+7 -1
View File
@@ -40,7 +40,7 @@ INSTALLED_APPS += [
if django.VERSION < (2, 0): if django.VERSION < (2, 0):
MIDDLEWARE_CLASSES = [ MIDDLEWARE_CLASSES = [
'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware' 'django.contrib.messages.middleware.MessageMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware', '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 = { DATABASES = {
'default': database_config.get(database_engine), 'default': database_config.get(database_engine),
} }
+17 -7
View File
@@ -1,13 +1,23 @@
[tox] [tox]
envlist = envlist =
py27-{dj17,dj18,dj19,dj110,dj111}-{sqlite,postgres}, 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}-{sqlite,postgres},
py36-{dj18,dj19,dj110,dj111,dj20,dj21,dj22,dj30,dj31,dj32,djmaster}-{sqlite,postgres}, py37-{dj20,dj21,dj22,dj30,dj31,dj32}-{sqlite,postgres},
py37-{dj20,dj21,dj22,dj30,dj31,dj32,djmaster}-{sqlite,postgres}, py38-{dj22,dj30,dj31,dj32}-{sqlite,postgres},
py38-{dj22,dj30,dj31,dj32,djmaster}-{sqlite,postgres}, py39-{dj22,dj30,dj31,dj32}-{sqlite,postgres},
py39-{dj22,dj30,dj31,dj32,djmaster}-{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] [testenv]
passenv = CI TRAVIS TRAVIS_* passenv = CI GITHUB_WORKFLOW
deps = deps =
dj17: Django == 1.7.* dj17: Django == 1.7.*
dj18: Django == 1.8.* dj18: Django == 1.8.*
@@ -20,7 +30,7 @@ deps =
dj30: Django == 3.0.* dj30: Django == 3.0.*
dj31: Django == 3.1.* dj31: Django == 3.1.*
dj32: Django == 3.2.* dj32: Django == 3.2.*
djmaster: https://github.com/django/django/archive/master.tar.gz dj40: Django == 4.0.*
# mysql: mysqlclient # mysql: mysqlclient
postgres: psycopg2-binary postgres: psycopg2-binary
coverage coverage