Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2dbef90160 | |||
| d6f04f1854 | |||
| 1ae709aaca | |||
| d5117fbc61 | |||
| 1437e8c3f2 | |||
| 4248b156fc | |||
| 7b83b09ff1 | |||
| e303db4fdb |
@@ -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 }}
|
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
create_matrix:
|
||||||
prepare:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -15,8 +14,7 @@ jobs:
|
|||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Create matrix
|
- name: Create matrix
|
||||||
uses: fabiocaccamo/create-matrix-action@v2
|
uses: fabiocaccamo/create-matrix-action@v1
|
||||||
id: create_matrix
|
|
||||||
with:
|
with:
|
||||||
matrix: |
|
matrix: |
|
||||||
python-version {2.7}, django-version {1.8,1.9,1.10,1.11}, database {sqlite,postgres}
|
python-version {2.7}, django-version {1.8,1.9,1.10,1.11}, database {sqlite,postgres}
|
||||||
@@ -26,17 +24,22 @@ jobs:
|
|||||||
python-version {3.9}, django-version {2.2,3.0,3.1,3.2}, database {sqlite,postgres}
|
python-version {3.9}, django-version {2.2,3.0,3.1,3.2}, database {sqlite,postgres}
|
||||||
python-version {3.10}, django-version {3.2,4.0}, database {sqlite,postgres}
|
python-version {3.10}, django-version {3.2,4.0}, database {sqlite,postgres}
|
||||||
|
|
||||||
|
- name: Set matrix output variable
|
||||||
|
id: set_matrix
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=matrix::$(cat ./matrix.json)"
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.create_matrix.outputs.matrix }}
|
matrix: ${{ steps.set_matrix.outputs.matrix }}
|
||||||
|
|
||||||
test:
|
run_tests:
|
||||||
|
|
||||||
needs: prepare
|
needs: create_matrix
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include: ${{fromJson(needs.prepare.outputs.matrix)}}
|
include: ${{fromJson(needs.create_matrix.outputs.matrix)}}
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
@@ -52,7 +55,13 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- 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
|
- name: Install psycopg2 prerequisites
|
||||||
run: sudo apt-get install libpq-dev
|
run: sudo apt-get install libpq-dev
|
||||||
|
|||||||
@@ -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. 🎨
|
||||||
|
|||||||
@@ -1,25 +1,16 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from django.contrib import admin
|
|
||||||
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
|
||||||
|
|
||||||
|
from django.contrib import admin
|
||||||
class UserInline(admin.TabularInline):
|
|
||||||
model = UserTheme
|
|
||||||
extra = 0
|
|
||||||
autocomplete_fields = ('user', )
|
|
||||||
|
|
||||||
|
|
||||||
class ThemeAdmin(admin.ModelAdmin):
|
class ThemeAdmin(admin.ModelAdmin):
|
||||||
inlines = [UserInline, ]
|
|
||||||
|
|
||||||
list_display = (
|
list_display = (
|
||||||
"name",
|
"name",
|
||||||
"active",
|
"active",
|
||||||
"demo",
|
|
||||||
)
|
)
|
||||||
list_editable = ("active",)
|
list_editable = ("active",)
|
||||||
list_per_page = 100
|
list_per_page = 100
|
||||||
@@ -33,7 +24,6 @@ class ThemeAdmin(admin.ModelAdmin):
|
|||||||
"fields": (
|
"fields": (
|
||||||
"name",
|
"name",
|
||||||
"active",
|
"active",
|
||||||
"demo",
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -143,8 +133,7 @@ class ThemeAdmin(admin.ModelAdmin):
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
(_("Navigation Bar"), {"classes": (
|
(_("Navigation Bar"), {"classes": ("wide",), "fields": ("foldable_apps",)}),
|
||||||
"wide",), "fields": ("foldable_apps",)}),
|
|
||||||
(
|
(
|
||||||
_("Related Modal"),
|
_("Related Modal"),
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
from .models import Theme
|
|
||||||
|
|
||||||
def get_active_theme(request):
|
|
||||||
objs_manager = Theme.objects
|
|
||||||
objs_active_qs = objs_manager.filter(active=True)
|
|
||||||
objs_active_ls = list(objs_active_qs)
|
|
||||||
objs_active_count = len(objs_active_ls)
|
|
||||||
|
|
||||||
if objs_active_count == 0:
|
|
||||||
obj = objs_manager.first()
|
|
||||||
if obj:
|
|
||||||
obj.set_active()
|
|
||||||
# else:
|
|
||||||
# obj = objs_manager.create()
|
|
||||||
|
|
||||||
elif objs_active_count == 1:
|
|
||||||
obj = objs_active_ls[0]
|
|
||||||
|
|
||||||
elif objs_active_count > 1:
|
|
||||||
# for frame_record in inspect.stack():
|
|
||||||
# if frame_record[3]=='get_response':
|
|
||||||
# request = frame_record[0].f_locals['request']
|
|
||||||
# user = request.user
|
|
||||||
# break
|
|
||||||
# else:
|
|
||||||
# request = None
|
|
||||||
user = request.user
|
|
||||||
try:
|
|
||||||
obj = objs_active_qs.filter(user=user).first()
|
|
||||||
except:
|
|
||||||
obj = objs_active_ls[-1]
|
|
||||||
obj.set_active()
|
|
||||||
|
|
||||||
return {
|
|
||||||
'theme': obj,
|
|
||||||
}
|
|
||||||
@@ -1,156 +0,0 @@
|
|||||||
import json
|
|
||||||
import os
|
|
||||||
import tempfile
|
|
||||||
import zipfile
|
|
||||||
|
|
||||||
import django
|
|
||||||
from django import forms
|
|
||||||
from django.conf import settings
|
|
||||||
from django.contrib import admin, messages
|
|
||||||
from django.contrib.auth import get_permission_codename
|
|
||||||
from django.core.exceptions import PermissionDenied
|
|
||||||
from django.core.files.storage import default_storage
|
|
||||||
from django.http import HttpResponseRedirect
|
|
||||||
from django.template.response import TemplateResponse
|
|
||||||
from django.urls import path, reverse
|
|
||||||
from django.utils.translation import gettext_lazy as _
|
|
||||||
|
|
||||||
from .. import models
|
|
||||||
from .forms import ImportForm
|
|
||||||
|
|
||||||
|
|
||||||
class ImportMixin(admin.ModelAdmin):
|
|
||||||
"""
|
|
||||||
Import mixin.
|
|
||||||
|
|
||||||
This is intended to be mixed with django.contrib.admin.ModelAdmin
|
|
||||||
https://docs.djangoproject.com/en/2.1/ref/contrib/admin/#modeladmin-objects
|
|
||||||
"""
|
|
||||||
|
|
||||||
#: template for change_list view
|
|
||||||
change_list_template = 'admin/import_export/change_list_import.html'
|
|
||||||
#: template for import view
|
|
||||||
import_template_name = 'admin/import_export/import.html'
|
|
||||||
|
|
||||||
def get_model_info(self):
|
|
||||||
app_label = self.model._meta.app_label
|
|
||||||
return (self.model._meta.app_label, self.model._meta.model_name)
|
|
||||||
|
|
||||||
def has_import_permission(self, request):
|
|
||||||
"""
|
|
||||||
Returns whether a request has import permission.
|
|
||||||
"""
|
|
||||||
IMPORT_PERMISSION_CODE = getattr(settings, 'IMPORT_EXPORT_IMPORT_PERMISSION_CODE', None)
|
|
||||||
if IMPORT_PERMISSION_CODE is None:
|
|
||||||
return True
|
|
||||||
|
|
||||||
opts = self.opts
|
|
||||||
codename = get_permission_codename(IMPORT_PERMISSION_CODE, opts)
|
|
||||||
return request.user.has_perm("%s.%s" % (opts.app_label, codename))
|
|
||||||
|
|
||||||
def get_urls(self):
|
|
||||||
urls = super().get_urls()
|
|
||||||
info = self.get_model_info()
|
|
||||||
my_urls = [
|
|
||||||
path('import/',
|
|
||||||
self.admin_site.admin_view(self.import_action),
|
|
||||||
name='%s_%s_import' % info),
|
|
||||||
]
|
|
||||||
return my_urls + urls
|
|
||||||
|
|
||||||
def get_import_context_data(self, **kwargs):
|
|
||||||
return self.get_context_data(**kwargs)
|
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
|
||||||
return {}
|
|
||||||
|
|
||||||
def get_form_kwargs(self, form, *args, **kwargs):
|
|
||||||
"""
|
|
||||||
Prepare/returns kwargs for the import form.
|
|
||||||
|
|
||||||
To distinguish between import and confirm import forms,
|
|
||||||
the following approach may be used:
|
|
||||||
|
|
||||||
if isinstance(form, ImportForm):
|
|
||||||
# your code here for the import form kwargs
|
|
||||||
# e.g. update.kwargs({...})
|
|
||||||
elif isinstance(form, ConfirmImportForm):
|
|
||||||
# your code here for the confirm import form kwargs
|
|
||||||
# e.g. update.kwargs({...})
|
|
||||||
...
|
|
||||||
"""
|
|
||||||
return kwargs
|
|
||||||
|
|
||||||
def import_action(self, request, *args, **kwargs):
|
|
||||||
"""
|
|
||||||
Perform a dry_run of the import to make sure the import will not
|
|
||||||
result in errors. If there where no error, save the user
|
|
||||||
uploaded file to a local temp file that will be used by
|
|
||||||
'process_import' for the actual import.
|
|
||||||
"""
|
|
||||||
if not self.has_import_permission(request):
|
|
||||||
raise PermissionDenied
|
|
||||||
|
|
||||||
context = self.get_import_context_data()
|
|
||||||
|
|
||||||
form_type = ImportForm
|
|
||||||
form_kwargs = self.get_form_kwargs(form_type, *args, **kwargs)
|
|
||||||
form = form_type(request.POST or None,
|
|
||||||
request.FILES or None,
|
|
||||||
**form_kwargs)
|
|
||||||
|
|
||||||
if request.POST and form.is_valid():
|
|
||||||
import_file_tema = form.cleaned_data['tema']
|
|
||||||
if zipfile.is_zipfile(import_file_tema):
|
|
||||||
with zipfile.ZipFile(import_file_tema, 'r') as zip_ref:
|
|
||||||
with tempfile.TemporaryDirectory() as tempdir:
|
|
||||||
zip_ref.extractall(tempdir)
|
|
||||||
lst = os.listdir(tempdir)
|
|
||||||
allowed_extensions=[".gif", ".jpg", ".jpeg", ".png", ".svg"]
|
|
||||||
try:
|
|
||||||
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]
|
|
||||||
favicon = [s for s in os.listdir(f'{tempdir}/{lst[0]}/favicon') if any(ele in s for ele in allowed_extensions)][0]
|
|
||||||
with open(f'{tempdir}/{lst[0]}/{tema_json}', 'r') as temporary_file:
|
|
||||||
result = json.loads(temporary_file.read())
|
|
||||||
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)
|
|
||||||
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)
|
|
||||||
skip_result = False
|
|
||||||
except FileNotFoundError as e:
|
|
||||||
messages.error(request, 'Struttura del file .zip errata.')
|
|
||||||
skip_result = True
|
|
||||||
if not skip_result:
|
|
||||||
try:
|
|
||||||
new_theme = models.Theme(
|
|
||||||
**result[0]['fields']
|
|
||||||
)
|
|
||||||
new_theme.save()
|
|
||||||
|
|
||||||
messages.success(request, _('Import finished'))
|
|
||||||
except:
|
|
||||||
messages.error(request, 'Struttura del file .json errata.')
|
|
||||||
else:
|
|
||||||
messages.error(request, 'È richiesto un file .zip')
|
|
||||||
|
|
||||||
url = reverse('admin:%s_%s_changelist' % self.get_model_info(),
|
|
||||||
current_app=self.admin_site.name)
|
|
||||||
return HttpResponseRedirect(url)
|
|
||||||
else:
|
|
||||||
context.update(self.admin_site.each_context(request))
|
|
||||||
|
|
||||||
context['title'] = _("Import")
|
|
||||||
context['form'] = form
|
|
||||||
context['opts'] = self.model._meta
|
|
||||||
|
|
||||||
request.current_app = self.admin_site.name
|
|
||||||
return TemplateResponse(request, [self.import_template_name],
|
|
||||||
context)
|
|
||||||
|
|
||||||
def changelist_view(self, request, extra_context=None):
|
|
||||||
if extra_context is None:
|
|
||||||
extra_context = {}
|
|
||||||
extra_context['has_import_permission'] = self.has_import_permission(request)
|
|
||||||
return super().changelist_view(request, extra_context)
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import os.path
|
|
||||||
|
|
||||||
from django import forms
|
|
||||||
from django.contrib.admin.helpers import ActionForm
|
|
||||||
from django.utils.translation import gettext_lazy as _
|
|
||||||
|
|
||||||
|
|
||||||
class ImportForm(forms.Form):
|
|
||||||
tema = forms.FileField(
|
|
||||||
label='Zip'
|
|
||||||
)
|
|
||||||
Binary file not shown.
@@ -1,139 +0,0 @@
|
|||||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
|
||||||
# This file is distributed under the same license as the PACKAGE package.
|
|
||||||
#
|
|
||||||
# Christian Galeffi <chri@gallochri.com>, 2015.
|
|
||||||
msgid ""
|
|
||||||
msgstr ""
|
|
||||||
"Project-Id-Version: \n"
|
|
||||||
"Report-Msgid-Bugs-To: \n"
|
|
||||||
"POT-Creation-Date: 2020-06-04 09:27+0200\n"
|
|
||||||
"PO-Revision-Date: 2015-08-30 20:32+0100\n"
|
|
||||||
"Last-Translator: Christian Galeffi <chri@gallochri.com>\n"
|
|
||||||
"Language-Team: Italian <kde-i18n-it@kde.org>\n"
|
|
||||||
"Language: it\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"
|
|
||||||
"X-Generator: Poedit 1.5.4\n"
|
|
||||||
|
|
||||||
#: admin.py:194
|
|
||||||
#, python-format
|
|
||||||
msgid "%s through import_export"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: admin.py:200
|
|
||||||
msgid "Import finished, with {} new and {} updated {}."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: admin.py:298
|
|
||||||
#, python-format
|
|
||||||
msgid "<h1>Imported file has a wrong encoding: %s</h1>"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: admin.py:300
|
|
||||||
#, python-format
|
|
||||||
msgid "<h1>%s encountered while trying to read file: %s</h1>"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: admin.py:331 templates/admin/import_export/change_list_import_item.html:5
|
|
||||||
#: templates/admin/import_export/import.html:10
|
|
||||||
msgid "Import"
|
|
||||||
msgstr "Importare"
|
|
||||||
|
|
||||||
#: admin.py:496 templates/admin/import_export/change_list_export_item.html:5
|
|
||||||
#: templates/admin/import_export/export.html:7
|
|
||||||
msgid "Export"
|
|
||||||
msgstr "Esportare"
|
|
||||||
|
|
||||||
#: admin.py:554
|
|
||||||
msgid "You must select an export format."
|
|
||||||
msgstr "Devi selezionare un formato di esportazione."
|
|
||||||
|
|
||||||
#: admin.py:567
|
|
||||||
#, python-format
|
|
||||||
msgid "Export selected %(verbose_name_plural)s"
|
|
||||||
msgstr "Esporta selezionati %(verbose_name_plural)s"
|
|
||||||
|
|
||||||
#: forms.py:10
|
|
||||||
msgid "File to import"
|
|
||||||
msgstr "File da importare"
|
|
||||||
|
|
||||||
#: forms.py:13 forms.py:41 forms.py:66
|
|
||||||
msgid "Format"
|
|
||||||
msgstr "Formato"
|
|
||||||
|
|
||||||
#: templates/admin/import_export/base.html:11
|
|
||||||
msgid "Home"
|
|
||||||
msgstr "Home"
|
|
||||||
|
|
||||||
#: templates/admin/import_export/export.html:31
|
|
||||||
#: templates/admin/import_export/import.html:52
|
|
||||||
msgid "Submit"
|
|
||||||
msgstr "Inviare"
|
|
||||||
|
|
||||||
#: templates/admin/import_export/import.html:20
|
|
||||||
msgid ""
|
|
||||||
"Below is a preview of data to be imported. If you are satisfied with the "
|
|
||||||
"results, click 'Confirm import'"
|
|
||||||
msgstr ""
|
|
||||||
"Questa è un'anteprima dei dati che saranno importati. Se il risultato è "
|
|
||||||
"soddisfacente, premi 'Conferma importazione'"
|
|
||||||
|
|
||||||
#: templates/admin/import_export/import.html:23
|
|
||||||
msgid "Confirm import"
|
|
||||||
msgstr "Conferma importazione"
|
|
||||||
|
|
||||||
#: templates/admin/import_export/import.html:31
|
|
||||||
msgid "This importer will import the following fields: "
|
|
||||||
msgstr "Verranno importati i seguenti campi:"
|
|
||||||
|
|
||||||
#: templates/admin/import_export/import.html:61
|
|
||||||
#: templates/admin/import_export/import.html:90
|
|
||||||
msgid "Errors"
|
|
||||||
msgstr "Errori"
|
|
||||||
|
|
||||||
#: templates/admin/import_export/import.html:72
|
|
||||||
msgid "Line number"
|
|
||||||
msgstr "Numero linea"
|
|
||||||
|
|
||||||
#: templates/admin/import_export/import.html:82
|
|
||||||
msgid "Some rows failed to validate"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: templates/admin/import_export/import.html:84
|
|
||||||
msgid ""
|
|
||||||
"Please correct these errors in your data where possible, then reupload it "
|
|
||||||
"using the form above."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: templates/admin/import_export/import.html:89
|
|
||||||
msgid "Row"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: templates/admin/import_export/import.html:116
|
|
||||||
msgid "Non field specific"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: templates/admin/import_export/import.html:137
|
|
||||||
msgid "Preview"
|
|
||||||
msgstr "Anteprima"
|
|
||||||
|
|
||||||
#: templates/admin/import_export/import.html:152
|
|
||||||
msgid "New"
|
|
||||||
msgstr "Nuovo"
|
|
||||||
|
|
||||||
#: templates/admin/import_export/import.html:154
|
|
||||||
msgid "Skipped"
|
|
||||||
msgstr "Salta"
|
|
||||||
|
|
||||||
#: templates/admin/import_export/import.html:156
|
|
||||||
msgid "Delete"
|
|
||||||
msgstr "Cancella"
|
|
||||||
|
|
||||||
#: templates/admin/import_export/import.html:158
|
|
||||||
msgid "Update"
|
|
||||||
msgstr "Aggiorna"
|
|
||||||
|
|
||||||
#~ msgid "Import finished"
|
|
||||||
#~ msgstr "Importazione terminata"
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
.import-preview .errors {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.validation-error-count {
|
|
||||||
display: inline-block;
|
|
||||||
background-color: #e40000;
|
|
||||||
border-radius: 6px;
|
|
||||||
color: white;
|
|
||||||
font-size: 0.9em;
|
|
||||||
position: relative;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-top: -2px;
|
|
||||||
padding: 0.2em 0.4em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.validation-error-container {
|
|
||||||
position: absolute;
|
|
||||||
opacity: 0;
|
|
||||||
pointer-events: none;
|
|
||||||
background-color: #ffc1c1;
|
|
||||||
padding: 14px 15px 10px;
|
|
||||||
top: 25px;
|
|
||||||
margin: 0 0 20px 0;
|
|
||||||
width: 200px;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.import-preview tr.skip {
|
|
||||||
background-color: #d2d2d2;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.import-preview tr.new {
|
|
||||||
background-color: #bdd8b2;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.import-preview tr.delete {
|
|
||||||
background-color: #f9bebf;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.import-preview tr.update {
|
|
||||||
background-color: #fdfdcf;
|
|
||||||
}
|
|
||||||
|
|
||||||
.import-preview td:hover .validation-error-count {
|
|
||||||
z-index: 3;
|
|
||||||
}
|
|
||||||
.import-preview td:hover .validation-error-container {
|
|
||||||
opacity: 1;
|
|
||||||
pointer-events: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.validation-error-list {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.validation-error-list li {
|
|
||||||
list-style: none;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.validation-error-list > li > ul {
|
|
||||||
margin: 8px 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.validation-error-list > li > ul > li {
|
|
||||||
padding: 0;
|
|
||||||
margin: 0 0 10px;
|
|
||||||
line-height: 1.28em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.validation-error-field-label {
|
|
||||||
display: block;
|
|
||||||
border-bottom: 1px solid #e40000;
|
|
||||||
color: #e40000;
|
|
||||||
text-transform: uppercase;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 0.85em;
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{% extends "admin/base_site.html" %}
|
|
||||||
{% load i18n admin_modify %}
|
|
||||||
{% load admin_urls %}
|
|
||||||
{% load static %}
|
|
||||||
|
|
||||||
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
|
|
||||||
{% block bodyclass %}{{ block.super }} {{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %}
|
|
||||||
{% if not is_popup %}
|
|
||||||
{% block breadcrumbs %}
|
|
||||||
<div class="breadcrumbs">
|
|
||||||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
|
||||||
› <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
|
|
||||||
› <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
|
|
||||||
› {% block breadcrumbs_last %}{% endblock %}
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
||||||
{% endif %}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{% extends "admin/change_list.html" %}
|
|
||||||
|
|
||||||
{# Original template renders object-tools only when has_add_permission is True. #}
|
|
||||||
{# This hack allows sub templates to add to object-tools #}
|
|
||||||
{% block object-tools %}
|
|
||||||
<ul class="object-tools">
|
|
||||||
{% block object-tools-items %}
|
|
||||||
{% if has_add_permission %}
|
|
||||||
{{ block.super }}
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
|
||||||
</ul>
|
|
||||||
{% endblock %}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{% extends "admin/import_export/change_list.html" %}
|
|
||||||
|
|
||||||
{% block object-tools-items %}
|
|
||||||
{% include "admin/import_export/change_list_import_item.html" %}
|
|
||||||
{{ block.super }}
|
|
||||||
{% endblock %}
|
|
||||||
@@ -1,171 +0,0 @@
|
|||||||
{% extends "admin/import_export/base.html" %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% load admin_urls %}
|
|
||||||
{% load import_export_tags %}
|
|
||||||
{% load static %}
|
|
||||||
|
|
||||||
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "import_export/import.css" %}" />{% endblock %}
|
|
||||||
|
|
||||||
{% block breadcrumbs_last %}
|
|
||||||
{% trans "Import" %}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
|
|
||||||
{% if confirm_form %}
|
|
||||||
<form action="{% url opts|admin_urlname:"process_import" %}" method="POST">
|
|
||||||
{% csrf_token %}
|
|
||||||
{{ confirm_form.as_p }}
|
|
||||||
<p>
|
|
||||||
{% trans "Below is a preview of data to be imported. If you are satisfied with the results, click 'Confirm import'" %}
|
|
||||||
</p>
|
|
||||||
<div class="submit-row">
|
|
||||||
<input type="submit" class="default" name="confirm" value="{% trans "Confirm import" %}">
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
{% else %}
|
|
||||||
<form action="" method="post" enctype="multipart/form-data">
|
|
||||||
{% csrf_token %}
|
|
||||||
|
|
||||||
<p>
|
|
||||||
{% trans "This importer will import the following fields: " %}
|
|
||||||
<code>{{ fields|join:", " }}</code>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<fieldset class="module aligned">
|
|
||||||
{% for field in form %}
|
|
||||||
<div class="form-row">
|
|
||||||
{{ field.errors }}
|
|
||||||
|
|
||||||
{{ field.label_tag }}
|
|
||||||
|
|
||||||
{{ field }}
|
|
||||||
|
|
||||||
{% if field.field.help_text %}
|
|
||||||
<p class="help">{{ field.field.help_text|safe }}</p>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<div class="submit-row">
|
|
||||||
<input type="submit" class="default" value="{% trans "Submit" %}">
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if result %}
|
|
||||||
|
|
||||||
{% if result.has_errors %}
|
|
||||||
|
|
||||||
<h2>{% trans "Errors" %}</h2>
|
|
||||||
<ul>
|
|
||||||
{% for error in result.base_errors %}
|
|
||||||
<li>
|
|
||||||
{{ error.error }}
|
|
||||||
<div class="traceback">{{ error.traceback|linebreaks }}</div>
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
{% for line, errors in result.row_errors %}
|
|
||||||
{% for error in errors %}
|
|
||||||
<li>
|
|
||||||
{% trans "Line number" %}: {{ line }} - {{ error.error }}
|
|
||||||
<div><code>{{ error.row.values|join:", " }}</code></div>
|
|
||||||
<div class="traceback">{{ error.traceback|linebreaks }}</div>
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
{% elif result.has_validation_errors %}
|
|
||||||
|
|
||||||
<h2>{% trans "Some rows failed to validate" %}</h2>
|
|
||||||
|
|
||||||
<p>{% trans "Please correct these errors in your data where possible, then reupload it using the form above." %}</p>
|
|
||||||
|
|
||||||
<table class="import-preview">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>{% trans "Row" %}</th>
|
|
||||||
<th>{% trans "Errors" %}</th>
|
|
||||||
{% for field in result.diff_headers %}
|
|
||||||
<th>{{ field }}</th>
|
|
||||||
{% endfor %}
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for row in result.invalid_rows %}
|
|
||||||
<tr>
|
|
||||||
<td>{{ row.number }} </td>
|
|
||||||
<td class="errors">
|
|
||||||
<span class="validation-error-count">{{ row.error_count }}</span>
|
|
||||||
<div class="validation-error-container">
|
|
||||||
<ul class="validation-error-list">
|
|
||||||
{% for field_name, error_list in row.field_specific_errors.items %}
|
|
||||||
<li>
|
|
||||||
<span class="validation-error-field-label">{{ field_name }}</span>
|
|
||||||
<ul>
|
|
||||||
{% for error in error_list %}
|
|
||||||
<li>{{ error }}</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
{% if row.non_field_specific_errors %}
|
|
||||||
<li>
|
|
||||||
<span class="validation-error-field-label">{% trans "Non field specific" %}</span>
|
|
||||||
<ul>
|
|
||||||
{% for error in row.non_field_specific_errors %}
|
|
||||||
<li>{{ error }}</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
{% for field in row.values %}
|
|
||||||
<td>{{ field }}</td>
|
|
||||||
{% endfor %}
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
{% else %}
|
|
||||||
|
|
||||||
<h2>{% trans "Preview" %}</h2>
|
|
||||||
|
|
||||||
<table class="import-preview">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th></th>
|
|
||||||
{% for field in result.diff_headers %}
|
|
||||||
<th>{{ field }}</th>
|
|
||||||
{% endfor %}
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
{% for row in result.valid_rows %}
|
|
||||||
<tr class="{{ row.import_type }}">
|
|
||||||
<td class="import-type">
|
|
||||||
{% if row.import_type == 'new' %}
|
|
||||||
{% trans "New" %}
|
|
||||||
{% elif row.import_type == 'skip' %}
|
|
||||||
{% trans "Skipped" %}
|
|
||||||
{% elif row.import_type == 'delete' %}
|
|
||||||
{% trans "Delete" %}
|
|
||||||
{% elif row.import_type == 'update' %}
|
|
||||||
{% trans "Update" %}
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
{% for field in row.diff %}
|
|
||||||
<td>{{ field }}</td>
|
|
||||||
{% endfor %}
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</table>
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
("admin_interface", "0024_remove_theme_css"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name="theme",
|
|
||||||
name="demo",
|
|
||||||
field=models.BooleanField(default=False, verbose_name="demo"),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
("admin_interface", "0025_add_demo_option"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name="theme",
|
|
||||||
name="user",
|
|
||||||
field=models.ForeignKey('auth.User', on_delete=models.CASCADE, null=True, blank=True, verbose_name="active for user"),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
# Generated by Django 3.2.13 on 2022-04-28 16:03
|
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
||||||
('admin_interface', '0026_add_user_option'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.RemoveField(
|
|
||||||
model_name='theme',
|
|
||||||
name='user',
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='UserTheme',
|
|
||||||
fields=[
|
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('theme', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='admin_interface.theme')),
|
|
||||||
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, unique=True)),
|
|
||||||
],
|
|
||||||
options={
|
|
||||||
'verbose_name': 'Users theme',
|
|
||||||
'verbose_name_plural': 'Users themes',
|
|
||||||
},
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='theme',
|
|
||||||
name='users',
|
|
||||||
field=models.ManyToManyField(through='admin_interface.UserTheme', to=settings.AUTH_USER_MODEL),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
# Generated by Django 4.0.4 on 2022-08-25 14:44
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('admin_interface', '0027_usertheme_m2m'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='theme',
|
|
||||||
name='demo',
|
|
||||||
field=models.BooleanField(default=False, verbose_name='is demo'),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
# Generated by Django 4.0.3 on 2022-10-25 13:59
|
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
import django.db.models.deletion
|
|
||||||
from django.db import connection, migrations, models, transaction
|
|
||||||
|
|
||||||
|
|
||||||
def forward(apps, schema_editor):
|
|
||||||
Theme = apps.get_model("admin_interface", "Theme")
|
|
||||||
if len(Theme.objects.all()) == 1 and Theme.objects.first().name == 'Django':
|
|
||||||
with transaction.atomic():
|
|
||||||
cursor = connection.cursor()
|
|
||||||
cursor.execute("""truncate table "admin_interface_theme" restart identity;""")
|
|
||||||
|
|
||||||
def reverse(apps, schema_editor):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('admin_interface', '0028_alter_theme_demo'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.RunPython(forward, reverse),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='usertheme',
|
|
||||||
name='user',
|
|
||||||
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
+73
-70
@@ -2,28 +2,16 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import inspect
|
from admin_interface.cache import del_cached_active_theme
|
||||||
|
from admin_interface.compat import FileExtensionValidator, force_str, gettext_lazy as _
|
||||||
|
|
||||||
from colorfield.fields import ColorField
|
from colorfield.fields import ColorField
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.db.models.signals import post_delete, post_save, pre_save
|
from django.db.models.signals import post_delete, post_save, pre_save
|
||||||
|
|
||||||
from six import python_2_unicode_compatible
|
from six import python_2_unicode_compatible
|
||||||
|
|
||||||
from admin_interface.cache import del_cached_active_theme
|
|
||||||
from admin_interface.compat import FileExtensionValidator, force_str
|
|
||||||
from admin_interface.compat import gettext_lazy as _
|
|
||||||
|
|
||||||
|
|
||||||
@python_2_unicode_compatible
|
|
||||||
class UserTheme(models.Model):
|
|
||||||
class Meta:
|
|
||||||
verbose_name = 'Users theme'
|
|
||||||
verbose_name_plural = 'Users themes'
|
|
||||||
|
|
||||||
user = models.OneToOneField(
|
|
||||||
'auth.User', on_delete=models.CASCADE, null=True)
|
|
||||||
theme = models.ForeignKey('Theme', on_delete=models.CASCADE)
|
|
||||||
|
|
||||||
|
|
||||||
@python_2_unicode_compatible
|
@python_2_unicode_compatible
|
||||||
class Theme(models.Model):
|
class Theme(models.Model):
|
||||||
@@ -37,22 +25,22 @@ class Theme(models.Model):
|
|||||||
del_cached_active_theme()
|
del_cached_active_theme()
|
||||||
Theme.get_active_theme()
|
Theme.get_active_theme()
|
||||||
|
|
||||||
# @staticmethod
|
@staticmethod
|
||||||
# def post_save_handler(instance, **kwargs):
|
def post_save_handler(instance, **kwargs):
|
||||||
# del_cached_active_theme()
|
del_cached_active_theme()
|
||||||
# if instance.active:
|
if instance.active:
|
||||||
# Theme.objects.exclude(pk=instance.pk).update(active=False)
|
Theme.objects.exclude(pk=instance.pk).update(active=False)
|
||||||
# Theme.get_active_theme()
|
Theme.get_active_theme()
|
||||||
|
|
||||||
# @staticmethod
|
@staticmethod
|
||||||
# def pre_save_handler(instance, **kwargs):
|
def pre_save_handler(instance, **kwargs):
|
||||||
# if instance.pk is None:
|
if instance.pk is None:
|
||||||
# try:
|
try:
|
||||||
# obj = Theme.objects.get(name=instance.name)
|
obj = Theme.objects.get(name=instance.name)
|
||||||
# if obj:
|
if obj:
|
||||||
# instance.pk = obj.pk
|
instance.pk = obj.pk
|
||||||
# except Theme.DoesNotExist:
|
except Theme.DoesNotExist:
|
||||||
# pass
|
pass
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_active_theme():
|
def get_active_theme():
|
||||||
@@ -65,26 +53,15 @@ class Theme(models.Model):
|
|||||||
obj = objs_manager.all().first()
|
obj = objs_manager.all().first()
|
||||||
if obj:
|
if obj:
|
||||||
obj.set_active()
|
obj.set_active()
|
||||||
# else:
|
else:
|
||||||
# obj = objs_manager.create()
|
obj = objs_manager.create()
|
||||||
|
|
||||||
elif objs_active_count == 1:
|
elif objs_active_count == 1:
|
||||||
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():
|
obj = objs_active_ls[-1]
|
||||||
if frame_record[3] == 'get_response':
|
obj.set_active()
|
||||||
request = frame_record[0].f_locals['request']
|
|
||||||
user = request.user
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
request = None
|
|
||||||
|
|
||||||
try:
|
|
||||||
return objs_active_qs.filter(user=user).first()
|
|
||||||
except:
|
|
||||||
obj = objs_active_ls[-1]
|
|
||||||
obj.set_active()
|
|
||||||
|
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
@@ -93,9 +70,6 @@ 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"))
|
|
||||||
users = models.ManyToManyField('auth.User', through=UserTheme)
|
|
||||||
|
|
||||||
title = models.CharField(
|
title = models.CharField(
|
||||||
max_length=50,
|
max_length=50,
|
||||||
default=_("Django administration"),
|
default=_("Django administration"),
|
||||||
@@ -109,8 +83,7 @@ class Theme(models.Model):
|
|||||||
max_length=10,
|
max_length=10,
|
||||||
verbose_name=_("color"),
|
verbose_name=_("color"),
|
||||||
)
|
)
|
||||||
title_visible = models.BooleanField(
|
title_visible = models.BooleanField(default=True, verbose_name=_("visible"))
|
||||||
default=True, verbose_name=_("visible"))
|
|
||||||
|
|
||||||
logo = models.FileField(
|
logo = models.FileField(
|
||||||
upload_to="admin-interface/logo/",
|
upload_to="admin-interface/logo/",
|
||||||
@@ -150,8 +123,7 @@ class Theme(models.Model):
|
|||||||
verbose_name=_("favicon"),
|
verbose_name=_("favicon"),
|
||||||
)
|
)
|
||||||
|
|
||||||
env_name = models.CharField(
|
env_name = models.CharField(blank=True, max_length=50, verbose_name=_("name"))
|
||||||
blank=True, max_length=50, verbose_name=_("name"))
|
|
||||||
env_color = ColorField(
|
env_color = ColorField(
|
||||||
blank=True,
|
blank=True,
|
||||||
default="#E74C3C",
|
default="#E74C3C",
|
||||||
@@ -172,8 +144,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,
|
||||||
@@ -316,8 +294,7 @@ class Theme(models.Model):
|
|||||||
verbose_name=_("text color"),
|
verbose_name=_("text color"),
|
||||||
)
|
)
|
||||||
|
|
||||||
related_modal_active = models.BooleanField(
|
related_modal_active = models.BooleanField(default=True, verbose_name=_("active"))
|
||||||
default=True, verbose_name=_("active"))
|
|
||||||
related_modal_background_color = ColorField(
|
related_modal_background_color = ColorField(
|
||||||
blank=True,
|
blank=True,
|
||||||
default="#000000",
|
default="#000000",
|
||||||
@@ -326,15 +303,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,
|
||||||
@@ -357,8 +361,7 @@ class Theme(models.Model):
|
|||||||
default=True, verbose_name=_("sticky position")
|
default=True, verbose_name=_("sticky position")
|
||||||
)
|
)
|
||||||
|
|
||||||
foldable_apps = models.BooleanField(
|
foldable_apps = models.BooleanField(default=True, verbose_name=_("foldable apps"))
|
||||||
default=True, verbose_name=_("foldable apps"))
|
|
||||||
|
|
||||||
recent_actions_visible = models.BooleanField(
|
recent_actions_visible = models.BooleanField(
|
||||||
default=True, verbose_name=_("visible")
|
default=True, verbose_name=_("visible")
|
||||||
@@ -386,5 +389,5 @@ class Theme(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
post_delete.connect(Theme.post_delete_handler, sender=Theme)
|
post_delete.connect(Theme.post_delete_handler, sender=Theme)
|
||||||
# post_save.connect(Theme.post_save_handler, sender=Theme)
|
post_save.connect(Theme.post_save_handler, sender=Theme)
|
||||||
# pre_save.connect(Theme.pre_save_handler, sender=Theme)
|
pre_save.connect(Theme.pre_save_handler, sender=Theme)
|
||||||
|
|||||||
@@ -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,12 @@
|
|||||||
// 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,
|
|
||||||
close: function() {
|
close: function() {
|
||||||
openerRef.dismissRelatedObjectModal();
|
openerRef.dismissRelatedObjectModal();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
windowRef = windowRefProxy;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// default django popup_response.js
|
// default django popup_response.js
|
||||||
|
|||||||
+1
-1
@@ -103,7 +103,7 @@
|
|||||||
.admin-interface #user-tools {
|
.admin-interface #user-tools {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
white-space: normal;
|
white-space: nowrap;
|
||||||
align-self: flex-start;
|
align-self: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
+8
-19
@@ -68,12 +68,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface .environment-label::after {
|
.admin-interface .environment-label::after {
|
||||||
content: "{{ theme.env_name }} - ";
|
content: " - ";
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 1024px) {
|
@media (max-width: 1024px) {
|
||||||
.admin-interface .environment-label::after {
|
.admin-interface .environment-label::after {
|
||||||
content: "{{ theme.env_name }}";
|
content: "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,8 +127,8 @@
|
|||||||
|
|
||||||
.admin-interface #branding h1 img.logo,
|
.admin-interface #branding h1 img.logo,
|
||||||
.admin-interface.login #header #branding h1 img.logo {
|
.admin-interface.login #header #branding h1 img.logo {
|
||||||
max-width: var(--admin-interface-logo-max-width);
|
max-width: var(--admin-interface-log-max-width);
|
||||||
max-height: var(--admin-interface-logo-max-height);
|
max-height: var(--admin-interface-log-max-height);
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface #header #user-tools a {
|
.admin-interface #header #user-tools a {
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
|
|
||||||
.admin-interface #header #user-tools a:hover,
|
.admin-interface #header #user-tools a:hover,
|
||||||
.admin-interface #header #user-tools a:active {
|
.admin-interface #header #user-tools a:active {
|
||||||
color: var(--admin-interface-header-link-hover-color);
|
color: var(--admin-interface-header-link_hover-color);
|
||||||
border-bottom-color: rgba(255, 255, 255, 0.5);
|
border-bottom-color: rgba(255, 255, 255, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,17 +347,9 @@
|
|||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.admin-interface.list-filter-sticky .module.filtered #changelist-filter {
|
.admin-interface.list-filter-sticky .module.filtered #changelist-filter {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 30px;
|
top: 40px;
|
||||||
float: right;
|
float: right;
|
||||||
z-index: 30;
|
z-index: 30;
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
overflow-y: auto;
|
|
||||||
height: 100%;
|
|
||||||
max-height: calc(100vh - 60px);
|
|
||||||
}
|
|
||||||
.admin-interface.list-filter-sticky.sticky-pagination .module.filtered #changelist-filter {
|
|
||||||
max-height: calc(100vh - 125px);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* feature not available for django < 3.1.2 */
|
/* feature not available for django < 3.1.2 */
|
||||||
@@ -365,15 +357,12 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
z-index: 30;
|
z-index: 30;
|
||||||
max-height: calc(100vh - 105px);
|
|
||||||
}
|
|
||||||
.admin-interface.list-filter-sticky.sticky-pagination .module.filtered #toolbar + #changelist-filter {
|
|
||||||
max-height: calc(100vh - 170px);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface .module.filtered #changelist-filter {
|
.admin-interface .module.filtered #changelist-filter {
|
||||||
border-radius: var(--admin-interface-module-border-radius);
|
border-bottom-left-radius: var(--admin-interface-module-border-radius);
|
||||||
|
border-bottom-right-radius: var(--admin-interface-module-border-radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface .module.filtered #changelist-filter #changelist-filter-clear a:focus,
|
.admin-interface .module.filtered #changelist-filter #changelist-filter-clear a:focus,
|
||||||
+1
-1
@@ -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;
|
||||||
}
|
}
|
||||||
+123
-20
@@ -13,27 +13,127 @@ backward compatibility:
|
|||||||
|
|
||||||
/* Layout helpers
|
/* Layout helpers
|
||||||
----------------------------------*/
|
----------------------------------*/
|
||||||
.ui-helper-hidden { display: none; }
|
.ui-helper-hidden {
|
||||||
.ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
|
display: none;
|
||||||
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
|
}
|
||||||
.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
|
|
||||||
.ui-helper-clearfix { display: inline-block; }
|
.ui-helper-hidden-accessible {
|
||||||
|
position: absolute;
|
||||||
|
left: -99999999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-helper-reset {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
outline: 0;
|
||||||
|
line-height: 1.3;
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: 100%;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-helper-clearfix:after {
|
||||||
|
content: ".";
|
||||||
|
display: block;
|
||||||
|
height: 0;
|
||||||
|
clear: both;
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-helper-clearfix {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
/* required comment for clearfix to work in Opera \*/
|
/* required comment for clearfix to work in Opera \*/
|
||||||
* html .ui-helper-clearfix { height:1%; }
|
* html .ui-helper-clearfix {
|
||||||
.ui-helper-clearfix { display:block; }
|
height: 1%;
|
||||||
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
|
}
|
||||||
.ui-state-disabled { cursor: default !important; }
|
|
||||||
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
.ui-helper-clearfix {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-helper-zfix {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
position: absolute;
|
||||||
|
opacity: 0;
|
||||||
|
filter: Alpha(Opacity=0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-state-disabled {
|
||||||
|
cursor: default !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-icon {
|
||||||
|
display: block;
|
||||||
|
text-indent: -99999px;
|
||||||
|
overflow: hidden;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
/* http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/base/jquery.ui.tabs.css */
|
/* http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/base/jquery.ui.tabs.css */
|
||||||
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
.ui-widget-overlay {
|
||||||
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
position: absolute;
|
||||||
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
|
top: 0;
|
||||||
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
|
left: 0;
|
||||||
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
|
width: 100%;
|
||||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active, .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
|
height: 100%;
|
||||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
|
}
|
||||||
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
|
||||||
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
|
.ui-tabs {
|
||||||
|
position: relative;
|
||||||
|
padding: .2em;
|
||||||
|
zoom: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
||||||
|
.ui-tabs .ui-tabs-nav {
|
||||||
|
margin: 0;
|
||||||
|
padding: .2em .2em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-tabs .ui-tabs-nav li {
|
||||||
|
list-style: none;
|
||||||
|
float: left;
|
||||||
|
position: relative;
|
||||||
|
top: 1px;
|
||||||
|
margin: 0 .2em 1px 0;
|
||||||
|
border-bottom: 0 !important;
|
||||||
|
padding: 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-tabs .ui-tabs-nav li a {
|
||||||
|
float: left;
|
||||||
|
padding: .5em 1em;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-tabs .ui-tabs-nav li.ui-tabs-active, .ui-tabs .ui-tabs-nav li.ui-tabs-selected {
|
||||||
|
margin-bottom: 0;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a {
|
||||||
|
cursor: text;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
||||||
|
.ui-tabs .ui-tabs-panel {
|
||||||
|
display: block;
|
||||||
|
border-width: 0;
|
||||||
|
padding: 1em 1.4em;
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
.ui-tabs .ui-tabs-hide {
|
.ui-tabs .ui-tabs-hide {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: none;
|
display: none;
|
||||||
@@ -55,12 +155,15 @@ backward compatibility:
|
|||||||
padding: 10px 0 0 10px;
|
padding: 10px 0 0 10px;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface .ui-tabs .ui-tabs-nav li {
|
.admin-interface .ui-tabs .ui-tabs-nav li {
|
||||||
margin: 0 0 0 -1px;
|
margin: 0 0 0 -1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface .ui-tabs .ui-tabs-nav li.required {
|
.admin-interface .ui-tabs .ui-tabs-nav li.required {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface .ui-tabs .ui-tabs-nav li a {
|
.admin-interface .ui-tabs .ui-tabs-nav li a {
|
||||||
border: 1px solid #eeeeee;
|
border: 1px solid #eeeeee;
|
||||||
background-color: #f8f8f8;
|
background-color: #f8f8f8;
|
||||||
@@ -86,7 +189,7 @@ backward compatibility:
|
|||||||
margin-bottom: -1px;
|
margin-bottom: -1px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
color: {{ theme.css_module_background_color }};
|
color: var(--admin-interface-module-background-color);
|
||||||
border-bottom: 1px solid #FFFFFF;
|
border-bottom: 1px solid #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
+7
-9
@@ -4,26 +4,24 @@ https://github.com/jmrivas86/django-json-widget
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
.admin-interface div.jsoneditor {
|
.admin-interface div.jsoneditor {
|
||||||
border: 1px solid {{ theme.css_module_background_color }};
|
border: 1px solid var(--admin-interface-module-background-color);
|
||||||
{% if theme.css_module_rounded_corners %}
|
border-radius: var(--admin-interface-jsoneditor-border-radius);
|
||||||
border-radius: 4px;
|
overflow: var(--admin-interface-jsoneditor-overflow);
|
||||||
overflow: hidden;
|
|
||||||
{% endif %}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface div.jsoneditor-menu {
|
.admin-interface div.jsoneditor-menu {
|
||||||
background-color: {{ theme.css_module_background_color }};
|
background-color: var(--admin-interface-module-background-color);
|
||||||
border-bottom: 1px solid {{ theme.css_module_background_color }};
|
border-bottom: 1px solid var(--admin-interface-module-background-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface div.jsoneditor-menu a.jsoneditor-poweredBy {
|
.admin-interface div.jsoneditor-menu a.jsoneditor-poweredBy {
|
||||||
color: {{ theme.css_module_link_color }};
|
color: var(--admin-interface-module-link-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface div.jsoneditor-contextmenu ul li button.jsoneditor-selected,
|
.admin-interface div.jsoneditor-contextmenu ul li button.jsoneditor-selected,
|
||||||
.admin-interface div.jsoneditor-contextmenu ul li button.jsoneditor-selected:focus,
|
.admin-interface div.jsoneditor-contextmenu ul li button.jsoneditor-selected:focus,
|
||||||
.admin-interface div.jsoneditor-contextmenu ul li button.jsoneditor-selected:hover {
|
.admin-interface div.jsoneditor-contextmenu ul li button.jsoneditor-selected:hover {
|
||||||
background-color: {{ theme.css_module_background_selected_color }};
|
background-color: var(--admin-interface-module-background-selected-color);
|
||||||
color: #000000;
|
color: #000000;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
+2
-6
@@ -3,12 +3,8 @@ 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 {
|
||||||
+6
-5
@@ -1,12 +1,13 @@
|
|||||||
{% 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: auto;
|
||||||
margin-left: 0;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface.dashboard #content #recent-actions-module {
|
.admin-interface.dashboard #content #recent-actions-module {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
{% endif %}
|
|
||||||
|
.admin-interface.dashboard #content {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
+11
-13
@@ -3,15 +3,15 @@ related modal + magnific popup customization
|
|||||||
https://github.com/dimsemenov/Magnific-Popup
|
https://github.com/dimsemenov/Magnific-Popup
|
||||||
*/
|
*/
|
||||||
.admin-interface .related-modal.mfp-bg {
|
.admin-interface .related-modal.mfp-bg {
|
||||||
background-color: {{ theme.related_modal_background_color }};
|
background-color: var(--admin-interface-related-modal-background-color);
|
||||||
opacity: {{ theme.related_modal_background_opacity }};
|
opacity: var(--admin-interface-related-modal-background-opacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface .related-modal .mfp-content {
|
.admin-interface .related-modal .mfp-content {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
-webkit-box-shadow: 0px 5px 30px 0px rgba(0,0,0,0.2);
|
-webkit-box-shadow: 0px 5px 30px 0px rgba(0, 0, 0, 0.2);
|
||||||
-moz-box-shadow: 0px 5px 30px 0px rgba(0,0,0,0.2);
|
-moz-box-shadow: 0px 5px 30px 0px rgba(0, 0, 0, 0.2);
|
||||||
box-shadow: 0px 5px 30px 0px rgba(0,0,0,0.2);
|
box-shadow: 0px 5px 30px 0px rgba(0, 0, 0, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface .related-modal .mfp-container {
|
.admin-interface .related-modal .mfp-container {
|
||||||
@@ -22,20 +22,22 @@ https://github.com/dimsemenov/Magnific-Popup
|
|||||||
padding: 40px 80px 40px 80px;
|
padding: 40px 80px 40px 80px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width:640px){
|
@media (max-width: 640px) {
|
||||||
.admin-interface .related-modal .mfp-container {
|
.admin-interface .related-modal .mfp-container {
|
||||||
padding: 80px 20px 80px 20px;
|
padding: 80px 20px 80px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface .related-modal__nested .mfp-container {
|
.admin-interface .related-modal__nested .mfp-container {
|
||||||
padding: 40px 40px 40px 40px;
|
padding: 40px 40px 40px 40px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-height:640px){
|
@media (max-height: 640px) {
|
||||||
.admin-interface .related-modal .mfp-container {
|
.admin-interface .related-modal .mfp-container {
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface .related-modal__nested .mfp-container {
|
.admin-interface .related-modal__nested .mfp-container {
|
||||||
padding: 40px 40px 40px 40px;
|
padding: 40px 40px 40px 40px;
|
||||||
}
|
}
|
||||||
@@ -48,9 +50,7 @@ https://github.com/dimsemenov/Magnific-Popup
|
|||||||
position: relative;
|
position: relative;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
{% if theme.related_modal_rounded_corners %}
|
border-radius: var(--admin-interface-related-modal-border-radius);
|
||||||
border-radius: 4px;
|
|
||||||
{% endif %}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface .related-modal #related-modal-iframe {
|
.admin-interface .related-modal #related-modal-iframe {
|
||||||
@@ -72,9 +72,7 @@ https://github.com/dimsemenov/Magnific-Popup
|
|||||||
height: 40px;
|
height: 40px;
|
||||||
opacity: 1.0;
|
opacity: 1.0;
|
||||||
color: rgba(0, 0, 0, 0.4);
|
color: rgba(0, 0, 0, 0.4);
|
||||||
{% if not theme.related_modal_close_button_visible %}
|
display: var(--admin-interface-related-modal-close-button-display);
|
||||||
display: none;
|
|
||||||
{% endif %}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-interface .related-modal .mfp-close:hover,
|
.admin-interface .related-modal .mfp-close:hover,
|
||||||
+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;
|
|
||||||
}
|
|
||||||
|
|
||||||
})();
|
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
--admin-interface-header-background-color: {{ theme.css_header_background_color }};
|
--admin-interface-header-background-color: {{ theme.css_header_background_color }};
|
||||||
--admin-interface-header-text-color: {{ theme.css_header_text_color }};
|
--admin-interface-header-text-color: {{ theme.css_header_text_color }};
|
||||||
--admin-interface-header-link-color: {{ theme.css_header_link_color }};
|
--admin-interface-header-link-color: {{ theme.css_header_link_color }};
|
||||||
--admin-interface-header-link-hover-color: {{ theme.css_header_link_hover_color }};
|
--admin-interface-header-link_hover-color: {{ theme.css_header_link_hover_color }};
|
||||||
--admin-interface-module-background-color: {{ theme.css_module_background_color }};
|
--admin-interface-module-background-color: {{ theme.css_module_background_color }};
|
||||||
--admin-interface-module-background-selected-color: {{ theme.css_module_background_selected_color }};
|
--admin-interface-module-background-selected-color: {{ theme.css_module_background_selected_color }};
|
||||||
--admin-interface-module-text-color: {{ theme.css_module_text_color }};
|
--admin-interface-module-text-color: {{ theme.css_module_text_color }};
|
||||||
@@ -37,63 +37,74 @@
|
|||||||
--admin-interface-related-modal-background-color: {{ theme.related_modal_background_color }};
|
--admin-interface-related-modal-background-color: {{ theme.related_modal_background_color }};
|
||||||
--admin-interface-related-modal-background-opacity: {{ theme.related_modal_background_opacity }};
|
--admin-interface-related-modal-background-opacity: {{ theme.related_modal_background_opacity }};
|
||||||
|
|
||||||
{% if theme.css_header_background_color != theme.css_module_background_color %}
|
{% if theme.css_header_background_color != theme.css_module_background_color %}
|
||||||
--admin-interface-main-border-top: 10px solid var(--admin-interface-module-background-color);
|
--admin-interface-main-border-top: 10px solid var(--admin-interface-module-background-color);
|
||||||
{% else %}
|
{% else %}
|
||||||
--admin-interface-main-border-top: 0px;
|
--admin-interface-main-border-top: 0px;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if theme.logo_max_width > 0 %}
|
{% if theme.logo_max_width > 0 %}
|
||||||
--admin-interface-logo-max-width: min({{ theme.logo_max_width }}px, 100%);
|
--admin-interface-log-max-width: min({{ theme.logo_max_width }}px, 100%);
|
||||||
{% else %}
|
{% else %}
|
||||||
--admin-interface-logo-max-width: 100%;
|
--admin-interface-log-max-width: 100%;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if theme.logo_max_height > 0 %}
|
{% if theme.logo_max_height > 0 %}
|
||||||
--admin-interface-logo-max-height: {{ theme.logo_max_height }}px;
|
--admin-interface-log-max-height: {{ theme.logo_max_height }}px;
|
||||||
{% else %}
|
{% else %}
|
||||||
--admin-interface-logo-max-height: unset;
|
--admin-interface-log-max-height: unset;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if theme.related_modal_rounded_corners %}
|
{% if theme.related_modal_rounded_corners %}
|
||||||
--admin-interface-related-modal-border-radius: 4px;
|
--admin-interface-related-modal-border-radius: 4px;
|
||||||
{% else %}
|
{% else %}
|
||||||
--admin-interface-related-modal-border-radius: 0px;
|
--admin-interface-related-modal-border-radius: 0px;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if theme.css_module_rounded_corners %}
|
{% if theme.css_module_rounded_corners %}
|
||||||
--admin-interface-module-border-radius: 4px;
|
--admin-interface-module-border-radius: 4px;
|
||||||
--admin-interface-jsoneditor-border-radius: var(--admin-interface-module-border-radius);
|
--admin-interface-jsoneditor-border-radius: var(--admin-interface-module-border-radius);
|
||||||
--admin-interface-jsoneditor-overflow: hidden;
|
--admin-interface-jsoneditor-overflow: hidden;
|
||||||
{% else %}
|
{% else %}
|
||||||
--admin-interface-module-border-radius: 0px;
|
--admin-interface-module-border-radius: 0px;
|
||||||
--admin-interface-jsoneditor-border-radius: var(--admin-interface-module-border-radius);
|
--admin-interface-jsoneditor-border-radius: var(--admin-interface-module-border-radius);
|
||||||
--admin-interface-jsoneditor-overflow: unset;
|
--admin-interface-jsoneditor-overflow: unset;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if not theme.related_modal_close_button_visible %}
|
{% if not theme.related_modal_close_button_visible %}
|
||||||
--admin-interface-related-modal-close-button-display: none;
|
--admin-interface-related-modal-close-button-display: none;
|
||||||
{% else %}
|
{% else %}
|
||||||
--admin-interface-related-modal-close-button-display: unset;
|
--admin-interface-related-modal-close-button-display: unset;
|
||||||
|
{% endif %}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<link rel="stylesheet" type="text/css"
|
||||||
|
href="{% static 'admin_interface/css/admin-interface.css' %}?v={{ version_md5_cache }}">
|
||||||
|
<link rel="stylesheet" type="text/css"
|
||||||
|
href="{% static 'admin_interface/css/admin-interface-fix.css' %}?v={{ version_md5_cache }}">
|
||||||
|
<link rel="stylesheet" type="text/css" href="{% static 'admin_interface/css/form-controls.css' %}">
|
||||||
|
<link rel="stylesheet" type="text/css"
|
||||||
|
href="{% static 'admin_interface/css/list-filter-dropdown.css' %}?v={{ version_md5_cache }}">
|
||||||
|
{% if not theme.recent_actions_visible %}
|
||||||
|
<link rel="stylesheet" type="text/css"
|
||||||
|
href="{% static 'admin_interface/css/recent-actions.css' %}?v={{ version_md5_cache }}"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
}
|
<link rel="stylesheet" type="text/css"
|
||||||
{% include "admin_interface/css/admin-interface.css" %}
|
href="{% static 'admin_interface/css/related-modal.css' %}?v={{ version_md5_cache }}"/>
|
||||||
{% include "admin_interface/css/admin-interface-fix.css" %}
|
<link rel="stylesheet" type="text/css"
|
||||||
{% include "admin_interface/css/form-controls.css" %}
|
href="{% static 'admin_interface/css/jquery.ui.tabs.css' %}?v={{ version_md5_cache }}"/>
|
||||||
{% include "admin_interface/css/language-chooser.css" %}
|
<link rel="stylesheet" type="text/css"
|
||||||
{% include "admin_interface/css/list-filter-dropdown.css" %}
|
href="{% static 'admin_interface/css/modeltranslation.css' %}?v={{ version_md5_cache }}"/>
|
||||||
{% include "admin_interface/css/recent-actions.css" %}
|
<link rel="stylesheet" type="text/css"
|
||||||
{% include "admin_interface/css/related-modal.css" %}
|
href="{% static 'admin_interface/css/sorl-thumbnail.css' %}?v={{ version_md5_cache }}"/>
|
||||||
{% include "admin_interface/css/streamfield.css" %}
|
<link rel="stylesheet" type="text/css"
|
||||||
{% include "admin_interface/css/jquery.ui.tabs.css" %}
|
href="{% static 'admin_interface/css/ckeditor.css' %}?v={{ version_md5_cache }}"/>
|
||||||
{% include "admin_interface/css/modeltranslation.css" %}
|
<link rel="stylesheet" type="text/css"
|
||||||
{% include "admin_interface/css/sorl-thumbnail.css" %}
|
href="{% static 'admin_interface/css/tinymce.css' %}?v={{ version_md5_cache }}"/>
|
||||||
{% include "admin_interface/css/tabbed-admin.css" %}
|
<link rel="stylesheet" type="text/css"
|
||||||
{% include "admin_interface/css/ckeditor.css" %}
|
href="{% static 'admin_interface/css/json-widget.css' %}?v={{ version_md5_cache }}"/>
|
||||||
{% include "admin_interface/css/tinymce.css" %}
|
<link rel="stylesheet" type="text/css" href="{% static 'admin_interface/css/rtl.css' %}?v={{ version_md5_cache }}"/>
|
||||||
{% include "admin_interface/css/json-widget.css" %}
|
|
||||||
{% include "admin_interface/css/rtl.css" %}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
{% if current_lang == 'fa' %}
|
{% if current_lang == 'fa' %}
|
||||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v27.2.2/dist/font-face.css" />
|
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v27.2.2/dist/font-face.css" />
|
||||||
@@ -152,5 +163,5 @@ flat-theme admin-interface
|
|||||||
{% get_admin_interface_languages as languages %}
|
{% get_admin_interface_languages as languages %}
|
||||||
{% include "admin_interface/language_chooser.html" %}
|
{% include "admin_interface/language_chooser.html" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if theme.env_visible_in_header %}<span class="environment-label"></span><br>{% endif %}{{ block.super }}<br>
|
{% if theme.env_visible_in_header %}<span class="environment-label {{ theme.env_name }}">{{ theme.env_name }}</span><br>{% endif %}{{ block.super }}<br>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
@@ -67,10 +67,10 @@ def get_admin_interface_languages(context):
|
|||||||
|
|
||||||
@simple_tag(takes_context=True)
|
@simple_tag(takes_context=True)
|
||||||
def get_admin_interface_theme(context):
|
def get_admin_interface_theme(context):
|
||||||
# theme = get_cached_active_theme()
|
theme = get_cached_active_theme()
|
||||||
# if not theme:
|
if not theme:
|
||||||
theme = Theme.get_active_theme()
|
theme = Theme.get_active_theme()
|
||||||
# set_cached_active_theme(theme)
|
set_cached_active_theme(theme)
|
||||||
return theme
|
return theme
|
||||||
|
|
||||||
|
|
||||||
@@ -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.0"
|
||||||
|
|||||||
@@ -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