Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8185c7edf6 | |||
| 51862ad3ed | |||
| 0eed8c8679 | |||
| d74fcd4001 | |||
| 97e1a2b315 | |||
| 45266906a3 | |||
| 5496f996be | |||
| d85690fb9c | |||
| c44621dae1 | |||
| 5f2e2982b1 | |||
| 1b0d20f494 | |||
| 7e85ebac9b | |||
| 95fb2df285 |
@@ -1 +1,2 @@
|
|||||||
github: [fabiocaccamo]
|
github: [fabiocaccamo]
|
||||||
|
custom: ['https://www.paypal.me/fabiocaccamo']
|
||||||
|
|||||||
@@ -18,7 +18,12 @@ jobs:
|
|||||||
uses: ffurrer2/extract-release-notes@v1
|
uses: ffurrer2/extract-release-notes@v1
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
uses: ncipollo/release-action@v1
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
|
tag_name: ${{ github.ref }}
|
||||||
|
release_name: ${{ github.ref }}
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
body: ${{ steps.extract-release-notes.outputs.release_notes }}
|
body: ${{ steps.extract-release-notes.outputs.release_notes }}
|
||||||
token: ${{ secrets.WORKFLOWS_CREATE_RELEASE_TOKEN }}
|
|
||||||
|
|||||||
@@ -4,15 +4,6 @@ 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.20.0](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.20.0) - 2022-08-25
|
|
||||||
- Add `django-streamfield` compatibility.
|
|
||||||
|
|
||||||
## [0.19.2](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.19.2) - 2022-08-04
|
|
||||||
- Fix `hashlib` compatibility with `FIPS` enabled systems. #167 (by [@jonlev1n](https://github.com/jonlev1n) in #168)
|
|
||||||
|
|
||||||
## [0.19.1](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.19.1) - 2022-05-14
|
|
||||||
- [css] Fixed dashboard alignment when recent-actions are not visible.
|
|
||||||
|
|
||||||
## [0.19.0](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.19.0) - 2022-03-08
|
## [0.19.0](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.19.0) - 2022-03-08
|
||||||
- Converted dynamic inline CSS to external static CSS using CSS variables. #157 #93 (thanks to [@Mustafa-Abu-Ghazy](https://github.com/Mustafa-Abu-Ghazy))
|
- Converted dynamic inline CSS to external static CSS using CSS variables. #157 #93 (thanks to [@Mustafa-Abu-Ghazy](https://github.com/Mustafa-Abu-Ghazy))
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ django-admin-interface is a modern **responsive flat admin interface customizabl
|
|||||||
- `django-json-widget`
|
- `django-json-widget`
|
||||||
- `django-modeltranslation`
|
- `django-modeltranslation`
|
||||||
- `django-tabbed-admin`
|
- `django-tabbed-admin`
|
||||||
- `django-streamfield`
|
|
||||||
- `sorl-thumbnail`
|
- `sorl-thumbnail`
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -101,48 +100,31 @@ You can add a theme you've created through the admin to this repository by [send
|
|||||||
4. Edit the section above to document your theme.
|
4. Edit the section above to document your theme.
|
||||||
|
|
||||||
### Add theme support to third-party libraries
|
### Add theme support to third-party libraries
|
||||||
You can add **theme support to existing third-party libraries** using the following **CSS variables**:
|
You can add **theme support to existing third-party libraries** using the following **css variables**:
|
||||||
|
|
||||||
#### Header
|
- `--admin-interface-title-color`
|
||||||
|
- `--admin-interface-logo-color`
|
||||||
- `--admin-interface-header-background-color`
|
- `--admin-interface-env-color`
|
||||||
|
- `--admin-interface-header-background-color:`
|
||||||
- `--admin-interface-header-text-color`
|
- `--admin-interface-header-text-color`
|
||||||
- `--admin-interface-header-link-color`
|
- `--admin-interface-header-link-color`
|
||||||
- `--admin-interface-header-link_hover-color`
|
- `--admin-interface-header-link_hover-color`
|
||||||
- `--admin-interface-title-color`
|
|
||||||
- `--admin-interface-env-color`
|
|
||||||
|
|
||||||
#### Logo
|
|
||||||
|
|
||||||
- `--admin-interface-logo-color`
|
|
||||||
- `--admin-interface-logo-default-background-image`
|
|
||||||
- `--admin-interface-logo-max-width`
|
|
||||||
- `--admin-interface-logo-max-height`
|
|
||||||
|
|
||||||
#### Modules / Links
|
|
||||||
- `--admin-interface-module-background-color`
|
- `--admin-interface-module-background-color`
|
||||||
- `--admin-interface-module-background-selected-color`
|
- `--admin-interface-module-background-selected-color`
|
||||||
- `--admin-interface-module-border-radius`
|
|
||||||
- `--admin-interface-module-text-color`
|
- `--admin-interface-module-text-color`
|
||||||
- `--admin-interface-module-link-color`
|
- `--admin-interface-module-link-color`
|
||||||
- `--admin-interface-module-link-selected-color`
|
- `--admin-interface-module-link-selected-color`
|
||||||
- `--admin-interface-module-link-hover-color`
|
- `--admin-interface-module-link-hover-color`
|
||||||
- `--admin-interface-generic-link-color`
|
- `--admin-interface-generic-link-color`
|
||||||
- `--admin-interface-generic-link-hover-color`
|
- `--admin-interface-generic-link-hover-color`
|
||||||
|
|
||||||
#### Buttons
|
|
||||||
- `--admin-interface-save-button-background-color`
|
- `--admin-interface-save-button-background-color`
|
||||||
- `--admin-interface-save-button-background-hover-color`
|
- `--admin-interface-save-button-background-hover-color`
|
||||||
- `--admin-interface-save-button-text-color`
|
- `--admin-interface-save-button-text-color`
|
||||||
- `--admin-interface-delete-button-background-color`
|
- `--admin-interface-delete-button-background-color`
|
||||||
- `--admin-interface-delete-button-background-hover-color`
|
- `--admin-interface-delete-button-background-hover-color`
|
||||||
- `--admin-interface-delete-button-text-color`
|
- `--admin-interface-delete-button-text-color`
|
||||||
|
|
||||||
#### Related Modal
|
|
||||||
- `--admin-interface-related-modal-background-color`
|
- `--admin-interface-related-modal-background-color`
|
||||||
- `--admin-interface-related-modal-background-opacity`
|
- `--admin-interface-related-modal-background-opacity`
|
||||||
- `--admin-interface-related-modal-border-radius`
|
|
||||||
- `--admin-interface-related-modal-close-button-display`
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -176,7 +158,7 @@ You must configure multilanguage `settings` and `urls` correctly:
|
|||||||
LANGUAGES = (
|
LANGUAGES = (
|
||||||
("en", _("English")),
|
("en", _("English")),
|
||||||
("it", _("Italiano")),
|
("it", _("Italiano")),
|
||||||
("fr", _("Français")),
|
("fr", _("Française")),
|
||||||
# more than one language is expected here
|
# more than one language is expected here
|
||||||
)
|
)
|
||||||
LANGUAGE_CODE = "en"
|
LANGUAGE_CODE = "en"
|
||||||
@@ -205,17 +187,18 @@ urlpatterns += i18n_patterns(path("admin/", admin.site.urls))
|
|||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
```bash
|
```bash
|
||||||
# clone repository
|
# create python virtual environment
|
||||||
git clone https://github.com/fabiocaccamo/django-admin-interface.git && cd django-admin-interface
|
virtualenv testing_django_admin_interface
|
||||||
|
|
||||||
# create virtualenv and activate it
|
# activate virtualenv
|
||||||
python -m venv venv && . venv/bin/activate
|
cd testing_django_admin_interface && . bin/activate
|
||||||
|
|
||||||
# upgrade pip
|
# clone repo
|
||||||
python -m pip install --upgrade pip
|
git clone https://github.com/fabiocaccamo/django-admin-interface.git src && cd src
|
||||||
|
|
||||||
# install requirements
|
# install dependencies
|
||||||
pip install -r requirements.txt -r requirements-test.txt
|
pip install -r requirements.txt
|
||||||
|
pip install -r requirements-test.txt
|
||||||
|
|
||||||
# run tests
|
# run tests
|
||||||
tox
|
tox
|
||||||
@@ -232,13 +215,6 @@ Released under [MIT License](LICENSE.txt).
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Supporting
|
|
||||||
|
|
||||||
- :star: Star this project on [GitHub](https://github.com/fabiocaccamo/django-admin-interface)
|
|
||||||
- :octocat: Follow me on [GitHub](https://github.com/fabiocaccamo)
|
|
||||||
- :blue_heart: Follow me on [Twitter](https://twitter.com/fabiocaccamo)
|
|
||||||
- :moneybag: Sponsor me on [Github](https://github.com/sponsors/fabiocaccamo)
|
|
||||||
|
|
||||||
## 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. 🎨
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ from django.contrib.auth import models as auth_models
|
|||||||
from admin_interface.compat import gettext_lazy as _
|
from admin_interface.compat import gettext_lazy as _
|
||||||
from admin_interface.models import Theme, UserTheme
|
from admin_interface.models import Theme, UserTheme
|
||||||
|
|
||||||
|
from .import_tema.admin import ImportMixin
|
||||||
|
|
||||||
|
|
||||||
class UserInline(admin.TabularInline):
|
class UserInline(admin.TabularInline):
|
||||||
model = UserTheme
|
model = UserTheme
|
||||||
@@ -13,13 +15,14 @@ class UserInline(admin.TabularInline):
|
|||||||
autocomplete_fields = ('user', )
|
autocomplete_fields = ('user', )
|
||||||
|
|
||||||
|
|
||||||
class ThemeAdmin(admin.ModelAdmin):
|
class ThemeAdmin(ImportMixin, admin.ModelAdmin):
|
||||||
inlines = [UserInline, ]
|
inlines = [UserInline, ]
|
||||||
|
|
||||||
list_display = (
|
list_display = (
|
||||||
"name",
|
"name",
|
||||||
"active",
|
"active",
|
||||||
"demo",
|
"demo",
|
||||||
|
"default",
|
||||||
)
|
)
|
||||||
list_editable = ("active",)
|
list_editable = ("active",)
|
||||||
list_per_page = 100
|
list_per_page = 100
|
||||||
@@ -34,6 +37,7 @@ class ThemeAdmin(admin.ModelAdmin):
|
|||||||
"name",
|
"name",
|
||||||
"active",
|
"active",
|
||||||
"demo",
|
"demo",
|
||||||
|
"default",
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
from .models import Theme
|
from .models import Theme, UserTheme
|
||||||
|
|
||||||
def get_active_theme(request):
|
def get_active_theme(request):
|
||||||
objs_manager = Theme.objects
|
objs_manager = Theme.objects
|
||||||
|
user_theme_manager = UserTheme.objects
|
||||||
objs_active_qs = objs_manager.filter(active=True)
|
objs_active_qs = objs_manager.filter(active=True)
|
||||||
objs_active_ls = list(objs_active_qs)
|
objs_active_ls = list(objs_active_qs)
|
||||||
objs_active_count = len(objs_active_ls)
|
objs_active_count = len(objs_active_ls)
|
||||||
@@ -17,6 +18,7 @@ def get_active_theme(request):
|
|||||||
obj = objs_active_ls[0]
|
obj = objs_active_ls[0]
|
||||||
|
|
||||||
elif objs_active_count > 1:
|
elif objs_active_count > 1:
|
||||||
|
|
||||||
# for frame_record in inspect.stack():
|
# for frame_record in inspect.stack():
|
||||||
# if frame_record[3]=='get_response':
|
# if frame_record[3]=='get_response':
|
||||||
# request = frame_record[0].f_locals['request']
|
# request = frame_record[0].f_locals['request']
|
||||||
@@ -26,10 +28,15 @@ def get_active_theme(request):
|
|||||||
# request = None
|
# request = None
|
||||||
user = request.user
|
user = request.user
|
||||||
try:
|
try:
|
||||||
obj = objs_active_qs.filter(user=user).first()
|
obj = user_theme_manager.filter(user=user, theme__active=True).first().theme
|
||||||
except:
|
except:
|
||||||
obj = objs_active_ls[-1]
|
objs_default_qs = objs_active_qs.filter(default=True)
|
||||||
obj.set_active()
|
if len(objs_default_qs) == 0:
|
||||||
|
obj = objs_active_qs.first()
|
||||||
|
if obj:
|
||||||
|
obj.set_default()
|
||||||
|
else:
|
||||||
|
obj = objs_default_qs.first()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'theme': obj,
|
'theme': obj,
|
||||||
|
|||||||
@@ -109,12 +109,16 @@ class ImportMixin(admin.ModelAdmin):
|
|||||||
allowed_extensions=[".gif", ".jpg", ".jpeg", ".png", ".svg"]
|
allowed_extensions=[".gif", ".jpg", ".jpeg", ".png", ".svg"]
|
||||||
try:
|
try:
|
||||||
tema_json = [s for s in os.listdir(f'{tempdir}/{lst[0]}') if '.json' in s][0]
|
tema_json = [s for s in os.listdir(f'{tempdir}/{lst[0]}') if '.json' in s][0]
|
||||||
logo = [s for s in os.listdir(f'{tempdir}/{lst[0]}/logo') if any(ele in s for ele in allowed_extensions)][0]
|
logo = [s for s in os.listdir(f'{tempdir}/{lst[0]}/logo') if any(ele in s for ele in allowed_extensions)]
|
||||||
favicon = [s for s in os.listdir(f'{tempdir}/{lst[0]}/favicon') if any(ele in s for ele in allowed_extensions)][0]
|
logo = logo[0] if logo else None
|
||||||
|
favicon = [s for s in os.listdir(f'{tempdir}/{lst[0]}/favicon') if any(ele in s for ele in allowed_extensions)]
|
||||||
|
favicon = favicon[0] if favicon else None
|
||||||
with open(f'{tempdir}/{lst[0]}/{tema_json}', 'r') as temporary_file:
|
with open(f'{tempdir}/{lst[0]}/{tema_json}', 'r') as temporary_file:
|
||||||
result = json.loads(temporary_file.read())
|
result = json.loads(temporary_file.read())
|
||||||
|
if logo:
|
||||||
with open(f'{tempdir}/{lst[0]}/logo/{logo}', 'rb') as temporary_file:
|
with open(f'{tempdir}/{lst[0]}/logo/{logo}', 'rb') as temporary_file:
|
||||||
default_storage.save(f"admin-interface/logo/{temporary_file.name.split('/')[-1]}", temporary_file)
|
default_storage.save(f"admin-interface/logo/{temporary_file.name.split('/')[-1]}", temporary_file)
|
||||||
|
if favicon:
|
||||||
with open(f'{tempdir}/{lst[0]}/favicon/{favicon}', 'rb') as temporary_file:
|
with open(f'{tempdir}/{lst[0]}/favicon/{favicon}', 'rb') as temporary_file:
|
||||||
default_storage.save(f"admin-interface/favicon/{temporary_file.name.split('/')[-1]}", temporary_file)
|
default_storage.save(f"admin-interface/favicon/{temporary_file.name.split('/')[-1]}", temporary_file)
|
||||||
skip_result = False
|
skip_result = False
|
||||||
|
|||||||
@@ -45,5 +45,5 @@ class Migration(migrations.Migration):
|
|||||||
verbose_name="link selected color",
|
verbose_name="link selected color",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
migrations.RunPython(default_link_selected),
|
migrations.RunPython(default_link_selected,migrations.RunPython.noop),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 4.0.3 on 2023-01-30 14:00
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('admin_interface', '0029_auto_20221025_1559'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='theme',
|
||||||
|
name='default',
|
||||||
|
field=models.BooleanField(default=False, verbose_name='default'),
|
||||||
|
),
|
||||||
|
]
|
||||||
+65
-14
@@ -57,6 +57,7 @@ class Theme(models.Model):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def get_active_theme():
|
def get_active_theme():
|
||||||
objs_manager = Theme.objects
|
objs_manager = Theme.objects
|
||||||
|
user_theme_manager = UserTheme.objects
|
||||||
objs_active_qs = objs_manager.filter(active=True)
|
objs_active_qs = objs_manager.filter(active=True)
|
||||||
objs_active_ls = list(objs_active_qs)
|
objs_active_ls = list(objs_active_qs)
|
||||||
objs_active_count = len(objs_active_ls)
|
objs_active_count = len(objs_active_ls)
|
||||||
@@ -81,10 +82,15 @@ class Theme(models.Model):
|
|||||||
request = None
|
request = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return objs_active_qs.filter(user=user).first()
|
return user_theme_manager.filter(user=user, theme__active=True).first().theme
|
||||||
except:
|
except:
|
||||||
obj = objs_active_ls[-1]
|
objs_default_qs = objs_active_qs.filter(default=True)
|
||||||
obj.set_active()
|
if len(objs_default_qs) == 0:
|
||||||
|
obj = objs_active_qs.first()
|
||||||
|
if obj:
|
||||||
|
obj.set_default()
|
||||||
|
else:
|
||||||
|
obj = objs_default_qs.first()
|
||||||
|
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
@@ -94,6 +100,9 @@ class Theme(models.Model):
|
|||||||
active = models.BooleanField(default=True, verbose_name=_("active"))
|
active = models.BooleanField(default=True, verbose_name=_("active"))
|
||||||
|
|
||||||
demo = models.BooleanField(default=False, verbose_name=_("is demo"))
|
demo = models.BooleanField(default=False, verbose_name=_("is demo"))
|
||||||
|
|
||||||
|
default = models.BooleanField(default=False, verbose_name="default")
|
||||||
|
|
||||||
users = models.ManyToManyField('auth.User', through=UserTheme)
|
users = models.ManyToManyField('auth.User', through=UserTheme)
|
||||||
|
|
||||||
title = models.CharField(
|
title = models.CharField(
|
||||||
@@ -172,8 +181,14 @@ class Theme(models.Model):
|
|||||||
default=True, verbose_name=_("active")
|
default=True, verbose_name=_("active")
|
||||||
)
|
)
|
||||||
language_chooser_display_choices = (
|
language_chooser_display_choices = (
|
||||||
("code", _("code")),
|
(
|
||||||
("name", _("name")),
|
"code",
|
||||||
|
_("code"),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"name",
|
||||||
|
_("name"),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
language_chooser_display = models.CharField(
|
language_chooser_display = models.CharField(
|
||||||
max_length=10,
|
max_length=10,
|
||||||
@@ -326,15 +341,42 @@ class Theme(models.Model):
|
|||||||
verbose_name=_("background color"),
|
verbose_name=_("background color"),
|
||||||
)
|
)
|
||||||
related_modal_background_opacity_choices = (
|
related_modal_background_opacity_choices = (
|
||||||
("0.1", "10%"),
|
(
|
||||||
("0.2", "20%"),
|
"0.1",
|
||||||
("0.3", "30%"),
|
"10%",
|
||||||
("0.4", "40%"),
|
),
|
||||||
("0.5", "50%"),
|
(
|
||||||
("0.6", "60%"),
|
"0.2",
|
||||||
("0.7", "70%"),
|
"20%",
|
||||||
("0.8", "80%"),
|
),
|
||||||
("0.9", "90%"),
|
(
|
||||||
|
"0.3",
|
||||||
|
"30%",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"0.4",
|
||||||
|
"40%",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"0.5",
|
||||||
|
"50%",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"0.6",
|
||||||
|
"60%",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"0.7",
|
||||||
|
"70%",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"0.8",
|
||||||
|
"80%",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"0.9",
|
||||||
|
"90%",
|
||||||
|
),
|
||||||
)
|
)
|
||||||
related_modal_background_opacity = models.CharField(
|
related_modal_background_opacity = models.CharField(
|
||||||
max_length=5,
|
max_length=5,
|
||||||
@@ -375,6 +417,15 @@ class Theme(models.Model):
|
|||||||
self.active = True
|
self.active = True
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
|
def set_default(self):
|
||||||
|
self.default = True
|
||||||
|
self.save()
|
||||||
|
|
||||||
|
def save(self):
|
||||||
|
if self.default:
|
||||||
|
Theme.objects.update(default=False)
|
||||||
|
super().save()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
app_label = "admin_interface"
|
app_label = "admin_interface"
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var windowRef = window;
|
var windowRef = window;
|
||||||
var windowRefProxy;
|
|
||||||
var windowName, widgetName;
|
var windowName, widgetName;
|
||||||
var openerRef = windowRef.opener;
|
var openerRef = windowRef.opener;
|
||||||
if (!openerRef) {
|
if (!openerRef) {
|
||||||
@@ -15,14 +14,13 @@
|
|||||||
// django < 3.1 compatibility
|
// django < 3.1 compatibility
|
||||||
widgetName = openerRef.id_to_windowname(widgetName);
|
widgetName = openerRef.id_to_windowname(widgetName);
|
||||||
}
|
}
|
||||||
windowRefProxy = {
|
windowRef = {
|
||||||
name: widgetName,
|
name: widgetName,
|
||||||
location: windowRef.location,
|
location: windowRef.location,
|
||||||
close: function() {
|
close: function() {
|
||||||
openerRef.dismissRelatedObjectModal();
|
openerRef.dismissRelatedObjectModal();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
windowRef = windowRefProxy;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// default django popup_response.js
|
// default django popup_response.js
|
||||||
|
|||||||
+1
-1
@@ -1507,7 +1507,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Get element position relative to viewport
|
// Get element postion relative to viewport
|
||||||
_getOffset: function(isLarge) {
|
_getOffset: function(isLarge) {
|
||||||
var el;
|
var el;
|
||||||
if(isLarge) {
|
if(isLarge) {
|
||||||
|
|||||||
@@ -136,30 +136,23 @@ if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined')
|
|||||||
window.presentRelatedObjectModalOnClickOn = presentRelatedObjectModalOnClickOn;
|
window.presentRelatedObjectModalOnClickOn = presentRelatedObjectModalOnClickOn;
|
||||||
|
|
||||||
// django 1.7 compatibility
|
// django 1.7 compatibility
|
||||||
|
// $('a.add-another').removeAttr('onclick').click({ lookup:false }, presentRelatedObjectModal);
|
||||||
presentRelatedObjectModalOnClickOn('a.add-another');
|
presentRelatedObjectModalOnClickOn('a.add-another');
|
||||||
|
|
||||||
// django 1.8 and above
|
// django 1.8 and above
|
||||||
|
// $('a.related-widget-wrapper-link').click({ lookup:false }, presentRelatedObjectModal);
|
||||||
presentRelatedObjectModalOnClickOn('a.related-widget-wrapper-link');
|
presentRelatedObjectModalOnClickOn('a.related-widget-wrapper-link');
|
||||||
|
|
||||||
// raw_id_fields support
|
// raw_id_fields support
|
||||||
|
// $('a.related-lookup').unbind('click').click({ lookup:true }, presentRelatedObjectModal);
|
||||||
presentRelatedObjectModalOnClickOn('a.related-lookup', true);
|
presentRelatedObjectModalOnClickOn('a.related-lookup', true);
|
||||||
|
|
||||||
// django-dynamic-raw-id support - #61
|
// django-dynamic-raw-id support - #61
|
||||||
// https://github.com/lincolnloop/django-dynamic-raw-id
|
// https://github.com/lincolnloop/django-dynamic-raw-id
|
||||||
presentRelatedObjectModalOnClickOn('a.dynamic_raw_id-related-lookup', true);
|
presentRelatedObjectModalOnClickOn('a.dynamic_raw_id-related-lookup', true);
|
||||||
|
|
||||||
// django-streamfield support
|
// show_change_link=True support
|
||||||
// https://github.com/raagin/django-streamfield/
|
presentRelatedObjectModalOnClickOn('a.inlinechangelink');
|
||||||
presentRelatedObjectModalOnClickOn('.streamfield_app a.stream-btn[href*="_popup=1"]');
|
|
||||||
// Vanilla js for catching the click during capture phase for anticipating Vue.js listener.
|
|
||||||
document.addEventListener('click', function(event) {
|
|
||||||
// console.log('click intercepted before Vue.');
|
|
||||||
if (event.target.matches('.streamfield_app a.stream-btn[href*="_popup=1"]')) {
|
|
||||||
event.stopImmediatePropagation();
|
|
||||||
event.preventDefault();
|
|
||||||
$(event.target).trigger('click');
|
|
||||||
}
|
|
||||||
}, { capture: true });
|
|
||||||
});
|
});
|
||||||
|
|
||||||
})(django.jQuery);
|
})(django.jQuery);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ CKEDITOR.skin.name = 'husky';
|
|||||||
// the complete list:
|
// the complete list:
|
||||||
// http://docs.ckeditor.com/#!/api/CKEDITOR.env
|
// http://docs.ckeditor.com/#!/api/CKEDITOR.env
|
||||||
//
|
//
|
||||||
// Internet explorer is an exception and the browser version is also accepted
|
// Internet explorer is an expection and the browser version is also accepted
|
||||||
// (ie7, ie8, ie9, ie10), as well as a special name for IE in Quirks mode (iequirks).
|
// (ie7, ie8, ie9, ie10), as well as a special name for IE in Quirks mode (iequirks).
|
||||||
//
|
//
|
||||||
// The available browser specific files must be set separately for editor.css
|
// The available browser specific files must be set separately for editor.css
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
(function() {
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var windowRef = window;
|
|
||||||
var openerRef = windowRef.parent;
|
|
||||||
|
|
||||||
var initData = JSON.parse(document.getElementById('django-admin-popup-response-constants').dataset.popupResponse);
|
|
||||||
switch (initData.action) {
|
|
||||||
case 'change':
|
|
||||||
openerRef.streamapps[initData.app_id].updateBlock(initData.block_id, initData.instance_id);
|
|
||||||
openerRef.dismissRelatedObjectModal();
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
openerRef.streamapps[initData.app_id].updateBlock(initData.block_id, initData.instance_id);
|
|
||||||
openerRef.dismissRelatedObjectModal();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
})();
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -16,7 +16,7 @@
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
border-top: 1px solid #EEEEEE !important;
|
border-top: 1px solid #EEEEEE;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
.admin-interface .language-chooser {
|
|
||||||
display: inline-block;
|
|
||||||
position: absolute;
|
|
||||||
top: 15px;
|
|
||||||
right: 15px;
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
|
||||||
.admin-interface .language-chooser {
|
|
||||||
right: 30px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 1024px) {
|
|
||||||
.admin-interface .language-chooser {
|
|
||||||
position: static;
|
|
||||||
float: right;
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .language-chooser-hidden-form {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .language-chooser-select-form {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
@@ -3,14 +3,10 @@ list-filter-dropdown
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
.admin-interface .list-filter-dropdown {
|
.admin-interface .list-filter-dropdown {
|
||||||
margin-top: 0;
|
margin-top:10px;
|
||||||
margin-bottom:20px;
|
margin-bottom:20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface .list-filter-dropdown h3 {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .list-filter-dropdown select {
|
.admin-interface .list-filter-dropdown select {
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
width: calc(100% - 30px);
|
width: calc(100% - 30px);
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
{% if not theme.recent_actions_visible %}
|
{% if not theme.recent_actions_visible %}
|
||||||
.admin-interface.dashboard #content {
|
.admin-interface.dashboard #content {
|
||||||
width: auto;
|
|
||||||
max-width:600px;
|
max-width:600px;
|
||||||
margin-right:0;
|
margin-right:0;
|
||||||
margin-left: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface.dashboard #content #recent-actions-module {
|
.admin-interface.dashboard #content #recent-actions-module {
|
||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,200 +0,0 @@
|
|||||||
/*
|
|
||||||
django-streamfield support
|
|
||||||
https://github.com/raagin/django-streamfield/
|
|
||||||
*/
|
|
||||||
|
|
||||||
.admin-interface .form-row.field-stream {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .form-row.field-stream label[for=id_stream] {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app {
|
|
||||||
clear: both;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-help-text {
|
|
||||||
margin-bottom: 15px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-help-text .stream-help-text__title {
|
|
||||||
align-self: flex-end;
|
|
||||||
user-select: none;
|
|
||||||
padding: 8px;
|
|
||||||
padding-right: 0;
|
|
||||||
color: var(--admin-interface-generic-link-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-help-text .stream-help-text__title:hover {
|
|
||||||
color: var(--admin-interface-generic-link-hover-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-help-text .stream-help-text__content {
|
|
||||||
background: var(--admin-interface-module-background-selected-color);
|
|
||||||
border-radius: var(--admin-interface-module-border-radius);
|
|
||||||
border: 1px solid rgba(0,0,0,0.1);
|
|
||||||
padding: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-help-text .stream-help-text__content > ul {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .collapse-handler {
|
|
||||||
user-select: none;
|
|
||||||
padding: 8px;
|
|
||||||
padding-right: 0;
|
|
||||||
margin: 0 0 5px 0;
|
|
||||||
color: var(--admin-interface-generic-link-color);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .collapse-handler:hover {
|
|
||||||
color: var(--admin-interface-generic-link-hover-color);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-model-block {
|
|
||||||
position: relative;
|
|
||||||
box-shadow: none;
|
|
||||||
border: 1px solid rgba(0,0,0,0.1);
|
|
||||||
border-radius: var(--admin-interface-module-border-radius);
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-model-block,
|
|
||||||
.admin-interface .streamfield_app .streamfield-models.collapsed .stream-model-block {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin: 0;
|
|
||||||
padding: 10px 10px 10px 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title span {
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title .streamblock__block-handle {
|
|
||||||
position: static;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
color: var(--admin-interface-generic-link-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title .streamblock__block-handle:hover {
|
|
||||||
color: var(--admin-interface-generic-link-hover-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title .streamblock__block-handle {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title .streamblock__block-handle .block-move,
|
|
||||||
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title .streamblock__block-handle .block-delete {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
font-weight: normal;
|
|
||||||
background: none;
|
|
||||||
flex-shrink: 0;
|
|
||||||
color: inherit;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title .streamblock__block-handle .block-move {
|
|
||||||
cursor: move; /* fallback if grab cursor is unsupported */
|
|
||||||
cursor: grab;
|
|
||||||
cursor: -moz-grab;
|
|
||||||
cursor: -webkit-grab;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title .streamblock__block-handle .block-move:before {
|
|
||||||
content: "↕";
|
|
||||||
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title .streamblock__block-handle .block-delete:before {
|
|
||||||
content: "×";
|
|
||||||
display: block;
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .block-fields > div {
|
|
||||||
margin-bottom: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-model-block .stream-model-block__content {
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-model-block .stream-model-block__content.no-subblocks.abstract-block {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-insert-new-block {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-insert-new-block .add-new-block-button {
|
|
||||||
color: var(--admin-interface-generic-link-color);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-insert-new-block .add-new-block-button:hover {
|
|
||||||
color: var(--admin-interface-generic-link-hover-color);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-insert-new-block ul {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
margin: 10px 0 0 0;
|
|
||||||
padding: 0;
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-insert-new-block ul li {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 12px;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-btn {
|
|
||||||
font-weight: normal;
|
|
||||||
text-decoration: none;
|
|
||||||
background-color: var(--admin-interface-generic-link-color);
|
|
||||||
padding: 6px 12px;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-btn:hover {
|
|
||||||
text-decoration: none;
|
|
||||||
background-color: var(--admin-interface-generic-link-hover-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-interface .streamfield_app .stream-insert-new-block ul li .stream-btn {
|
|
||||||
margin-top: 5px;
|
|
||||||
margin-left: 5px;
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
{% if theme.favicon %}
|
{% if theme.favicon %}
|
||||||
<link rel="icon" href="{{ theme.favicon.url }}">
|
<link rel="icon" href="{{ theme.favicon.url }}">
|
||||||
{% if theme.env_visible_in_favicon %}
|
{% if theme.env_visible_in_favicon %}
|
||||||
<script type="text/javascript" src="{% static 'admin_interface/favico/favico-0.3.10-patched.min.js' %}?nocache={{ version_md5_cache }}"></script>
|
<script type="text/javascript" src="{% static 'admin_interface/favico/favico-0.3.10-patched.min.js' %}"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var favicon = new Favico({
|
var favicon = new Favico({
|
||||||
type: 'circle',
|
type: 'circle',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
|
|
||||||
{% if theme.foldable_apps %}
|
{% if theme.foldable_apps %}
|
||||||
<link rel="stylesheet" type="text/css" href="{% static 'admin_interface/foldable-apps/foldable-apps.css' %}?nocache={{ version_md5_cache }}">
|
<link rel="stylesheet" type="text/css" href="{% static 'admin_interface/foldable-apps/foldable-apps.css' %}">
|
||||||
<script type="text/javascript" src="{% static 'admin_interface/foldable-apps/foldable-apps.js' %}?nocache={{ version_md5_cache }}"></script>
|
<script type="text/javascript" src="{% static 'admin_interface/foldable-apps/foldable-apps.js' %}"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
|
|
||||||
{% if theme.related_modal_active %}
|
{% if theme.related_modal_active %}
|
||||||
<link rel="stylesheet" type="text/css" href="{% static 'admin_interface/magnific-popup/magnific-popup.css' %}?nocache={{ version_md5_cache }}">
|
<link rel="stylesheet" type="text/css" href="{% static 'admin_interface/magnific-popup/magnific-popup.css' %}">
|
||||||
<script type="text/javascript" src="{% static 'admin_interface/magnific-popup/jquery.magnific-popup.js' %}?nocache={{ version_md5_cache }}"></script>
|
<script type="text/javascript" src="{% static 'admin_interface/magnific-popup/jquery.magnific-popup.js' %}"></script>
|
||||||
<script type="text/javascript" src="{% static 'admin_interface/related-modal/related-modal.js' %}?nocache={{ version_md5_cache }}"></script>
|
<script type="text/javascript" src="{% static 'admin_interface/related-modal/related-modal.js' %}"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -80,9 +80,9 @@ def get_admin_interface_version():
|
|||||||
|
|
||||||
|
|
||||||
def hash_string(text):
|
def hash_string(text):
|
||||||
hash_object = hashlib.sha224(text.encode())
|
hash_object = hashlib.md5(text.encode())
|
||||||
sha224_hash = hash_object.hexdigest()
|
md5_hash = hash_object.hexdigest()
|
||||||
return sha224_hash
|
return md5_hash
|
||||||
|
|
||||||
|
|
||||||
@simple_tag(takes_context=False)
|
@simple_tag(takes_context=False)
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
__version__ = "0.20.0"
|
__version__ = "0.19.8"
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ sponsor_url = "https://github.com/sponsors/fabiocaccamo/"
|
|||||||
twitter_url = "https://twitter.com/fabiocaccamo"
|
twitter_url = "https://twitter.com/fabiocaccamo"
|
||||||
package_name = "django-admin-interface"
|
package_name = "django-admin-interface"
|
||||||
package_url = "{}/{}".format(github_url, package_name)
|
package_url = "{}/{}".format(github_url, package_name)
|
||||||
|
package_issues_url = "{}/issues".format(github_url)
|
||||||
package_path = os.path.abspath(os.path.dirname(__file__))
|
package_path = os.path.abspath(os.path.dirname(__file__))
|
||||||
long_description_file_path = os.path.join(package_path, "README.md")
|
long_description_file_path = os.path.join(package_path, "README.md")
|
||||||
long_description_content_type = "text/markdown"
|
long_description_content_type = "text/markdown"
|
||||||
@@ -38,8 +39,8 @@ setup(
|
|||||||
url=package_url,
|
url=package_url,
|
||||||
download_url="{}/archive/{}.tar.gz".format(package_url, __version__),
|
download_url="{}/archive/{}.tar.gz".format(package_url, __version__),
|
||||||
project_urls={
|
project_urls={
|
||||||
"Documentation": "{}#readme".format(package_url),
|
"Documentation": package_url,
|
||||||
"Issues": "{}/issues".format(package_url),
|
"Issues": package_issues_url,
|
||||||
"Funding": sponsor_url,
|
"Funding": sponsor_url,
|
||||||
"Twitter": twitter_url,
|
"Twitter": twitter_url,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user