Compare commits
12
Commits
0.18.7
...
a96cede14f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a96cede14f | ||
|
|
903417ab79 | ||
|
|
d76c64c2d6 | ||
|
|
4244b0b3ae | ||
|
|
7baffaf490 | ||
|
|
b8a160f746 | ||
|
|
5e3e3a1480 | ||
|
|
7d649185cb | ||
|
|
3ff4f05e51 | ||
|
|
d8cffd8c2c | ||
|
|
8fe7178a13 | ||
|
|
d2b680e477 |
@@ -6,12 +6,37 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
|
||||||
|
prepare:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Create matrix
|
||||||
|
uses: fabiocaccamo/create-matrix-action@v2
|
||||||
|
id: create_matrix
|
||||||
|
with:
|
||||||
|
matrix: |
|
||||||
|
python-version {2.7}, django-version {1.8,1.9,1.10,1.11}, database {sqlite,postgres}
|
||||||
|
python-version {3.6}, django-version {1.8,1.9,1.10,1.11,2.0,2.1,2.2,3.0,3.1,3.2}, database {sqlite,postgres}
|
||||||
|
python-version {3.7}, django-version {2.0,2.1,2.2,3.0,3.1,3.2}, database {sqlite,postgres}
|
||||||
|
python-version {3.8}, 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}
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.create_matrix.outputs.matrix }}
|
||||||
|
|
||||||
|
test:
|
||||||
|
|
||||||
|
needs: prepare
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10']
|
include: ${{fromJson(needs.prepare.outputs.matrix)}}
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
@@ -27,7 +52,10 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install psycopg2 prerequisites
|
||||||
|
run: sudo apt-get install libpq-dev
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
@@ -35,15 +63,31 @@ jobs:
|
|||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
cache: 'pip'
|
cache: 'pip'
|
||||||
|
|
||||||
- name: Install psycopg2 prerequisites
|
- name: Upgrade pip version
|
||||||
run: sudo apt-get install libpq-dev
|
run: |
|
||||||
|
pip install pip --upgrade
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install django
|
||||||
|
run: |
|
||||||
|
pip install "Django ~= ${{ matrix.django-version }}"
|
||||||
|
|
||||||
|
- name: Install requirements
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install -r requirements-test.txt
|
pip install -r requirements-test.txt
|
||||||
pip install tox tox-gh-actions
|
|
||||||
|
|
||||||
- name: Test with tox
|
- name: Run tests
|
||||||
run: tox
|
env:
|
||||||
|
DATABASE_ENGINE: ${{ matrix.database }}
|
||||||
|
run: |
|
||||||
|
coverage run --append --source=admin_interface setup.py test
|
||||||
|
coverage xml -o ./coverage.xml
|
||||||
|
|
||||||
|
- name: Upload coverage to Codecov
|
||||||
|
uses: codecov/codecov-action@v2
|
||||||
|
with:
|
||||||
|
fail_ci_if_error: false
|
||||||
|
files: ./coverage.xml
|
||||||
|
flags: unittests
|
||||||
|
verbose: true
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ 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.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))
|
||||||
|
|
||||||
## [0.18.7](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.18.7) - 2022-02-24
|
## [0.18.7](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.18.7) - 2022-02-24
|
||||||
- Removed public disclosures of the lib's version. #154 (thanks to [@mintyPT](https://github.com/mintyPT))
|
- Removed public disclosures of the lib's version. #154 (thanks to [@mintyPT](https://github.com/mintyPT))
|
||||||
- Reformatted code with **Black**.
|
- Reformatted code with **Black**.
|
||||||
|
|||||||
@@ -1,16 +1,25 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from admin_interface.compat import gettext_lazy as _
|
|
||||||
from admin_interface.models import Theme
|
|
||||||
|
|
||||||
from django.contrib import admin
|
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.models import Theme, UserTheme
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
@@ -24,6 +33,7 @@ class ThemeAdmin(admin.ModelAdmin):
|
|||||||
"fields": (
|
"fields": (
|
||||||
"name",
|
"name",
|
||||||
"active",
|
"active",
|
||||||
|
"demo",
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -133,7 +143,8 @@ class ThemeAdmin(admin.ModelAdmin):
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
(_("Navigation Bar"), {"classes": ("wide",), "fields": ("foldable_apps",)}),
|
(_("Navigation Bar"), {"classes": (
|
||||||
|
"wide",), "fields": ("foldable_apps",)}),
|
||||||
(
|
(
|
||||||
_("Related Modal"),
|
_("Related Modal"),
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
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,
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("admin_interface", "0024_remove_theme_css"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name="theme",
|
||||||
|
name="demo",
|
||||||
|
field=models.BooleanField(default=False, verbose_name="demo"),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("admin_interface", "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"),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
# 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),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# 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'),
|
||||||
|
),
|
||||||
|
]
|
||||||
+55
-25
@@ -2,16 +2,28 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from admin_interface.cache import del_cached_active_theme
|
import inspect
|
||||||
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.ForeignKey(
|
||||||
|
'auth.User', on_delete=models.CASCADE, null=True, unique=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):
|
||||||
@@ -25,22 +37,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():
|
||||||
@@ -60,6 +72,17 @@ class Theme(models.Model):
|
|||||||
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():
|
||||||
|
if frame_record[3] == 'get_response':
|
||||||
|
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 = objs_active_ls[-1]
|
||||||
obj.set_active()
|
obj.set_active()
|
||||||
|
|
||||||
@@ -70,6 +93,9 @@ class Theme(models.Model):
|
|||||||
)
|
)
|
||||||
active = models.BooleanField(default=True, verbose_name=_("active"))
|
active = models.BooleanField(default=True, verbose_name=_("active"))
|
||||||
|
|
||||||
|
demo = models.BooleanField(default=False, verbose_name=_("is demo"))
|
||||||
|
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"),
|
||||||
@@ -83,7 +109,8 @@ class Theme(models.Model):
|
|||||||
max_length=10,
|
max_length=10,
|
||||||
verbose_name=_("color"),
|
verbose_name=_("color"),
|
||||||
)
|
)
|
||||||
title_visible = models.BooleanField(default=True, verbose_name=_("visible"))
|
title_visible = models.BooleanField(
|
||||||
|
default=True, verbose_name=_("visible"))
|
||||||
|
|
||||||
logo = models.FileField(
|
logo = models.FileField(
|
||||||
upload_to="admin-interface/logo/",
|
upload_to="admin-interface/logo/",
|
||||||
@@ -123,7 +150,8 @@ class Theme(models.Model):
|
|||||||
verbose_name=_("favicon"),
|
verbose_name=_("favicon"),
|
||||||
)
|
)
|
||||||
|
|
||||||
env_name = models.CharField(blank=True, max_length=50, verbose_name=_("name"))
|
env_name = models.CharField(
|
||||||
|
blank=True, max_length=50, verbose_name=_("name"))
|
||||||
env_color = ColorField(
|
env_color = ColorField(
|
||||||
blank=True,
|
blank=True,
|
||||||
default="#E74C3C",
|
default="#E74C3C",
|
||||||
@@ -294,7 +322,8 @@ class Theme(models.Model):
|
|||||||
verbose_name=_("text color"),
|
verbose_name=_("text color"),
|
||||||
)
|
)
|
||||||
|
|
||||||
related_modal_active = models.BooleanField(default=True, verbose_name=_("active"))
|
related_modal_active = models.BooleanField(
|
||||||
|
default=True, verbose_name=_("active"))
|
||||||
related_modal_background_color = ColorField(
|
related_modal_background_color = ColorField(
|
||||||
blank=True,
|
blank=True,
|
||||||
default="#000000",
|
default="#000000",
|
||||||
@@ -361,7 +390,8 @@ class Theme(models.Model):
|
|||||||
default=True, verbose_name=_("sticky position")
|
default=True, verbose_name=_("sticky position")
|
||||||
)
|
)
|
||||||
|
|
||||||
foldable_apps = models.BooleanField(default=True, verbose_name=_("foldable apps"))
|
foldable_apps = models.BooleanField(
|
||||||
|
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")
|
||||||
@@ -389,5 +419,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)
|
||||||
|
|||||||
@@ -2,12 +2,10 @@
|
|||||||
{% load i18n static admin_interface_tags %}
|
{% load i18n static admin_interface_tags %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
{% get_admin_interface_theme as theme %}
|
|
||||||
{% if title %}{{ title }} | {% endif %}{% if theme.title %}{% trans theme.title %}{% else %}{{ site_title|default:_('Django administration') }}{% endif %}
|
{% if title %}{{ title }} | {% endif %}{% if theme.title %}{% trans theme.title %}{% else %}{{ site_title|default:_('Django administration') }}{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block extrastyle %}
|
{% block extrastyle %}
|
||||||
{% get_admin_interface_theme as theme %}
|
|
||||||
{% get_admin_interface_nocache as version_md5_cache %}
|
{% get_admin_interface_nocache as version_md5_cache %}
|
||||||
{% get_current_language as current_lang %}
|
{% get_current_language as current_lang %}
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
@@ -35,7 +33,6 @@
|
|||||||
|
|
||||||
{% block blockbots %}
|
{% block blockbots %}
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
{% get_admin_interface_theme as theme %}
|
|
||||||
{% get_admin_interface_nocache as version_md5_cache %}
|
{% get_admin_interface_nocache as version_md5_cache %}
|
||||||
{# https://github.com/elky/django-flat-responsive#important-note #}
|
{# https://github.com/elky/django-flat-responsive#important-note #}
|
||||||
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||||
@@ -51,7 +48,6 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block bodyclass %}
|
{% block bodyclass %}
|
||||||
{% get_admin_interface_theme as theme %}
|
|
||||||
flat-theme admin-interface
|
flat-theme admin-interface
|
||||||
{% if theme.name %} {{ theme.name|slugify }}-theme {% endif %}
|
{% if theme.name %} {{ theme.name|slugify }}-theme {% endif %}
|
||||||
{% if theme.foldable_apps %} foldable-apps {% endif %}
|
{% if theme.foldable_apps %} foldable-apps {% endif %}
|
||||||
@@ -60,7 +56,6 @@ flat-theme admin-interface
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block branding %}
|
{% block branding %}
|
||||||
{% get_admin_interface_theme as theme %}
|
|
||||||
<h1 id="site-name">
|
<h1 id="site-name">
|
||||||
<a href="{% url 'admin:index' %}">
|
<a href="{% url 'admin:index' %}">
|
||||||
{% if theme.logo_visible %}
|
{% if theme.logo_visible %}
|
||||||
@@ -78,10 +73,9 @@ flat-theme admin-interface
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block welcome-msg %}
|
{% block welcome-msg %}
|
||||||
{% get_admin_interface_theme as theme %}
|
|
||||||
{% if theme.language_chooser_active %}
|
{% if theme.language_chooser_active %}
|
||||||
{% 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 {{ theme.env_name }}"></span><br>{% endif %}{{ block.super }}<br>
|
{% if theme.env_visible_in_header %}<span class="environment-label"></span><br>{% endif %}{{ block.super }}<br>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -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: nowrap;
|
white-space: normal;
|
||||||
align-self: flex-start;
|
align-self: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
__version__ = "0.18.7"
|
__version__ = "0.19.3"
|
||||||
|
|||||||
Reference in New Issue
Block a user