Compare commits

...

16 Commits

Author SHA1 Message Date
Fabio Caccamo ee63826836 Updated CHANGELOG and version. 2022-01-21 13:41:56 +01:00
Fabio Caccamo 7c0a105c92 Fixed body scroll reset to top when opening related modal. #150 2022-01-21 13:39:21 +01:00
Fabio Caccamo c8ababb8e4 Create SECURITY.md 2022-01-20 19:26:59 +01:00
leandromsd 384a63f76f Added portuguese brazil localization. #149
* add portuguese brazil language

* replace empty translations with the original text

Co-authored-by: Leandro Caixeta <leandro.caixeta@buser.com.br>
2022-01-20 13:39:38 +01:00
Fabio Caccamo f6c4d50bb3 Update test-package.yml 2022-01-17 22:11:05 +01:00
Fabio Caccamo 84c15d2b28 Update setup.py 2022-01-12 02:23:16 +01:00
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
14 changed files with 445 additions and 76 deletions
+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 }}
@@ -1,4 +1,4 @@
name: Python package
name: Test package
on:
- push
@@ -8,6 +8,7 @@ jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10']
@@ -24,18 +25,24 @@ jobs:
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
+10
View File
@@ -4,6 +4,16 @@ 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.5](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.18.5) - 2022-01-21
- Added portuguese brazil (`pt_BR`) localization by [leandromsd](https://github.com/leandromsd). #149
- Fixed body scroll reset to top when opening related modal. #150
## [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
+49 -12
View File
@@ -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)
---
## Features
- Beautiful default **django-theme**
- Themes management and customization *(you can **customize admin title, logo and colors**)*
@@ -37,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`
@@ -66,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.
@@ -120,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
@@ -134,11 +141,50 @@ You can add **theme support to existing third-party libraries** using the follow
###### Admin theme customization
![django-admin-interface_theme_customization](https://cloud.githubusercontent.com/assets/1035294/11240250/7350d942-8df1-11e5-9b28-f2f54c333cdc.gif)
---
## 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
@@ -162,22 +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)
## See also
- [`django-colorfield`](https://github.com/fabiocaccamo/django-colorfield) - simple color field for models with a nice color-picker in the admin. 🎨
+14
View File
@@ -0,0 +1,14 @@
# Security Policy
## Supported Versions
Keep this library updated to the latest version.
| Version | Supported |
| ------- | ------------------ |
| latest | :white_check_mark: |
| oldest | :x: |
## Reporting a Vulnerability
Open an issue.
Binary file not shown.
@@ -0,0 +1,235 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-01-19 22:45-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: admin.py:21
msgid "Environment"
msgstr "Ambiente"
#: admin.py:30
msgid "Language chooser"
msgstr "Seletor de idioma"
#: admin.py:37
msgid "Logo"
msgstr "Logo"
#: admin.py:47
msgid "Favicon"
msgstr "Favicon"
#: admin.py:51
msgid "Title"
msgstr "Título"
#: admin.py:59
msgid "Header"
msgstr "Cabeçalho"
#: admin.py:68
msgid "Breadcrumbs / Module headers"
msgstr "Cabeçalhos de módulo"
#: admin.py:80
msgid "Generic Links"
msgstr "Links Genéricos"
#: admin.py:87
msgid "Save Buttons"
msgstr "Botões Salvar"
#: admin.py:95
msgid "Delete Buttons"
msgstr "Botões Deletar"
#: admin.py:103
msgid "Navigation Bar"
msgstr "Barra de Navegação"
#: admin.py:109
msgid "Related Modal"
msgstr "Modal Relacionado"
#: admin.py:119
msgid "Form Controls"
msgstr "Controles de Formulário"
#: admin.py:126
msgid "List Filter"
msgstr "Filtro de lista"
#: admin.py:133
msgid "Recent Actions"
msgstr "Ações recentes"
#: apps.py:12
msgid "Admin Interface"
msgstr "Interface do administrador"
#: models.py:73 models.py:129 models.py:148
msgid "name"
msgstr "nome"
#: models.py:76 models.py:145 models.py:274
msgid "active"
msgstr "ativo"
#: models.py:80 templates/admin/base_site.html:6
#: templates/admin/base_site.html:78
msgid "Django administration"
msgstr "Administrção do Django"
#: models.py:82
msgid "title"
msgstr "título"
#: models.py:88 models.py:105 models.py:135
msgid "color"
msgstr "cor"
#: models.py:91 models.py:116 models.py:318
msgid "visible"
msgstr "visível"
#: models.py:98
msgid "Leave blank to use the default Django logo"
msgstr "Deixe em branco para usar o logotipo padrão do Django"
#: models.py:99
msgid "logo"
msgstr "logo"
#: models.py:109
msgid "max width"
msgstr "largura máxima"
#: models.py:113
msgid "max height"
msgstr "altura máxima"
#: models.py:123
msgid "(.ico|.png|.gif - 16x16|32x32 px)"
msgstr "(.ico|.png|.gif - 16x16|32x32 px)"
#: models.py:124
msgid "favicon"
msgid "favicon"
msgstr ""
#: models.py:133
msgid ""
"(red: #E74C3C, orange: #E67E22, yellow: #F1C40F, green: #2ECC71, blue: "
"#3498DB)"
msgstr ""
"(vermelho: #E74C3C, laranja: #E67E22, amarelo: #F1C40F, verde: #2ECC71, azul: "
"#3498DB)"
#: models.py:138
msgid "visible in header (marker and name)"
msgstr "visível no cabeçalho (marcador e nome)"
#: models.py:141
msgid "visible in favicon (marker)"
msgstr "visível no favicon (marcador)"
#: models.py:147
msgid "code"
msgstr "código"
#: models.py:154
msgid "display"
msgstr "exibição"
#: models.py:161 models.py:186 models.py:239 models.py:258 models.py:280
msgid "background color"
msgstr "cor de fundo"
#: models.py:167 models.py:198 models.py:251 models.py:270
msgid "text color"
msgstr "cor do texto"
#: models.py:173 models.py:204 models.py:226
msgid "link color"
msgstr "cor do link"
#: models.py:179 models.py:216 models.py:232
msgid "link hover color"
msgstr "cor de foco do link"
#: models.py:192
msgid "background selected color"
msgstr "cor de fundo selecionada"
#: models.py:210
msgid "link selected color"
msgstr "link cor selecionada"
#: models.py:219 models.py:300
msgid "rounded corners"
msgstr "cantos arredondados"
#: models.py:245 models.py:264
msgid "background hover color"
msgstr "cor de fundo do foco"
#: models.py:297
msgid "background opacity"
msgstr "opacidade de fundo"
#: models.py:303
msgid "close button visible"
msgstr "botão fechar visível"
#: models.py:307
msgid "use dropdown"
msgstr "usar menu suspenso"
#: models.py:310
msgid "sticky position"
msgstr "sticky position"
#: models.py:314
msgid "foldable apps"
msgstr "aplicativos dobráveis"
#: models.py:322
msgid "sticky submit"
msgstr "envio fixo"
#: models.py:325
msgid "sticky pagination"
msgstr "paginação fixa"
#: models.py:334
msgid "Theme"
msgstr "Tema"
#: models.py:335
msgid "Themes"
msgstr "Temas"
#: templates/admin/filter.html:13
#: templates/admin_interface/dropdown_filter.html:4
#, python-format
msgid " By %(filter_title)s "
msgstr " por %(filter_title)s "
#: templates/admin/popup_response.html:3
msgid "Popup closing..."
msgstr "Pop-up fechando..."
@@ -108,6 +108,7 @@ if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined')
// open the popup using magnific popup
$.magnificPopup.open({
mainClass: iframeInternalModalClass,
fixedContentPos: false,
showCloseBtn: true,
closeBtnInside: true,
items: {
+11 -9
View File
@@ -66,16 +66,18 @@ flat-theme admin-interface
{% 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 %}
@@ -137,6 +137,10 @@
color: {{ theme.title_color }};
}
.admin-interface #branding h1 a {
color: inherit;
}
.admin-interface #branding h1 .logo.default {
background-color: transparent;
background-repeat: no-repeat;
@@ -431,6 +435,14 @@
border-bottom-right-radius:0;
{% 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 */
.admin-interface #content-related {
+1 -1
View File
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
__version__ = '0.18.3'
__version__ = '0.18.5'
+72 -51
View File
@@ -5,73 +5,94 @@ from setuptools import find_packages, setup
import os, sys
exec(open('admin_interface/version.py').read())
exec(open("admin_interface/version.py").read())
github_url = 'https://github.com/fabiocaccamo'
package_name = 'django-admin-interface'
package_url = '{}/{}'.format(github_url, package_name)
github_url = "https://github.com/fabiocaccamo"
sponsor_url = "https://github.com/sponsors/fabiocaccamo/"
twitter_url = "https://twitter.com/fabiocaccamo"
package_name = "django-admin-interface"
package_url = "{}/{}".format(github_url, package_name)
package_issues_url = "{}/issues".format(github_url)
package_path = os.path.abspath(os.path.dirname(__file__))
long_description_file_path = os.path.join(package_path, 'README.md')
long_description_content_type = 'text/markdown'
long_description = ''
long_description_file_path = os.path.join(package_path, "README.md")
long_description_content_type = "text/markdown"
long_description = ""
try:
long_description_file_options = {} if sys.version_info[0] < 3 else { 'encoding':'utf-8' }
with open(long_description_file_path, 'r', **long_description_file_options) as f:
long_description_file_options = (
{} if sys.version_info[0] < 3 else {"encoding": "utf-8"}
)
with open(long_description_file_path, "r", **long_description_file_options) as f:
long_description = f.read()
except IOError:
pass
setup(
name=package_name,
packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
packages=find_packages(exclude=["contrib", "docs", "tests*"]),
include_package_data=True,
version=__version__,
description='django-admin-interface is a modern responsive flat admin interface customizable by the admin itself.',
description="django-admin-interface is a modern responsive flat admin interface customizable by the admin itself.",
long_description=long_description,
long_description_content_type=long_description_content_type,
author='Fabio Caccamo',
author_email='fabio.caccamo@gmail.com',
author="Fabio Caccamo",
author_email="fabio.caccamo@gmail.com",
url=package_url,
download_url='{}/archive/{}.tar.gz'.format(package_url, __version__),
keywords=['django', 'admin', 'interface', 'responsive', 'flat', 'theme', 'custom', 'ui'],
requires=['django(>=1.7)'],
download_url="{}/archive/{}.tar.gz".format(package_url, __version__),
project_urls={
"Documentation": package_url,
"Issues": package_issues_url,
"Funding": sponsor_url,
"Twitter": twitter_url,
},
keywords=[
"django",
"admin",
"interface",
"responsive",
"flat",
"theme",
"custom",
"ui",
],
requires=["django(>=1.7)"],
install_requires=[
'django-colorfield >= 0.2, < 1.0',
'django-flat-theme >= 1.0, < 2.0',
'django-flat-responsive >= 1.0, < 3.0',
'six >= 1.9.0, < 2.0.0',
"django-colorfield >= 0.2, < 1.0",
"django-flat-theme >= 1.0, < 2.0",
"django-flat-responsive >= 1.0, < 3.0",
"six >= 1.9.0, < 2.0.0",
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 1.7',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Framework :: Django :: 2.1',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'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',
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 1.7",
"Framework :: Django :: 1.8",
"Framework :: Django :: 1.9",
"Framework :: Django :: 1.10",
"Framework :: Django :: 1.11",
"Framework :: Django :: 2.0",
"Framework :: Django :: 2.1",
"Framework :: Django :: 2.2",
"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",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"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',
test_suite='runtests.runtests'
license="MIT",
test_suite="runtests.runtests",
)
+1 -1
View File
@@ -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',
]
+2 -1
View File
@@ -5,7 +5,7 @@ envlist =
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}-{sqlite,postgres},
py310-{dj32,dj40}-{sqlite,postgres},
[gh-actions]
python =
@@ -30,6 +30,7 @@ deps =
dj30: Django == 3.0.*
dj31: Django == 3.1.*
dj32: Django == 3.2.*
dj40: Django == 4.0.*
# mysql: mysqlclient
postgres: psycopg2-binary
coverage