Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2baed25204 | |||
| 3f5a3f9ded | |||
| 6189a7bbdb | |||
| d1cda34a52 | |||
| fdbacba4bb | |||
| 5c56f3a2db | |||
| 17bb35c559 |
@@ -4,6 +4,12 @@ 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.15.0](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.15.0) - 2021-02-03
|
||||||
|
- Added sticky form controls and pagination options. #110
|
||||||
|
- Added support to 4-digit language code in language chooser. #111
|
||||||
|
- Added theme css variables for third-party libraries.
|
||||||
|
- Fixed app module section link hover color.
|
||||||
|
|
||||||
## [0.14.2](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.14.2) - 2021-01-04
|
## [0.14.2](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.14.2) - 2021-01-04
|
||||||
- Fixed tabular inline scroll bar. #101
|
- Fixed tabular inline scroll bar. #101
|
||||||
- Fixed module header selected link color. #102
|
- Fixed module header selected link color. #102
|
||||||
|
|||||||
@@ -88,6 +88,32 @@ 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
|
||||||
|
You can add **theme support to existing third-party libraries** using the following **css variables**:
|
||||||
|
|
||||||
|
- `--admin-interface-title-color`
|
||||||
|
- `--admin-interface-logo-color`
|
||||||
|
- `--admin-interface-env-color`
|
||||||
|
- `--admin-interface-header-background-color:`
|
||||||
|
- `--admin-interface-header-text-color`
|
||||||
|
- `--admin-interface-header-link-color`
|
||||||
|
- `--admin-interface-header-link_hover-color`
|
||||||
|
- `--admin-interface-module-background-color`
|
||||||
|
- `--admin-interface-module-text-color`
|
||||||
|
- `--admin-interface-module-link-color`
|
||||||
|
- `--admin-interface-module-link-hover-color`
|
||||||
|
- `--admin-interface-generic-link-color`
|
||||||
|
- `--admin-interface-generic-link-hover-color`
|
||||||
|
- `--admin-interface-save-button-background-color`
|
||||||
|
- `--admin-interface-save-button-background-hover-color`
|
||||||
|
- `--admin-interface-save-button-text-color`
|
||||||
|
- `--admin-interface-delete-button-background-color`
|
||||||
|
- `--admin-interface-delete-button-background-hover-color`
|
||||||
|
- `--admin-interface-delete-button-text-color`
|
||||||
|
- `--admin-interface-related-modal-background-color`
|
||||||
|
- `--admin-interface-related-modal-background-opacity`
|
||||||
|
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
###### Admin login
|
###### Admin login
|
||||||

|

|
||||||
|
|||||||
@@ -110,6 +110,13 @@ class ThemeAdmin(admin.ModelAdmin):
|
|||||||
'related_modal_close_button_visible',
|
'related_modal_close_button_visible',
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
|
(_('Form Controls'), {
|
||||||
|
'classes': ('wide', ),
|
||||||
|
'fields': (
|
||||||
|
'form_submit_sticky',
|
||||||
|
'form_pagination_sticky',
|
||||||
|
)
|
||||||
|
}),
|
||||||
(_('List Filter'), {
|
(_('List Filter'), {
|
||||||
'classes': ('wide', ),
|
'classes': ('wide', ),
|
||||||
'fields': (
|
'fields': (
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# Generated by Django 3.1.5 on 2021-01-29 20:29
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('admin_interface', '0018_theme_list_filter_sticky'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='theme',
|
||||||
|
name='form_pagination_sticky',
|
||||||
|
field=models.BooleanField(default=False, verbose_name='sticky pagination'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='theme',
|
||||||
|
name='form_submit_sticky',
|
||||||
|
field=models.BooleanField(default=False, verbose_name='sticky submit'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -299,6 +299,13 @@ class Theme(models.Model):
|
|||||||
default=True,
|
default=True,
|
||||||
verbose_name=_('visible'))
|
verbose_name=_('visible'))
|
||||||
|
|
||||||
|
form_submit_sticky = models.BooleanField(
|
||||||
|
default=False,
|
||||||
|
verbose_name=_('sticky submit'))
|
||||||
|
form_pagination_sticky = models.BooleanField(
|
||||||
|
default=False,
|
||||||
|
verbose_name=_('sticky pagination'))
|
||||||
|
|
||||||
def set_active(self):
|
def set_active(self):
|
||||||
self.active = True
|
self.active = True
|
||||||
self.save()
|
self.save()
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ https://github.com/fabiocaccamo/django-admin-interface
|
|||||||
{% 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 %}{% 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 branding %}
|
{% block branding %}
|
||||||
{% get_admin_interface_theme as theme %}
|
{% get_admin_interface_theme as theme %}
|
||||||
|
|||||||
@@ -412,6 +412,25 @@ body.admin-interface .paginator a.showall:visited {
|
|||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.admin-interface.sticky-submit.change-form:not(.popup) #main > #nav-sidebar + .content,
|
||||||
|
.admin-interface.sticky-pagination.change-list:not(.popup) #main > #nav-sidebar + .content {
|
||||||
|
padding-bottom: 4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-interface.sticky-submit.change-form:not(.popup) #main > #nav-sidebar + .content form fieldset + .submit-row,
|
||||||
|
.admin-interface.sticky-pagination.change-list:not(.popup) #main > #nav-sidebar + .content form .results + .paginator {
|
||||||
|
width: 100%;
|
||||||
|
max-width: calc(100% - 28px);
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
position: fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-interface.sticky-pagination.change-list:not(.popup) #main > #nav-sidebar + .content form .results + .paginator {
|
||||||
|
max-width: calc(100% - 20px);
|
||||||
|
}
|
||||||
|
|
||||||
/* hide nav-sidebar below 1280px to prevent horizontal overflow issues */
|
/* hide nav-sidebar below 1280px to prevent horizontal overflow issues */
|
||||||
@media (max-width:1279px) {
|
@media (max-width:1279px) {
|
||||||
.admin-interface #nav-sidebar,
|
.admin-interface #nav-sidebar,
|
||||||
@@ -449,6 +468,17 @@ body.admin-interface .paginator a.showall:visited {
|
|||||||
.admin-interface.change-form:not(.popup) #main.shifted > #nav-sidebar + .content {
|
.admin-interface.change-form:not(.popup) #main.shifted > #nav-sidebar + .content {
|
||||||
max-width: calc(100% - 360px);
|
max-width: calc(100% - 360px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.admin-interface.sticky-submit.change-form:not(.popup) #main.shifted > #nav-sidebar + .content form fieldset + .submit-row,
|
||||||
|
.admin-interface.sticky-pagination.change-list:not(.popup) #main.shifted > #nav-sidebar + .content form .results + .paginator {
|
||||||
|
max-width: calc(100% - 388px);
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-interface.sticky-pagination.change-list:not(.popup) #main.shifted > #nav-sidebar + .content form .results + .paginator {
|
||||||
|
max-width: calc(100% - 380px);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fixed related widget and select2 */
|
/* fixed related widget and select2 */
|
||||||
@@ -537,4 +567,14 @@ body.admin-interface .paginator a.showall:visited {
|
|||||||
.admin-interface .aligned .form-row .file-upload input[type="file"] {
|
.admin-interface .aligned .form-row .file-upload input[type="file"] {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.admin-interface.sticky-submit.change-form:not(.popup) #main > #nav-sidebar + .content,
|
||||||
|
.admin-interface.sticky-pagination.change-form:not(.popup) #main > #nav-sidebar + .content {
|
||||||
|
padding-bottom: 12rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-interface.sticky-submit.change-form:not(.popup) #main > #nav-sidebar + .content .submit-row,
|
||||||
|
.admin-interface.sticky-pagination.change-list:not(.popup) #main > #nav-sidebar + .content form .results + .paginator {
|
||||||
|
max-width: calc(100% - 20px);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,27 @@
|
|||||||
|
:root {
|
||||||
|
--admin-interface-title-color: {{ theme.title_color }};
|
||||||
|
--admin-interface-logo-color: {{ theme.logo_color }};
|
||||||
|
--admin-interface-env-color: {{ theme.env_color }};
|
||||||
|
--admin-interface-header-background-color: {{ theme.css_header_background_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_hover-color: {{ theme.css_header_link_hover_color }};
|
||||||
|
--admin-interface-module-background-color: {{ theme.css_module_background_color }};
|
||||||
|
--admin-interface-module-text-color: {{ theme.css_module_text_color }};
|
||||||
|
--admin-interface-module-link-color: {{ theme.css_module_link_color }};
|
||||||
|
--admin-interface-module-link-hover-color: {{ theme.css_module_link_hover_color }};
|
||||||
|
--admin-interface-generic-link-color: {{ theme.css_generic_link_color }};
|
||||||
|
--admin-interface-generic-link-hover-color: {{ theme.css_generic_link_hover_color }};
|
||||||
|
--admin-interface-save-button-background-color: {{ theme.css_save_button_background_color }};
|
||||||
|
--admin-interface-save-button-background-hover-color: {{ theme.css_save_button_background_hover_color }};
|
||||||
|
--admin-interface-save-button-text-color: {{ theme.css_save_button_text_color }};
|
||||||
|
--admin-interface-delete-button-background-color: {{ theme.css_delete_button_background_color }};
|
||||||
|
--admin-interface-delete-button-background-hover-color: {{ theme.css_delete_button_background_hover_color }};
|
||||||
|
--admin-interface-delete-button-text-color: {{ theme.css_delete_button_text_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 #header {
|
.admin-interface #header {
|
||||||
background: {{ theme.css_header_background_color }};
|
background: {{ theme.css_header_background_color }};
|
||||||
color: {{ theme.css_header_text_color }};
|
color: {{ theme.css_header_text_color }};
|
||||||
@@ -106,6 +130,11 @@
|
|||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.admin-interface #nav-sidebar .current-app .section:focus,
|
||||||
|
.admin-interface #nav-sidebar .current-app .section:hover {
|
||||||
|
color: {{ theme.css_module_link_hover_color }};
|
||||||
|
}
|
||||||
|
|
||||||
.admin-interface #nav-sidebar .current-model {
|
.admin-interface #nav-sidebar .current-model {
|
||||||
background: #FFFFCC;
|
background: #FFFFCC;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ def get_admin_interface_languages(context):
|
|||||||
if not request:
|
if not request:
|
||||||
return None
|
return None
|
||||||
full_path = request.get_full_path()
|
full_path = request.get_full_path()
|
||||||
admin_nolang_url = re.sub(r'^\/([\w]{2})([\-\_]{1}[\w]{2})?\/', '/', full_path)
|
admin_nolang_url = re.sub(r'^\/([\w]{2})([\-\_]{1}[\w]{2,4})?\/', '/', full_path)
|
||||||
if admin_nolang_url == full_path:
|
if admin_nolang_url == full_path:
|
||||||
# ImproperlyConfigured - must include admin urls using i18n_patterns:
|
# ImproperlyConfigured - must include admin urls using i18n_patterns:
|
||||||
# from django.conf.urls.i18n import i18n_patterns
|
# from django.conf.urls.i18n import i18n_patterns
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
__version__ = '0.14.2'
|
__version__ = '0.15.0'
|
||||||
|
|||||||
Reference in New Issue
Block a user