Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 520dceaa97 | |||
| 2fa85eb964 | |||
| 3bc6e6fe3b | |||
| 3dc31df5f1 | |||
| 8ded8e160b | |||
| f4e5662e49 | |||
| dba9c35ac8 | |||
| 3431565f74 | |||
| 6a42df67b1 | |||
| 593709808f | |||
| 3a2b59f7cc | |||
| b7d9b969b4 | |||
| cacf0e0534 | |||
| e2239dcb99 | |||
| c769a449f2 |
@@ -0,0 +1,71 @@
|
|||||||
|
# For most projects, this workflow file will not need changing; you simply need
|
||||||
|
# to commit it to your repository.
|
||||||
|
#
|
||||||
|
# You may wish to alter this file to override the set of languages analyzed,
|
||||||
|
# or to provide custom queries or build logic.
|
||||||
|
#
|
||||||
|
# ******** NOTE ********
|
||||||
|
# We have attempted to detect the languages in your repository. Please check
|
||||||
|
# the `language` matrix defined below to confirm you have the correct set of
|
||||||
|
# supported CodeQL languages.
|
||||||
|
#
|
||||||
|
name: "CodeQL"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
# The branches below must be a subset of the branches above
|
||||||
|
branches: [ master ]
|
||||||
|
schedule:
|
||||||
|
- cron: '26 21 * * 0'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
language: [ 'javascript', 'python' ]
|
||||||
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||||
|
# Learn more:
|
||||||
|
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v1
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
|
# By default, queries listed here will override any specified in a config file.
|
||||||
|
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||||
|
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||||
|
|
||||||
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v1
|
||||||
|
|
||||||
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
|
# 📚 https://git.io/JvXDl
|
||||||
|
|
||||||
|
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||||
|
# and modify them (or add more) to build your code if your project
|
||||||
|
# uses a compiled language
|
||||||
|
|
||||||
|
#- run: |
|
||||||
|
# make bootstrap
|
||||||
|
# make release
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v1
|
||||||
@@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [0.18.2](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.18.2) - 2021-10-25
|
||||||
|
- Fixed migration error.
|
||||||
|
|
||||||
|
## [0.18.1](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.18.1) - 2021-10-25
|
||||||
|
- Removed wrong migration.
|
||||||
|
|
||||||
|
## [0.18.0](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.18.0) - 2021-10-24
|
||||||
|
- Added foldable apps support. #117
|
||||||
|
- Removed `css` field from `Theme` model.
|
||||||
|
|
||||||
|
## [0.17.3](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.17.3) - 2021-10-12
|
||||||
|
- Fixed `FileExtensionValidator` `TypeError` on django < 1.11.
|
||||||
|
|
||||||
|
## [0.17.2](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.17.2) - 2021-10-08
|
||||||
|
- Fixed `FileExtensionValidator` `TypeError` on django < 1.11.
|
||||||
|
|
||||||
## [0.17.1](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.17.1) - 2021-09-24
|
## [0.17.1](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.17.1) - 2021-09-24
|
||||||
- Fixed `TemplateDoesNotExist` error on `django==4.0.a1` removing checking condition for `colorfield` package. #134
|
- Fixed `TemplateDoesNotExist` error on `django==4.0.a1` removing checking condition for `colorfield` package. #134
|
||||||
- Fixed favicon fetching incompatible with `django-storages` `S3`. #128
|
- Fixed favicon fetching incompatible with `django-storages` `S3`. #128
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ django-admin-interface is a modern **responsive flat admin interface customizabl
|
|||||||
- Environment name/marker
|
- Environment name/marker
|
||||||
- Language chooser
|
- Language chooser
|
||||||
- List filter dropdown
|
- List filter dropdown
|
||||||
|
- `NEW` **Foldable apps** *(accordions in the navigation bar)*
|
||||||
- `NEW` **List filter sticky**
|
- `NEW` **List filter sticky**
|
||||||
- `NEW` **Form controls sticky** *(pagination and save/delete buttons)*
|
- `NEW` **Form controls sticky** *(pagination and save/delete buttons)*
|
||||||
- Compatibility / Style optimizations for:
|
- Compatibility / Style optimizations for:
|
||||||
|
|||||||
@@ -100,6 +100,12 @@ class ThemeAdmin(admin.ModelAdmin):
|
|||||||
'css_delete_button_text_color',
|
'css_delete_button_text_color',
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
|
(_('Navigation Bar'), {
|
||||||
|
'classes': ('wide', ),
|
||||||
|
'fields': (
|
||||||
|
'foldable_apps',
|
||||||
|
)
|
||||||
|
}),
|
||||||
(_('Related Modal'), {
|
(_('Related Modal'), {
|
||||||
'classes': ('wide', ),
|
'classes': ('wide', ),
|
||||||
'fields': (
|
'fields': (
|
||||||
|
|||||||
@@ -12,4 +12,7 @@ else:
|
|||||||
if django.VERSION >= (1, 11):
|
if django.VERSION >= (1, 11):
|
||||||
from django.core.validators import FileExtensionValidator
|
from django.core.validators import FileExtensionValidator
|
||||||
else:
|
else:
|
||||||
FileExtensionValidator = lambda allowed_extensions: None
|
def FileExtensionValidator(*args, **kwargs):
|
||||||
|
def noop(*args, **kwargs):
|
||||||
|
pass
|
||||||
|
return noop
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
"css_delete_button_background_color": "#D9534F",
|
"css_delete_button_background_color": "#D9534F",
|
||||||
"css_delete_button_background_hover_color": "#C9302C",
|
"css_delete_button_background_hover_color": "#C9302C",
|
||||||
"css_delete_button_text_color": "#FFFFFF",
|
"css_delete_button_text_color": "#FFFFFF",
|
||||||
"css": "",
|
|
||||||
"related_modal_active": true,
|
"related_modal_active": true,
|
||||||
"related_modal_background_color": "#503873",
|
"related_modal_background_color": "#503873",
|
||||||
"related_modal_background_opacity": 0.2,
|
"related_modal_background_opacity": 0.2,
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
"css_delete_button_background_color": "#BA2121",
|
"css_delete_button_background_color": "#BA2121",
|
||||||
"css_delete_button_background_hover_color": "#A41515",
|
"css_delete_button_background_hover_color": "#A41515",
|
||||||
"css_delete_button_text_color": "#FFFFFF",
|
"css_delete_button_text_color": "#FFFFFF",
|
||||||
"css": "",
|
|
||||||
"related_modal_active": true,
|
"related_modal_active": true,
|
||||||
"related_modal_background_color": "#000000",
|
"related_modal_background_color": "#000000",
|
||||||
"related_modal_background_opacity": 0.2,
|
"related_modal_background_opacity": 0.2,
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
"css_delete_button_background_color": "#CC4B37",
|
"css_delete_button_background_color": "#CC4B37",
|
||||||
"css_delete_button_background_hover_color": "#BF4634",
|
"css_delete_button_background_hover_color": "#BF4634",
|
||||||
"css_delete_button_text_color": "#FFFFFF",
|
"css_delete_button_text_color": "#FFFFFF",
|
||||||
"css": "",
|
|
||||||
"related_modal_active": true,
|
"related_modal_active": true,
|
||||||
"related_modal_background_color": "#000000",
|
"related_modal_background_color": "#000000",
|
||||||
"related_modal_background_opacity": 0.2,
|
"related_modal_background_opacity": 0.2,
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
"css_delete_button_background_color": "#CD2026",
|
"css_delete_button_background_color": "#CD2026",
|
||||||
"css_delete_button_background_hover_color": "#981B1E",
|
"css_delete_button_background_hover_color": "#981B1E",
|
||||||
"css_delete_button_text_color": "#FFFFFF",
|
"css_delete_button_text_color": "#FFFFFF",
|
||||||
"css": "",
|
|
||||||
"related_modal_active": true,
|
"related_modal_active": true,
|
||||||
"related_modal_background_color": "#000000",
|
"related_modal_background_color": "#000000",
|
||||||
"related_modal_background_opacity": 0.8,
|
"related_modal_background_opacity": 0.8,
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
"css_delete_button_background_color": "#BA2121",
|
"css_delete_button_background_color": "#BA2121",
|
||||||
"css_delete_button_background_hover_color": "#A41515",
|
"css_delete_button_background_hover_color": "#A41515",
|
||||||
"css_delete_button_text_color": "#FFFFFF",
|
"css_delete_button_text_color": "#FFFFFF",
|
||||||
"css": "",
|
|
||||||
"related_modal_active": true,
|
"related_modal_active": true,
|
||||||
"related_modal_background_color": "#000000",
|
"related_modal_background_color": "#000000",
|
||||||
"related_modal_background_opacity": 0.2,
|
"related_modal_background_opacity": 0.2,
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('admin_interface', '0022_add_logo_max_width_and_height'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='theme',
|
||||||
|
name='foldable_apps',
|
||||||
|
field=models.BooleanField(default=True, verbose_name='foldable apps'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('admin_interface', '0023_theme_foldable_apps'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='theme',
|
||||||
|
name='css',
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -269,10 +269,6 @@ class Theme(models.Model):
|
|||||||
max_length=10,
|
max_length=10,
|
||||||
verbose_name=_('text color'))
|
verbose_name=_('text color'))
|
||||||
|
|
||||||
css = models.TextField(
|
|
||||||
blank=True,
|
|
||||||
verbose_name=_('text color'))
|
|
||||||
|
|
||||||
related_modal_active = models.BooleanField(
|
related_modal_active = models.BooleanField(
|
||||||
default=True,
|
default=True,
|
||||||
verbose_name=_('active'))
|
verbose_name=_('active'))
|
||||||
@@ -313,6 +309,10 @@ class Theme(models.Model):
|
|||||||
default=True,
|
default=True,
|
||||||
verbose_name=_('sticky position'))
|
verbose_name=_('sticky position'))
|
||||||
|
|
||||||
|
foldable_apps = models.BooleanField(
|
||||||
|
default=True,
|
||||||
|
verbose_name=_('foldable apps'))
|
||||||
|
|
||||||
recent_actions_visible = models.BooleanField(
|
recent_actions_visible = models.BooleanField(
|
||||||
default=True,
|
default=True,
|
||||||
verbose_name=_('visible'))
|
verbose_name=_('visible'))
|
||||||
|
|||||||
@@ -0,0 +1,70 @@
|
|||||||
|
.admin-interface.foldable-apps [class^="app-"].module {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-interface.foldable-apps [class^="app-"].module.foldable-apps-ready {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-interface.foldable-apps [class^="app-"].module > table > caption {
|
||||||
|
position: relative;
|
||||||
|
z-index: 0;
|
||||||
|
/* pointer-events: none; */
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-touch-callout: none; /* iOS Safari */
|
||||||
|
-webkit-user-select: none; /* Safari */
|
||||||
|
-khtml-user-select: none; /* Konqueror HTML */
|
||||||
|
-moz-user-select: none; /* Firefox */
|
||||||
|
-ms-user-select: none; /* Internet Explorer/Edge */
|
||||||
|
user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-interface.foldable-apps [class^="app-"].module > table > caption > a {
|
||||||
|
display: inline-block;
|
||||||
|
/* pointer-events: all !important; */
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-interface.foldable-apps [class^="app-"].module > table > caption::after {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 10;
|
||||||
|
width: auto;
|
||||||
|
height: 100%;
|
||||||
|
content: "−";
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: lighter;
|
||||||
|
text-align: center;
|
||||||
|
padding-left: 10px;
|
||||||
|
padding-right: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
pointer-events: all !important;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1024px) {
|
||||||
|
.admin-interface.foldable-apps [class^="app-"].module > table > caption::after {
|
||||||
|
padding-left: 15px;
|
||||||
|
padding-right: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-interface.foldable-apps [class^="app-"].module > table {
|
||||||
|
display: table;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-interface.foldable-apps [class^="app-"].module.collapsed {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-interface.foldable-apps [class^="app-"].module.collapsed > table > caption::after {
|
||||||
|
content: "+";
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-interface.foldable-apps [class^="app-"].module.collapsed > table > tbody {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
(function() {
|
||||||
|
window.onload = function() {
|
||||||
|
for (let moduleEl of document.querySelectorAll('.admin-interface.foldable-apps [class^="app-"].module')) {
|
||||||
|
// apply collapsed value from localstorage value
|
||||||
|
let moduleAppClass = null;
|
||||||
|
let moduleCollapsedClass = 'collapsed';
|
||||||
|
moduleEl.classList.forEach(function(className) {
|
||||||
|
if (className.startsWith('app-')) {
|
||||||
|
moduleAppClass = className;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (moduleAppClass) {
|
||||||
|
let moduleAppKey = 'admin-interface.foldable-apps_' + moduleAppClass + '_collapsed';
|
||||||
|
let moduleCollapsed = Boolean(parseInt((localStorage.getItem(moduleAppKey) || 0)) || 0);
|
||||||
|
if (moduleCollapsed === true) {
|
||||||
|
moduleEl.classList.add(moduleCollapsedClass);
|
||||||
|
} else {
|
||||||
|
moduleEl.classList.remove(moduleCollapsedClass);
|
||||||
|
}
|
||||||
|
// attach click for togggle collapsed class
|
||||||
|
for (let captionEl of moduleEl.querySelectorAll('caption')) {
|
||||||
|
captionEl.onclick = function(event) {
|
||||||
|
// only when not clicking on the app name link
|
||||||
|
if (event.target.tagName.toLowerCase() === 'caption') {
|
||||||
|
moduleEl.classList.toggle(moduleCollapsedClass);
|
||||||
|
moduleCollapsed = moduleEl.classList.contains(moduleCollapsedClass);
|
||||||
|
localStorage.setItem(moduleAppKey, (moduleCollapsed ? 1 : 0));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
moduleEl.classList.add('foldable-apps-ready');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})();
|
||||||
@@ -29,11 +29,6 @@ https://github.com/fabiocaccamo/django-admin-interface
|
|||||||
{% include "admin_interface/css/tinymce.css" %}
|
{% include "admin_interface/css/tinymce.css" %}
|
||||||
{% include "admin_interface/css/json-widget.css" %}
|
{% include "admin_interface/css/json-widget.css" %}
|
||||||
{% include "admin_interface/css/rtl.css" %}
|
{% include "admin_interface/css/rtl.css" %}
|
||||||
|
|
||||||
{% if theme.css %}
|
|
||||||
{{ theme.css|safe }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
{% if current_lang == 'fa' %}
|
{% if current_lang == 'fa' %}
|
||||||
@@ -51,10 +46,22 @@ https://github.com/fabiocaccamo/django-admin-interface
|
|||||||
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/responsive.css' %}?v={{ version }}">
|
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/responsive.css' %}?v={{ version }}">
|
||||||
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/responsive_rtl.css' %}?v={{ version }}" />
|
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/responsive_rtl.css' %}?v={{ version }}" />
|
||||||
{% include "admin_interface/favicon.html" %}
|
{% include "admin_interface/favicon.html" %}
|
||||||
|
{% include "admin_interface/foldable-apps.html" %}
|
||||||
{% include "admin_interface/related-modal.html" %}
|
{% include "admin_interface/related-modal.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block bodyclass %}admin-interface flat-theme {% get_admin_interface_theme as theme %}{% if theme.name %}{{ theme.name|slugify }}-theme{% endif %}{% if theme.form_submit_sticky %} sticky-submit {% endif %}{% if theme.form_pagination_sticky %} sticky-pagination {% endif %}{% endblock %}
|
{% block extrahead %}
|
||||||
|
{{ block.super }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block bodyclass %}
|
||||||
|
{% get_admin_interface_theme as theme %}
|
||||||
|
flat-theme admin-interface
|
||||||
|
{% if theme.name %} {{ theme.name|slugify }}-theme {% endif %}
|
||||||
|
{% if theme.foldable_apps %} foldable-apps {% endif %}
|
||||||
|
{% if theme.form_submit_sticky %} sticky-submit {% endif %}
|
||||||
|
{% if theme.form_pagination_sticky %} sticky-pagination {% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block branding %}
|
{% block branding %}
|
||||||
{% get_admin_interface_theme as theme %}
|
{% get_admin_interface_theme as theme %}
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{% load static %}
|
||||||
|
|
||||||
|
{% if theme.foldable_apps %}
|
||||||
|
<link rel="stylesheet" type="text/css" href="{% static 'admin_interface/foldable-apps/foldable-apps.css' %}?v={{ version }}">
|
||||||
|
<script type="text/javascript" src="{% static 'admin_interface/foldable-apps/foldable-apps.js' %}?v={{ version }}"></script>
|
||||||
|
{% endif %}
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
__version__ = '0.17.1'
|
__version__ = '0.18.2'
|
||||||
|
|||||||
Reference in New Issue
Block a user