Compare commits
65 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 875269e314 | |||
| 775f1cf42b | |||
| cc0474940f | |||
| 97896e3690 | |||
| 6a723e5515 | |||
| fdf3b418f9 | |||
| 49538ed582 | |||
| c784a083f3 | |||
| d1c912e875 | |||
| e9e950dda3 | |||
| 3c4ea399e2 | |||
| a28fe1c5e0 | |||
| c07a846374 | |||
| f0126fb407 | |||
| 869ae626da | |||
| a6bdb2b36d | |||
| aa18e19625 | |||
| a35f8d0fb7 | |||
| d29515c4ae | |||
| 00f60c222d | |||
| ff2d05e44c | |||
| 6e5cbf3a2c | |||
| 55b365b2e4 | |||
| 3203b437df | |||
| 202b5fa4aa | |||
| 9fdc3a0268 | |||
| ded2fee89c | |||
| beec7242c6 | |||
| 7a6a29b110 | |||
| 1f3bb6514c | |||
| b416b46c5a | |||
| 59f1831cbd | |||
| 20050e2964 | |||
| fd292ed1bf | |||
| fac0f690df | |||
| d18aadd93d | |||
| 9350575898 | |||
| 4789ee1dab | |||
| a924c6cf5e | |||
| 42b6e01f1f | |||
| d7fa681c56 | |||
| 18e1425156 | |||
| 1f39ceb0ad | |||
| 48cb73a604 | |||
| c5bbbbc855 | |||
| 793a019460 | |||
| 674178ecbe | |||
| 07a51c1678 | |||
| a58605a385 | |||
| e1d2c81ebe | |||
| e5e55bdfcd | |||
| f6ce51c839 | |||
| b4b19650f1 | |||
| 3d4f249487 | |||
| 7c236c6641 | |||
| 91b3809d61 | |||
| f918551971 | |||
| 149c95311f | |||
| 858f077bd4 | |||
| e46daa8f99 | |||
| e3320b2034 | |||
| 8991863fb1 | |||
| 54f120c9ba | |||
| 816c05bebd | |||
| 710370e903 |
+22
@@ -0,0 +1,22 @@
|
|||||||
|
language: python
|
||||||
|
python: 3.5
|
||||||
|
env:
|
||||||
|
- TOX_ENV=py27-17
|
||||||
|
- TOX_ENV=py27-18
|
||||||
|
- TOX_ENV=py27-19
|
||||||
|
- TOX_ENV=py27-110
|
||||||
|
- TOX_ENV=py34-17
|
||||||
|
- TOX_ENV=py34-18
|
||||||
|
- TOX_ENV=py34-19
|
||||||
|
- TOX_ENV=py34-110
|
||||||
|
- TOX_ENV=py35-18
|
||||||
|
- TOX_ENV=py35-19
|
||||||
|
- TOX_ENV=py35-110
|
||||||
|
#- TOX_ENV=py36-18
|
||||||
|
#- TOX_ENV=py36-19
|
||||||
|
#- TOX_ENV=py36-110
|
||||||
|
install:
|
||||||
|
- pip install tox
|
||||||
|
script:
|
||||||
|
- tox -e $TOX_ENV
|
||||||
|
sudo: false
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2015 Fabio Caccamo - fabio.caccamo@gmail.com
|
Copyright (c) 2016 Fabio Caccamo - fabio.caccamo@gmail.com
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -1,21 +1,28 @@
|
|||||||
#django-admin-interface
|
[](https://travis-ci.org/fabiocaccamo/django-admin-interface)
|
||||||
django-admin-interface is a modern **flat admin interface customizable by the admin itself**.
|
[](https://codecov.io/gh/fabiocaccamo/django-admin-interface)
|
||||||
|
[](https://badge.fury.io/py/django-admin-interface)
|
||||||
|
[](https://img.shields.io/pypi/pyversions/django-admin-interface.svg)
|
||||||
|
[](https://img.shields.io/pypi/l/django-admin-interface.svg)
|
||||||
|
|
||||||
|
# django-admin-interface
|
||||||
|
django-admin-interface is a modern **responsive flat admin interface customizable by the admin itself**.
|
||||||
|
|
||||||
You can use the builtin **django-theme** or create your own and **customize** **title, logo and colors**.
|
You can use the builtin **django-theme** or create your own and **customize** **title, logo and colors**.
|
||||||
|
|
||||||
##Requirements
|
## Requirements
|
||||||
- Python 2.6, Python 2.7
|
- Python 2.7, 3.4, 3.5, 3.6
|
||||||
- Django 1.6.5 through Django 1.8.4
|
- Django 1.7, 1.8, 1.9, 1.10, 1.11
|
||||||
|
|
||||||
##Installation
|
## Installation
|
||||||
- Run `pip install django-admin-interface`
|
- Run `pip install django-admin-interface`
|
||||||
- Add `admin_interface`, `flat` and `colorfield` to `settings.INSTALLED_APPS` **before** `django.contrib.admin`
|
- Add `admin_interface`, `flat_responsive`, `flat` and `colorfield` to `settings.INSTALLED_APPS` **before** `django.contrib.admin`
|
||||||
```python
|
```python
|
||||||
INSTALLED_APPS = (
|
INSTALLED_APPS = (
|
||||||
#...
|
#...
|
||||||
'flat',
|
|
||||||
'colorfield',
|
|
||||||
'admin_interface',
|
'admin_interface',
|
||||||
|
'flat_responsive',
|
||||||
|
'flat', #if django version < 1.9
|
||||||
|
'colorfield',
|
||||||
#...
|
#...
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
#...
|
#...
|
||||||
@@ -25,42 +32,23 @@ INSTALLED_APPS = (
|
|||||||
- Run ``python manage.py collectstatic``
|
- Run ``python manage.py collectstatic``
|
||||||
- Restart your application server
|
- Restart your application server
|
||||||
|
|
||||||
##Screenshots
|
## Screenshots
|
||||||
######Admin login
|
###### Admin login
|
||||||

|

|
||||||
---
|
---
|
||||||
######Admin dashboard
|
###### Admin dashboard
|
||||||

|

|
||||||
---
|
---
|
||||||
######Admin themes management
|
###### Admin themes management
|
||||||

|

|
||||||
---
|
---
|
||||||
######Admin theme customization
|
###### Admin theme customization
|
||||||

|

|
||||||
|
|
||||||
####Thanks
|
#### Thanks
|
||||||
- [django-flat-theme](https://github.com/elky/django-flat-theme/)
|
- [django-flat-theme](https://github.com/elky/django-flat-theme/)
|
||||||
|
- [django-flat-responsive](https://github.com/elky/django-flat-responsive)
|
||||||
- [django-colorfield](https://github.com/jaredly/django-colorfield/)
|
- [django-colorfield](https://github.com/jaredly/django-colorfield/)
|
||||||
|
|
||||||
##License
|
## License
|
||||||
The MIT License (MIT)
|
Released under [MIT License](LICENSE).
|
||||||
|
|
||||||
Copyright (c) 2015 Fabio Caccamo - fabio.caccamo@gmail.com
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|||||||
@@ -43,7 +43,11 @@ class ThemeAdmin(admin.ModelAdmin):
|
|||||||
'classes': ('wide', ),
|
'classes': ('wide', ),
|
||||||
'fields': ('css_delete_button_background_color', 'css_delete_button_background_hover_color', 'css_delete_button_text_color', )
|
'fields': ('css_delete_button_background_color', 'css_delete_button_background_hover_color', 'css_delete_button_text_color', )
|
||||||
}),
|
}),
|
||||||
('Extras', {
|
('Related Modal', {
|
||||||
|
'classes': ('wide', ),
|
||||||
|
'fields': ('related_modal_active', 'related_modal_background_color', 'related_modal_background_opacity', 'related_modal_rounded_corners', )
|
||||||
|
}),
|
||||||
|
('List Filter', {
|
||||||
'classes': ('wide', ),
|
'classes': ('wide', ),
|
||||||
'fields': ('list_filter_dropdown', )
|
'fields': ('list_filter_dropdown', )
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
from django.db.models.signals import post_migrate
|
from django.db.models.signals import post_migrate
|
||||||
|
|
||||||
from admin_interface.models import Theme
|
|
||||||
|
|
||||||
|
|
||||||
class AdminInterfaceConfig(AppConfig):
|
class AdminInterfaceConfig(AppConfig):
|
||||||
|
|
||||||
@@ -13,6 +11,6 @@ class AdminInterfaceConfig(AppConfig):
|
|||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
|
|
||||||
|
from admin_interface.models import Theme
|
||||||
post_migrate.connect(Theme.post_migrate_handler, sender = self)
|
post_migrate.connect(Theme.post_migrate_handler, sender = self)
|
||||||
|
|
||||||
|
|
||||||
@@ -1 +1 @@
|
|||||||
[{"fields": {"css_save_button_text_color": "#FFFFFF", "css_module_link_hover_color": "#C9F0DD", "css_delete_button_text_color": "#FFFFFF", "list_filter_dropdown": false, "css_save_button_background_hover_color": "#0C3C26", "css_module_rounded_corners": true, "logo": "", "css_module_background_color": "#44B78B", "title": "Django administration", "css_header_link_color": "#FFFFFF", "css_delete_button_background_hover_color": "#A41515", "css": "", "css_module_link_color": "#FFFFFF", "css_module_text_color": "#FFFFFF", "css_generic_link_hover_color": "#156641", "css_save_button_background_color": "#0C4B33", "logo_visible": true, "active": false, "css_header_background_color": "#0C4B33", "name": "Django", "css_generic_link_color": "#0C3C26", "css_delete_button_background_color": "#BA2121", "css_header_text_color": "#44B78B", "css_header_link_hover_color": "#C9F0DD", "css_header_title_color": "#F5DD5D", "title_visible": true}, "model": "admin_interface.theme", "pk": 1}]
|
[{"model": "admin_interface.theme", "pk": 1, "fields": {"name": "Django", "active": true, "title": "Django administration", "title_visible": true, "logo": "", "logo_visible": true, "css_header_background_color": "#0C4B33", "css_header_title_color": "#F5DD5D", "css_header_text_color": "#44B78B", "css_header_link_color": "#FFFFFF", "css_header_link_hover_color": "#C9F0DD", "css_module_background_color": "#44B78B", "css_module_text_color": "#FFFFFF", "css_module_link_color": "#FFFFFF", "css_module_link_hover_color": "#C9F0DD", "css_module_rounded_corners": true, "css_generic_link_color": "#0C3C26", "css_generic_link_hover_color": "#156641", "css_save_button_background_color": "#0C4B33", "css_save_button_background_hover_color": "#0C3C26", "css_save_button_text_color": "#FFFFFF", "css_delete_button_background_color": "#BA2121", "css_delete_button_background_hover_color": "#A41515", "css_delete_button_text_color": "#FFFFFF", "css": "", "related_modal_active": true, "related_modal_background_color": "#000000", "related_modal_background_opacity": 0.2, "related_modal_rounded_corners": true, "list_filter_dropdown": false}}]
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import colorfield.fields
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('admin_interface', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='theme',
|
||||||
|
name='list_filter_dropdown',
|
||||||
|
field=models.BooleanField(default=False, verbose_name=b'use dropdown'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='theme',
|
||||||
|
name='related_modal_active',
|
||||||
|
field=models.BooleanField(default=True, verbose_name=b'active'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='theme',
|
||||||
|
name='related_modal_background_color',
|
||||||
|
field=colorfield.fields.ColorField(blank=True, default=b'#000000', help_text=b'#000000', max_length=10, verbose_name=b'background color'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='theme',
|
||||||
|
name='related_modal_background_opacity',
|
||||||
|
field=models.FloatField(choices=[(0.1, b'10%'), (0.2, b'20%'), (0.3, b'30%'), (0.4, b'40%'), (0.5, b'50%'), (0.6, b'60%'), (0.7, b'70%'), (0.8, b'80%'), (0.9, b'90%')], default=0.2, help_text=b'20%', verbose_name=b'background opacity'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='theme',
|
||||||
|
name='related_modal_rounded_corners',
|
||||||
|
field=models.BooleanField(default=True, verbose_name=b'rounded corners'),
|
||||||
|
),
|
||||||
|
]
|
||||||
+46
-21
@@ -13,30 +13,39 @@ class Theme(models.Model):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def post_migrate_handler(sender, **kwargs):
|
def post_migrate_handler(sender, **kwargs):
|
||||||
Theme.get_or_create_default_theme()
|
Theme.get_active_theme()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def post_delete_handler(instance, **kwargs):
|
def post_delete_handler(instance, **kwargs):
|
||||||
Theme.get_or_create_default_theme()
|
Theme.get_active_theme()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def post_save_handler(instance, created, **kwargs):
|
def post_save_handler(instance, created, **kwargs):
|
||||||
instance.set_active(instance.active)
|
Theme.get_active_theme()
|
||||||
Theme.get_or_create_default_theme()
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_or_create_default_theme():
|
def get_active_theme():
|
||||||
|
|
||||||
obj_active = (True if len(list(Theme.objects.filter(active = True))) == 0 else False)
|
objs_active_qs = Theme.objects.filter( active = True )
|
||||||
obj, obj_created = Theme.objects.get_or_create(pk = '1', defaults = { 'active':obj_active })
|
|
||||||
|
|
||||||
if not obj.logo:
|
#get or create default theme and enforce default logo if deleted
|
||||||
obj.set_default_logo()
|
default_obj_active = (objs_active_qs.count() == 0)
|
||||||
|
default_obj, default_obj_created = Theme.objects.get_or_create(pk = '1', defaults = { 'active':default_obj_active })
|
||||||
|
|
||||||
if not obj_created and obj_active:
|
if not default_obj_created and default_obj_active:
|
||||||
obj.set_active(True)
|
default_obj.set_active()
|
||||||
|
|
||||||
|
if not default_obj.logo:
|
||||||
|
default_obj.set_default_logo()
|
||||||
|
|
||||||
|
obj = objs_active_qs.last()
|
||||||
|
objs_active_count = objs_active_qs.count()
|
||||||
|
|
||||||
|
if objs_active_count > 1:
|
||||||
|
obj.set_active()
|
||||||
|
|
||||||
|
return obj
|
||||||
|
|
||||||
return (obj, obj_created, )
|
|
||||||
|
|
||||||
name = models.CharField( max_length = 50, default = 'Django' )
|
name = models.CharField( max_length = 50, default = 'Django' )
|
||||||
active = models.BooleanField( default = True )
|
active = models.BooleanField( default = True )
|
||||||
@@ -72,23 +81,39 @@ class Theme(models.Model):
|
|||||||
|
|
||||||
css = models.TextField( blank = True )
|
css = models.TextField( blank = True )
|
||||||
|
|
||||||
list_filter_dropdown = models.BooleanField( default = False )
|
related_modal_active = models.BooleanField( default = True, verbose_name = 'active' )
|
||||||
|
related_modal_background_color = ColorField( blank = True, default = '#000000', help_text = '#000000', verbose_name = 'background color' )
|
||||||
|
related_modal_background_opacity_choices = (
|
||||||
|
(0.1, '10%', ),
|
||||||
|
(0.2, '20%', ),
|
||||||
|
(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.FloatField( choices = related_modal_background_opacity_choices, default = 0.2, help_text = '20%', verbose_name = 'background opacity' )
|
||||||
|
related_modal_rounded_corners = models.BooleanField( default = True, verbose_name = 'rounded corners' )
|
||||||
|
|
||||||
|
list_filter_dropdown = models.BooleanField( default = False, verbose_name = 'use dropdown' )
|
||||||
|
|
||||||
def set_active(self, value):
|
def set_active(self):
|
||||||
|
|
||||||
if value:
|
Theme.objects.exclude( pk = self.pk ).update( active = False )
|
||||||
Theme.objects.exclude(pk = self.pk).update(active = False)
|
|
||||||
Theme.objects.filter(pk = self.pk).update(active = True)
|
if not self.active:
|
||||||
else:
|
self.active = True
|
||||||
Theme.objects.filter(pk = self.pk).update(active = False)
|
self.save()
|
||||||
|
|
||||||
def set_default_logo(self):
|
def set_default_logo(self):
|
||||||
|
|
||||||
logo_path = os.path.normpath(os.path.dirname(__file__) + '/data/logo-django.svg')
|
logo_filename = 'logo-django.svg'
|
||||||
|
logo_path = os.path.normpath(os.path.dirname(__file__) + '/data/' + logo_filename)
|
||||||
logo_file = open(logo_path)
|
logo_file = open(logo_path)
|
||||||
|
|
||||||
self.logo = File(logo_file)
|
self.logo = File(logo_file, logo_filename)
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
logo_file.close()
|
logo_file.close()
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/*global opener */
|
||||||
|
(function() {
|
||||||
|
'use strict';
|
||||||
|
var windowRef = window;
|
||||||
|
var windowName = windowRef.name;
|
||||||
|
var widgetName = windowName.replace(/^(change|add|delete|lookup)_/, '');
|
||||||
|
//var windowNames = windowName.split('____');
|
||||||
|
//var widgetName = windowNames[(windowNames.length - 1)];
|
||||||
|
//widgetName = widgetName.replace(/^(change|add|delete|lookup)_/, '');
|
||||||
|
//console.log('dismiss modal and update widget with id: "' + widgetName + '"');
|
||||||
|
var modalRef = {};
|
||||||
|
var openerRef = windowRef.opener;
|
||||||
|
if(!openerRef){
|
||||||
|
openerRef = windowRef.parent;
|
||||||
|
modalRef = {
|
||||||
|
name: openerRef.id_to_windowname(widgetName),
|
||||||
|
close: function(){
|
||||||
|
openerRef.dismissRelatedObjectModal();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
var initData = JSON.parse(document.getElementById('django-admin-popup-response-constants').dataset.popupResponse);
|
||||||
|
switch(initData.action){
|
||||||
|
case 'change':
|
||||||
|
openerRef.dismissChangeRelatedObjectPopup(modalRef, initData.value, initData.obj, initData.new_value);
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
openerRef.dismissDeleteRelatedObjectPopup(modalRef, initData.value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
openerRef.dismissAddRelatedObjectPopup(modalRef, initData.value, initData.obj);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
+1864
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,351 @@
|
|||||||
|
/* Magnific Popup CSS */
|
||||||
|
.mfp-bg {
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 1042;
|
||||||
|
overflow: hidden;
|
||||||
|
position: fixed;
|
||||||
|
background: #0b0b0b;
|
||||||
|
opacity: 0.8; }
|
||||||
|
|
||||||
|
.mfp-wrap {
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 1043;
|
||||||
|
position: fixed;
|
||||||
|
outline: none !important;
|
||||||
|
-webkit-backface-visibility: hidden; }
|
||||||
|
|
||||||
|
.mfp-container {
|
||||||
|
text-align: center;
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
padding: 0 8px;
|
||||||
|
box-sizing: border-box; }
|
||||||
|
|
||||||
|
.mfp-container:before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
height: 100%;
|
||||||
|
vertical-align: middle; }
|
||||||
|
|
||||||
|
.mfp-align-top .mfp-container:before {
|
||||||
|
display: none; }
|
||||||
|
|
||||||
|
.mfp-content {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin: 0 auto;
|
||||||
|
text-align: left;
|
||||||
|
z-index: 1045; }
|
||||||
|
|
||||||
|
.mfp-inline-holder .mfp-content,
|
||||||
|
.mfp-ajax-holder .mfp-content {
|
||||||
|
width: 100%;
|
||||||
|
cursor: auto; }
|
||||||
|
|
||||||
|
.mfp-ajax-cur {
|
||||||
|
cursor: progress; }
|
||||||
|
|
||||||
|
.mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
|
||||||
|
cursor: -moz-zoom-out;
|
||||||
|
cursor: -webkit-zoom-out;
|
||||||
|
cursor: zoom-out; }
|
||||||
|
|
||||||
|
.mfp-zoom {
|
||||||
|
cursor: pointer;
|
||||||
|
cursor: -webkit-zoom-in;
|
||||||
|
cursor: -moz-zoom-in;
|
||||||
|
cursor: zoom-in; }
|
||||||
|
|
||||||
|
.mfp-auto-cursor .mfp-content {
|
||||||
|
cursor: auto; }
|
||||||
|
|
||||||
|
.mfp-close,
|
||||||
|
.mfp-arrow,
|
||||||
|
.mfp-preloader,
|
||||||
|
.mfp-counter {
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
user-select: none; }
|
||||||
|
|
||||||
|
.mfp-loading.mfp-figure {
|
||||||
|
display: none; }
|
||||||
|
|
||||||
|
.mfp-hide {
|
||||||
|
display: none !important; }
|
||||||
|
|
||||||
|
.mfp-preloader {
|
||||||
|
color: #CCC;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
width: auto;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: -0.8em;
|
||||||
|
left: 8px;
|
||||||
|
right: 8px;
|
||||||
|
z-index: 1044; }
|
||||||
|
.mfp-preloader a {
|
||||||
|
color: #CCC; }
|
||||||
|
.mfp-preloader a:hover {
|
||||||
|
color: #FFF; }
|
||||||
|
|
||||||
|
.mfp-s-ready .mfp-preloader {
|
||||||
|
display: none; }
|
||||||
|
|
||||||
|
.mfp-s-error .mfp-content {
|
||||||
|
display: none; }
|
||||||
|
|
||||||
|
button.mfp-close,
|
||||||
|
button.mfp-arrow {
|
||||||
|
overflow: visible;
|
||||||
|
cursor: pointer;
|
||||||
|
background: transparent;
|
||||||
|
border: 0;
|
||||||
|
-webkit-appearance: none;
|
||||||
|
display: block;
|
||||||
|
outline: none;
|
||||||
|
padding: 0;
|
||||||
|
z-index: 1046;
|
||||||
|
box-shadow: none;
|
||||||
|
touch-action: manipulation; }
|
||||||
|
|
||||||
|
button::-moz-focus-inner {
|
||||||
|
padding: 0;
|
||||||
|
border: 0; }
|
||||||
|
|
||||||
|
.mfp-close {
|
||||||
|
width: 44px;
|
||||||
|
height: 44px;
|
||||||
|
line-height: 44px;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
text-decoration: none;
|
||||||
|
text-align: center;
|
||||||
|
opacity: 0.65;
|
||||||
|
padding: 0 0 18px 10px;
|
||||||
|
color: #FFF;
|
||||||
|
font-style: normal;
|
||||||
|
font-size: 28px;
|
||||||
|
font-family: Arial, Baskerville, monospace; }
|
||||||
|
.mfp-close:hover,
|
||||||
|
.mfp-close:focus {
|
||||||
|
opacity: 1; }
|
||||||
|
.mfp-close:active {
|
||||||
|
top: 1px; }
|
||||||
|
|
||||||
|
.mfp-close-btn-in .mfp-close {
|
||||||
|
color: #333; }
|
||||||
|
|
||||||
|
.mfp-image-holder .mfp-close,
|
||||||
|
.mfp-iframe-holder .mfp-close {
|
||||||
|
color: #FFF;
|
||||||
|
right: -6px;
|
||||||
|
text-align: right;
|
||||||
|
padding-right: 6px;
|
||||||
|
width: 100%; }
|
||||||
|
|
||||||
|
.mfp-counter {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
color: #CCC;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 18px;
|
||||||
|
white-space: nowrap; }
|
||||||
|
|
||||||
|
.mfp-arrow {
|
||||||
|
position: absolute;
|
||||||
|
opacity: 0.65;
|
||||||
|
margin: 0;
|
||||||
|
top: 50%;
|
||||||
|
margin-top: -55px;
|
||||||
|
padding: 0;
|
||||||
|
width: 90px;
|
||||||
|
height: 110px;
|
||||||
|
-webkit-tap-highlight-color: transparent; }
|
||||||
|
.mfp-arrow:active {
|
||||||
|
margin-top: -54px; }
|
||||||
|
.mfp-arrow:hover,
|
||||||
|
.mfp-arrow:focus {
|
||||||
|
opacity: 1; }
|
||||||
|
.mfp-arrow:before,
|
||||||
|
.mfp-arrow:after {
|
||||||
|
content: '';
|
||||||
|
display: block;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
margin-top: 35px;
|
||||||
|
margin-left: 35px;
|
||||||
|
border: medium inset transparent; }
|
||||||
|
.mfp-arrow:after {
|
||||||
|
border-top-width: 13px;
|
||||||
|
border-bottom-width: 13px;
|
||||||
|
top: 8px; }
|
||||||
|
.mfp-arrow:before {
|
||||||
|
border-top-width: 21px;
|
||||||
|
border-bottom-width: 21px;
|
||||||
|
opacity: 0.7; }
|
||||||
|
|
||||||
|
.mfp-arrow-left {
|
||||||
|
left: 0; }
|
||||||
|
.mfp-arrow-left:after {
|
||||||
|
border-right: 17px solid #FFF;
|
||||||
|
margin-left: 31px; }
|
||||||
|
.mfp-arrow-left:before {
|
||||||
|
margin-left: 25px;
|
||||||
|
border-right: 27px solid #3F3F3F; }
|
||||||
|
|
||||||
|
.mfp-arrow-right {
|
||||||
|
right: 0; }
|
||||||
|
.mfp-arrow-right:after {
|
||||||
|
border-left: 17px solid #FFF;
|
||||||
|
margin-left: 39px; }
|
||||||
|
.mfp-arrow-right:before {
|
||||||
|
border-left: 27px solid #3F3F3F; }
|
||||||
|
|
||||||
|
.mfp-iframe-holder {
|
||||||
|
padding-top: 40px;
|
||||||
|
padding-bottom: 40px; }
|
||||||
|
.mfp-iframe-holder .mfp-content {
|
||||||
|
line-height: 0;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 900px; }
|
||||||
|
.mfp-iframe-holder .mfp-close {
|
||||||
|
top: -40px; }
|
||||||
|
|
||||||
|
.mfp-iframe-scaler {
|
||||||
|
width: 100%;
|
||||||
|
height: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
padding-top: 56.25%; }
|
||||||
|
.mfp-iframe-scaler iframe {
|
||||||
|
position: absolute;
|
||||||
|
display: block;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
||||||
|
background: #000; }
|
||||||
|
|
||||||
|
/* Main image in popup */
|
||||||
|
img.mfp-img {
|
||||||
|
width: auto;
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
display: block;
|
||||||
|
line-height: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 40px 0 40px;
|
||||||
|
margin: 0 auto; }
|
||||||
|
|
||||||
|
/* The shadow behind the image */
|
||||||
|
.mfp-figure {
|
||||||
|
line-height: 0; }
|
||||||
|
.mfp-figure:after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 40px;
|
||||||
|
bottom: 40px;
|
||||||
|
display: block;
|
||||||
|
right: 0;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
z-index: -1;
|
||||||
|
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
||||||
|
background: #444; }
|
||||||
|
.mfp-figure small {
|
||||||
|
color: #BDBDBD;
|
||||||
|
display: block;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 14px; }
|
||||||
|
.mfp-figure figure {
|
||||||
|
margin: 0; }
|
||||||
|
|
||||||
|
.mfp-bottom-bar {
|
||||||
|
margin-top: -36px;
|
||||||
|
position: absolute;
|
||||||
|
top: 100%;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
cursor: auto; }
|
||||||
|
|
||||||
|
.mfp-title {
|
||||||
|
text-align: left;
|
||||||
|
line-height: 18px;
|
||||||
|
color: #F3F3F3;
|
||||||
|
word-wrap: break-word;
|
||||||
|
padding-right: 36px; }
|
||||||
|
|
||||||
|
.mfp-image-holder .mfp-content {
|
||||||
|
max-width: 100%; }
|
||||||
|
|
||||||
|
.mfp-gallery .mfp-image-holder .mfp-figure {
|
||||||
|
cursor: pointer; }
|
||||||
|
|
||||||
|
@media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) {
|
||||||
|
/**
|
||||||
|
* Remove all paddings around the image on small screen
|
||||||
|
*/
|
||||||
|
.mfp-img-mobile .mfp-image-holder {
|
||||||
|
padding-left: 0;
|
||||||
|
padding-right: 0; }
|
||||||
|
.mfp-img-mobile img.mfp-img {
|
||||||
|
padding: 0; }
|
||||||
|
.mfp-img-mobile .mfp-figure:after {
|
||||||
|
top: 0;
|
||||||
|
bottom: 0; }
|
||||||
|
.mfp-img-mobile .mfp-figure small {
|
||||||
|
display: inline;
|
||||||
|
margin-left: 5px; }
|
||||||
|
.mfp-img-mobile .mfp-bottom-bar {
|
||||||
|
background: rgba(0, 0, 0, 0.6);
|
||||||
|
bottom: 0;
|
||||||
|
margin: 0;
|
||||||
|
top: auto;
|
||||||
|
padding: 3px 5px;
|
||||||
|
position: fixed;
|
||||||
|
box-sizing: border-box; }
|
||||||
|
.mfp-img-mobile .mfp-bottom-bar:empty {
|
||||||
|
padding: 0; }
|
||||||
|
.mfp-img-mobile .mfp-counter {
|
||||||
|
right: 5px;
|
||||||
|
top: 3px; }
|
||||||
|
.mfp-img-mobile .mfp-close {
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 35px;
|
||||||
|
height: 35px;
|
||||||
|
line-height: 35px;
|
||||||
|
background: rgba(0, 0, 0, 0.6);
|
||||||
|
position: fixed;
|
||||||
|
text-align: center;
|
||||||
|
padding: 0; } }
|
||||||
|
|
||||||
|
@media all and (max-width: 900px) {
|
||||||
|
.mfp-arrow {
|
||||||
|
-webkit-transform: scale(0.75);
|
||||||
|
transform: scale(0.75); }
|
||||||
|
.mfp-arrow-left {
|
||||||
|
-webkit-transform-origin: 0;
|
||||||
|
transform-origin: 0; }
|
||||||
|
.mfp-arrow-right {
|
||||||
|
-webkit-transform-origin: 100%;
|
||||||
|
transform-origin: 100%; }
|
||||||
|
.mfp-container {
|
||||||
|
padding-left: 6px;
|
||||||
|
padding-right: 6px; } }
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
if(typeof django !== 'undefined' && typeof django.jQuery !== 'undefined' )
|
||||||
|
{
|
||||||
|
(function($) {
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
// create the function that will close the modal
|
||||||
|
function dismissRelatedObjectModal()
|
||||||
|
{
|
||||||
|
// close the popup
|
||||||
|
$.magnificPopup.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
// assign the function to a global variable
|
||||||
|
window.dismissRelatedObjectModal = dismissRelatedObjectModal;
|
||||||
|
|
||||||
|
// listen click events on related links
|
||||||
|
// (:link prevents to listen click event if href is not defined)
|
||||||
|
$('a.related-widget-wrapper-link:link').click(function(e){
|
||||||
|
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
// remove focus from clicked link
|
||||||
|
$(this).blur();
|
||||||
|
|
||||||
|
// use the clicked link id as iframe name
|
||||||
|
// it will be available as window.name in the loaded iframe
|
||||||
|
var iframeName = $(this).attr('id');
|
||||||
|
//var iframeName = String(window.name + '____' + $(this).attr('id'));
|
||||||
|
//console.log('open modal with name: "' + iframeName + '"');
|
||||||
|
|
||||||
|
// browsers stop loading nested iframes having the same src url
|
||||||
|
// create a random parameter and append it to the src url to prevent it
|
||||||
|
var iframeSrcRandom = String(Math.round(Math.random() * 999999));
|
||||||
|
var iframeSrc = $(this).attr('href') + '&_modal=' + iframeSrcRandom;
|
||||||
|
|
||||||
|
// build the iframe html
|
||||||
|
//var iframeHTML = '<iframe id="related-modal" name="' + iframeName + '" src="' + iframeSrc + '"></iframe>';
|
||||||
|
var iframeHTML = '<iframe id="related-modal-iframe" name="' + iframeName + '" src="' + iframeSrc + '"></iframe>';
|
||||||
|
|
||||||
|
// create the iframe jquery element
|
||||||
|
var iframeEl = $(iframeHTML);
|
||||||
|
|
||||||
|
// the modal css class
|
||||||
|
var iframeInternalModalClass = 'related-modal';
|
||||||
|
|
||||||
|
// if the current window is inside an iframe, it means that it is already in a modal,
|
||||||
|
// append an additional css class to the modal to offer more customization
|
||||||
|
if( window.top != window.self )
|
||||||
|
{
|
||||||
|
iframeInternalModalClass += ' related-modal__nested';
|
||||||
|
}
|
||||||
|
|
||||||
|
// open the popup using magnific popup
|
||||||
|
$.magnificPopup.open({
|
||||||
|
mainClass: iframeInternalModalClass,
|
||||||
|
items: {
|
||||||
|
src: iframeEl,
|
||||||
|
type: 'inline'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
})(django.jQuery);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,12 +1,15 @@
|
|||||||
{% extends "admin/base.html" %}
|
{% extends "admin/base.html" %}
|
||||||
{% load i18n staticfiles admin_interface_tags %}
|
{% load i18n staticfiles admin_interface_tags %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
{% get_admin_interface_theme as theme %}
|
||||||
|
{% if theme.title %}{% trans theme.title %}{% else %}{% trans 'Django administration' %}{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block extrastyle %}
|
{% block extrastyle %}
|
||||||
{% get_admin_interface_theme as theme %}
|
{% get_admin_interface_theme as theme %}
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
|
||||||
{% if theme.active %}
|
|
||||||
|
|
||||||
#header {
|
#header {
|
||||||
height:auto;
|
height:auto;
|
||||||
min-height:40px;
|
min-height:40px;
|
||||||
@@ -65,8 +68,9 @@
|
|||||||
color:{{ theme.css_module_link_color }};
|
color:{{ theme.css_module_link_color }};
|
||||||
}
|
}
|
||||||
|
|
||||||
div.breadcrumbs a:hover,
|
div.breadcrumbs a:active,
|
||||||
div.breadcrumbs a:active {
|
div.breadcrumbs a:focus,
|
||||||
|
div.breadcrumbs a:hover {
|
||||||
color:{{ theme.css_module_link_hover_color }} !important;
|
color:{{ theme.css_module_link_hover_color }} !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,8 +100,6 @@
|
|||||||
color:{{ theme.css_module_link_hover_color }} !important;
|
color:{{ theme.css_module_link_hover_color }} !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.inline-group h2,
|
|
||||||
.inline-group h2 {
|
.inline-group h2 {
|
||||||
background:{{ theme.css_module_background_color }};
|
background:{{ theme.css_module_background_color }};
|
||||||
color:{{ theme.css_module_text_color }};
|
color:{{ theme.css_module_text_color }};
|
||||||
@@ -122,20 +124,25 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.button:active, input[type=submit]:active, input[type=button]:active,
|
.button:active, input[type=submit]:active, input[type=button]:active,
|
||||||
|
.button:focus, input[type=submit]:focus, input[type=button]:focus,
|
||||||
.button:hover, input[type=submit]:hover, input[type=button]:hover {
|
.button:hover, input[type=submit]:hover, input[type=button]:hover {
|
||||||
background:{{ theme.css_save_button_background_hover_color }};
|
background:{{ theme.css_save_button_background_hover_color }};
|
||||||
color:{{ theme.css_save_button_text_color }};
|
color:{{ theme.css_save_button_text_color }};
|
||||||
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button.default, input[type=submit].default, .submit-row input.default {
|
.button.default, input[type=submit].default, .submit-row input.default {
|
||||||
background:{{ theme.css_save_button_background_color }};
|
background:{{ theme.css_save_button_background_color }};
|
||||||
color:{{ theme.css_save_button_text_color }};
|
color:{{ theme.css_save_button_text_color }};
|
||||||
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button.default:active, input[type=submit].default:active,
|
.button.default:active, input[type=submit].default:active,
|
||||||
|
.button.default:focus, input[type=submit].default:focus,
|
||||||
.button.default:hover, input[type=submit].default:hover {
|
.button.default:hover, input[type=submit].default:hover {
|
||||||
background:{{ theme.css_save_button_background_hover_color }};
|
background:{{ theme.css_save_button_background_hover_color }};
|
||||||
color:{{ theme.css_save_button_text_color }};
|
color:{{ theme.css_save_button_text_color }};
|
||||||
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.submit-row a.deletelink:link,
|
.submit-row a.deletelink:link,
|
||||||
@@ -220,9 +227,22 @@
|
|||||||
min-width:320px !important;
|
min-width:320px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.login #content {
|
||||||
|
padding:10px 30px 10px 30px !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* same lateral padding as in logged view */
|
/* same lateral padding as in logged view */
|
||||||
.login #header {
|
.login #header {
|
||||||
padding:10px 25px !important;
|
padding:15px 30px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login #branding h1 {
|
||||||
|
margin-right:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login #branding h1 img.logo {
|
||||||
|
max-width:100%;
|
||||||
|
margin-right:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* login button right aligned */
|
/* login button right aligned */
|
||||||
@@ -237,7 +257,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* top-right buttons color on hover -> just a lighten grey */
|
/* top-right buttons color on hover -> just a lighten grey */
|
||||||
|
.object-tools a:focus,
|
||||||
.object-tools a:hover,
|
.object-tools a:hover,
|
||||||
|
.object-tools li:focus a,
|
||||||
.object-tools li:hover a {
|
.object-tools li:hover a {
|
||||||
background-color:#AAAAAA;
|
background-color:#AAAAAA;
|
||||||
}
|
}
|
||||||
@@ -264,6 +286,16 @@
|
|||||||
padding-left:10px !important;
|
padding-left:10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
form .aligned.wide p.help,
|
||||||
|
form .aligned.wide ul.error-list,
|
||||||
|
form .aligned.wide ul.errorlist {
|
||||||
|
margin-left: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
form .aligned.wide div.help {
|
||||||
|
margin-left: 210px;
|
||||||
|
}
|
||||||
|
|
||||||
textarea.tinymce ~ p.help {
|
textarea.tinymce ~ p.help {
|
||||||
margin-top:5px !important;
|
margin-top:5px !important;
|
||||||
}
|
}
|
||||||
@@ -272,15 +304,38 @@
|
|||||||
display:table;
|
display:table;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fix lateral padding to align text with field labels */
|
/* begin fix issue #13 - Datetime widget broken in long inlines */
|
||||||
|
p.datetime {
|
||||||
|
white-space:nowrap;
|
||||||
|
}
|
||||||
|
/* end fix */
|
||||||
|
|
||||||
|
/* begin fix lateral padding to align text with field labels */
|
||||||
.module h2,
|
.module h2,
|
||||||
.dashboard .module caption,
|
.dashboard .module caption,
|
||||||
.inline-group h2,
|
|
||||||
.module.filtered h2,
|
.module.filtered h2,
|
||||||
.inline-group h2 {
|
.inline-group h2 {
|
||||||
padding:8px 10px;
|
padding-left:10px;
|
||||||
{% if theme.css_module_rounded_corners %}border-radius:4px;{% endif %}
|
padding-right:10px;
|
||||||
}
|
}
|
||||||
|
/* end fix */
|
||||||
|
|
||||||
|
/* begin fix issue #11 - Inline border bottom should not be rounded */
|
||||||
|
.module h2,
|
||||||
|
.dashboard .module caption,
|
||||||
|
.module.filtered h2 {
|
||||||
|
{% if theme.css_module_rounded_corners %}
|
||||||
|
border-radius:4px;
|
||||||
|
{% endif %}
|
||||||
|
}
|
||||||
|
|
||||||
|
.inline-group h2 {
|
||||||
|
{% if theme.css_module_rounded_corners %}
|
||||||
|
border-bottom-left-radius:0;
|
||||||
|
border-bottom-right-radius:0;
|
||||||
|
{% endif %}
|
||||||
|
}
|
||||||
|
/* end fix */
|
||||||
|
|
||||||
.module.filtered h2 {
|
.module.filtered h2 {
|
||||||
border-bottom-left-radius:0;
|
border-bottom-left-radius:0;
|
||||||
@@ -292,6 +347,11 @@
|
|||||||
border-bottom-right-radius:4px;
|
border-bottom-right-radius:4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.module.filtered #changelist-filter h2 {
|
||||||
|
font-size: 11px;
|
||||||
|
padding: 10px 15px;
|
||||||
|
}
|
||||||
|
|
||||||
.module.filtered #changelist-filter select {
|
.module.filtered #changelist-filter select {
|
||||||
background-color:#ffffff;
|
background-color:#ffffff;
|
||||||
}
|
}
|
||||||
@@ -302,7 +362,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#content-related {
|
#content-related {
|
||||||
{% if theme.css_module_rounded_corners %}border-radius:4px;{% endif %}
|
{% if theme.css_module_rounded_corners %}
|
||||||
|
border-radius:4px;
|
||||||
|
{% endif %}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* selector chooseall / clearall color on hover -> just a lighten grey */
|
/* selector chooseall / clearall color on hover -> just a lighten grey */
|
||||||
@@ -310,29 +372,41 @@
|
|||||||
color:#888888 !important;
|
color:#888888 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.inline-group {
|
||||||
|
overflow-x:auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* begin fix issue #10 - Related widget broken in long tabular inline */
|
||||||
|
.inline-group .tabular .related-widget-wrapper {
|
||||||
|
white-space:nowrap;
|
||||||
|
}
|
||||||
|
/* end fix */
|
||||||
|
|
||||||
.inline-related h3 {
|
.inline-related h3 {
|
||||||
padding:6px 10px !important;
|
padding:6px 10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* begin fix issue #12 - Inlines bad delete buttons alignement */
|
||||||
.inline-group .tabular thead th:last-child:not([class]):not([style]) {
|
.inline-group .tabular thead th:last-child:not([class]):not([style]) {
|
||||||
text-align:center;
|
text-align:right;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
/*.inline-group .tabular tr.has_original td.original, */
|
|
||||||
.inline-group .tabular tr td.delete {
|
.inline-group .tabular tr td.delete {
|
||||||
vertical-align:middle !important;
|
text-align:right;
|
||||||
text-align:center !important;
|
padding-right:15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inline-group .tabular tr td.delete a.inline-deletelink {
|
.inline-group .tabular tr td.delete a.inline-deletelink {
|
||||||
float:none;
|
margin-top:2px;
|
||||||
display:inline-block;
|
overflow:hidden;
|
||||||
|
text-indent:9999px;
|
||||||
}
|
}
|
||||||
|
/* end fix */
|
||||||
|
|
||||||
/* improve django-modeltranslation support - https://github.com/deschler/django-modeltranslation/pull/313/commits */
|
/*
|
||||||
|
django-modeltranslation support
|
||||||
|
https://github.com/deschler/django-modeltranslation/pull/313/commits
|
||||||
|
*/
|
||||||
#content h1 select {
|
#content h1 select {
|
||||||
text-transform:uppercase;
|
text-transform:uppercase;
|
||||||
margin-left:15px;
|
margin-left:15px;
|
||||||
@@ -355,7 +429,6 @@
|
|||||||
|
|
||||||
padding:7px 14px 8px 14px !important;
|
padding:7px 14px 8px 14px !important;
|
||||||
margin-top:1px !important;
|
margin-top:1px !important;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active a,
|
.ui-tabs .ui-tabs-nav li.ui-tabs-active a,
|
||||||
@@ -396,6 +469,9 @@
|
|||||||
border-bottom:1px solid #fcfcfc !important;
|
border-bottom:1px solid #fcfcfc !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
list-filter-dropdown
|
||||||
|
*/
|
||||||
.list-filter-dropdown {
|
.list-filter-dropdown {
|
||||||
margin-top:10px;
|
margin-top:10px;
|
||||||
margin-bottom:20px;
|
margin-bottom:20px;
|
||||||
@@ -407,8 +483,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ckeditor + light theme - https://github.com/Ikimea/ckeditor-light-theme */
|
/*
|
||||||
|
sorl-thumbnail - improved AdminImageMixin widget layout
|
||||||
|
https://github.com/mariocesar/sorl-thumbnail
|
||||||
|
*/
|
||||||
|
a.thumbnail + input[type="checkbox"] {
|
||||||
|
margin:10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
ckeditor + light theme
|
||||||
|
https://github.com/Ikimea/ckeditor-light-theme
|
||||||
|
*/
|
||||||
.cke_inner, .cke_wysiwyg_frame {
|
.cke_inner, .cke_wysiwyg_frame {
|
||||||
border-top-left-radius: 4px !important;
|
border-top-left-radius: 4px !important;
|
||||||
border-top-right-radius: 4px !important;
|
border-top-right-radius: 4px !important;
|
||||||
@@ -453,41 +539,101 @@
|
|||||||
border-color: transparent #999 transparent transparent !important;
|
border-color: transparent #999 transparent transparent !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
related modal + magnific popup customization
|
||||||
|
https://github.com/dimsemenov/Magnific-Popup
|
||||||
|
*/
|
||||||
|
.related-modal.mfp-bg {
|
||||||
|
background-color:{{ theme.related_modal_background_color }} !important;
|
||||||
|
opacity: {{ theme.related_modal_background_opacity }} !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.related-modal .mfp-content {
|
||||||
|
height: 100% !important;
|
||||||
|
overflow: hidden;
|
||||||
|
{% if theme.related_modal_rounded_corners %}
|
||||||
|
border-radius: 4px;
|
||||||
|
{% endif %}
|
||||||
|
-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);
|
||||||
|
box-shadow: 0px 5px 30px 0px rgba(0,0,0,0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.related-modal .mfp-container {
|
||||||
|
padding: 90px 90px 90px 90px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.related-modal__nested .mfp-container {
|
||||||
|
padding: 30px 60px 30px 60px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width:640px){
|
||||||
|
.related-modal .mfp-container {
|
||||||
|
padding: 60px 15px 60px 15px !important;
|
||||||
|
}
|
||||||
|
.related-modal__nested .mfp-container {
|
||||||
|
padding: 30px 30px 30px 30px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.related-modal #related-modal-iframe {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center center;
|
||||||
|
background-size: 30px 30px;
|
||||||
|
background-image: url("data:image/svg+xml;utf8,<?xml version='1.0' encoding='utf-8'?><svg width='30px' height='30px' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='xMidYMid' class='uil-ring-alt'><rect x='0' y='0' width='100' height='100' fill='none' class='bk'></rect><circle cx='50' cy='50' r='40' stroke='#eeeeee' fill='none' stroke-width='6' stroke-linecap='round'></circle><circle cx='50' cy='50' r='40' stroke='#aaaaaa' fill='none' stroke-width='6' stroke-linecap='round'><animate attributeName='stroke-dashoffset' dur='2s' repeatCount='indefinite' from='0' to='500'></animate><animate attributeName='stroke-dasharray' dur='2s' repeatCount='indefinite' values='150 100;1 250;150 100'></animate></circle></svg>");
|
||||||
|
border: none;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
{% if theme.css %}
|
{% if theme.css %}
|
||||||
{{ theme.css|safe }}
|
{{ theme.css|safe }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% else %}
|
|
||||||
|
|
||||||
#branding h1 img.logo {
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block extrahead %}
|
{% block extrahead %}
|
||||||
|
{{ block.super }}
|
||||||
|
<link rel="stylesheet" type="text/css" href="{% static "admin/css/responsive.css" %}" />
|
||||||
|
{% get_admin_interface_theme as theme %}
|
||||||
|
{% if theme.related_modal_active %}
|
||||||
|
<link rel="stylesheet" type="text/css" href="{% static "admin_interface/magnific-popup/magnific-popup.css" %}" />
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block branding %}
|
{% block branding %}
|
||||||
{% get_admin_interface_theme as theme %}
|
{% get_admin_interface_theme as theme %}
|
||||||
<h1 id="site-name">
|
<h1 id="site-name">
|
||||||
{% if theme.active %}
|
{% if theme.logo_visible and theme.logo %}
|
||||||
{% if theme.logo_visible and theme.logo %}
|
<img class="logo" src="{{ theme.logo.url }}" width="{{ theme.logo.width }}" height="{{ theme.logo.height }}" />
|
||||||
<img class="logo" src="{{ theme.logo.url }}" width="{{ theme.logo.width }}" height="{{ theme.logo.height }}" />
|
{% endif %}
|
||||||
{% endif %}
|
{% if theme.title_visible %}
|
||||||
{% if theme.title_visible %}
|
<span>{% if theme.title %}{% trans theme.title %}{% else %}{% trans 'Django administration' %}{% endif %}</span>
|
||||||
<span>{% if theme.title %}{% trans theme.title %}{% else %}{% trans 'Django administration' %}{% endif %}</span>
|
|
||||||
{% endif %}
|
|
||||||
{% else %}
|
|
||||||
{% trans 'Django administration' %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</h1>
|
</h1>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block bodyclass %}admin-interface flat-theme{% endblock %}
|
{% block bodyclass %}admin-interface flat-theme{% endblock %}
|
||||||
|
|
||||||
|
{% block blockbots %}
|
||||||
|
{{ block.super }}
|
||||||
|
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block sidebar %}
|
{% block sidebar %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block footer %}
|
||||||
|
{{ block.super }}
|
||||||
|
{% get_admin_interface_theme as theme %}
|
||||||
|
{% if theme.related_modal_active %}
|
||||||
|
<script type="text/javascript" src="{% static "admin_interface/magnific-popup/jquery.magnific-popup.js" %}"></script>
|
||||||
|
<script type="text/javascript" src="{% static "admin_interface/related-modal/related-modal.js" %}"></script>
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
@@ -8,11 +8,7 @@
|
|||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
{% comment %}
|
{# Use the default list filter template -> https://github.com/django/django/blob/master/django/contrib/admin/templates/admin/filter.html #}
|
||||||
|
|
||||||
Use the default list filter template -> https://github.com/django/django/blob/master/django/contrib/admin/templates/admin/filter.html
|
|
||||||
|
|
||||||
{% endcomment %}
|
|
||||||
|
|
||||||
<h3>{% blocktrans with filter_title=title %} By {{ filter_title }} {% endblocktrans %}</h3>
|
<h3>{% blocktrans with filter_title=title %} By {{ filter_title }} {% endblocktrans %}</h3>
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
@@ -11,15 +11,5 @@ register = template.Library()
|
|||||||
@register.assignment_tag(takes_context = True)
|
@register.assignment_tag(takes_context = True)
|
||||||
def get_admin_interface_theme(context):
|
def get_admin_interface_theme(context):
|
||||||
|
|
||||||
obj_qs = Theme.objects.filter(active = True)[:1]
|
return Theme.get_active_theme()
|
||||||
obj_ls = list(obj_qs)
|
|
||||||
obj = None
|
|
||||||
|
|
||||||
if len(obj_ls):
|
|
||||||
obj = obj_ls[0]
|
|
||||||
else:
|
|
||||||
obj = Theme.get_or_create_default_theme()
|
|
||||||
|
|
||||||
return obj
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
__version__ = '0.1.3'
|
__version__ = '0.4.0'
|
||||||
|
|
||||||
|
|||||||
Executable
+21
@@ -0,0 +1,21 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import django
|
||||||
|
from django.conf import settings
|
||||||
|
from django.test.utils import get_runner
|
||||||
|
|
||||||
|
|
||||||
|
def runtests():
|
||||||
|
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
|
||||||
|
django.setup()
|
||||||
|
TestRunner = get_runner(settings)
|
||||||
|
test_runner = TestRunner()
|
||||||
|
failures = test_runner.run_tests(['tests'])
|
||||||
|
sys.exit(bool(failures))
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
runtests()
|
||||||
|
|
||||||
@@ -1,25 +1,48 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
from setuptools import find_packages, setup
|
from setuptools import find_packages, setup
|
||||||
|
|
||||||
exec(open('admin_interface/version.py').read())
|
exec(open('admin_interface/version.py').read())
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='django-admin-interface',
|
name='django-admin-interface',
|
||||||
packages=find_packages(),
|
packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
license='MIT License',
|
|
||||||
version=__version__,
|
version=__version__,
|
||||||
description='django-admin-interface is a modern flat admin interface customizable by the admin itself.',
|
description='django-admin-interface is a modern responsive flat admin interface customizable by the admin itself.',
|
||||||
author='Fabio Caccamo',
|
author='Fabio Caccamo',
|
||||||
author_email='fabio.caccamo@gmail.com',
|
author_email='fabio.caccamo@gmail.com',
|
||||||
url='https://github.com/fabiocaccamo/django-admin-interface',
|
url='https://github.com/fabiocaccamo/django-admin-interface',
|
||||||
download_url='https://github.com/fabiocaccamo/django-admin-interface/archive/%s.tar.gz' % __version__,
|
download_url='https://github.com/fabiocaccamo/django-admin-interface/archive/%s.tar.gz' % __version__,
|
||||||
keywords=['django', 'admin', 'interface', 'ui', 'flat', 'theme', 'custom'],
|
keywords=['django', 'admin', 'interface', 'responsive', 'flat', 'theme', 'custom', 'ui'],
|
||||||
|
requires=['django(>=1.7)'],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'django-colorfield==0.1.10',
|
'django-colorfield==0.1.12',
|
||||||
'django-flat-theme==1.1.2'
|
'django-flat-theme==1.1.4',
|
||||||
|
'django-flat-responsive==1.3.0'
|
||||||
],
|
],
|
||||||
classifiers=[]
|
classifiers=[
|
||||||
|
'Development Status :: 5 - Production/Stable',
|
||||||
|
'Environment :: Web Environment',
|
||||||
|
'Framework :: Django',
|
||||||
|
'Framework :: Django :: 1.7',
|
||||||
|
'Framework :: Django :: 1.8',
|
||||||
|
'Framework :: Django :: 1.9',
|
||||||
|
'Framework :: Django :: 1.10',
|
||||||
|
'Framework :: Django :: 1.11',
|
||||||
|
'Intended Audience :: Developers',
|
||||||
|
'License :: OSI Approved :: MIT License',
|
||||||
|
'Natural Language :: English',
|
||||||
|
'Operating System :: OS Independent',
|
||||||
|
'Programming Language :: Python :: 2',
|
||||||
|
'Programming Language :: Python :: 2.7',
|
||||||
|
'Programming Language :: Python :: 3',
|
||||||
|
'Programming Language :: Python :: 3.4',
|
||||||
|
'Programming Language :: Python :: 3.5',
|
||||||
|
'Programming Language :: Python :: 3.6',
|
||||||
|
'Topic :: Software Development :: Build Tools',
|
||||||
|
],
|
||||||
|
license='MIT',
|
||||||
|
test_suite='runtests.runtests'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import django
|
||||||
|
import os
|
||||||
|
|
||||||
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
|
SECRET_KEY = 'django-admin-interface'
|
||||||
|
|
||||||
|
ALLOWED_HOSTS = ['*']
|
||||||
|
|
||||||
|
INSTALLED_APPS = [
|
||||||
|
|
||||||
|
'admin_interface',
|
||||||
|
'flat_responsive',
|
||||||
|
'flat', #if django version < 1.9
|
||||||
|
'colorfield',
|
||||||
|
|
||||||
|
'django.contrib.admin',
|
||||||
|
'django.contrib.auth',
|
||||||
|
'django.contrib.contenttypes',
|
||||||
|
'django.contrib.sessions',
|
||||||
|
]
|
||||||
|
|
||||||
|
MIDDLEWARE_CLASSES = [
|
||||||
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
|
'django.middleware.common.CommonMiddleware',
|
||||||
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||||
|
]
|
||||||
|
|
||||||
|
TEMPLATES = [{
|
||||||
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
|
'DIRS': [],
|
||||||
|
'APP_DIRS': True,
|
||||||
|
'OPTIONS': {
|
||||||
|
'context_processors': [
|
||||||
|
'django.contrib.auth.context_processors.auth',
|
||||||
|
]
|
||||||
|
},
|
||||||
|
},]
|
||||||
|
|
||||||
|
DATABASES = {
|
||||||
|
'default': {
|
||||||
|
'ENGINE': 'django.db.backends.sqlite3',
|
||||||
|
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'admin_interface/public/media/')
|
||||||
|
MEDIA_URL = '/media/'
|
||||||
|
|
||||||
|
STATIC_ROOT = os.path.join(BASE_DIR, 'admin_interface/public/static/')
|
||||||
|
STATIC_URL = '/static/'
|
||||||
|
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
from django.test import TestCase
|
||||||
|
from django.template import Context, Template
|
||||||
|
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
from admin_interface.models import Theme
|
||||||
|
|
||||||
|
|
||||||
|
class AdminInterfaceTestCase(TestCase):
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
shutil.rmtree(settings.MEDIA_ROOT, ignore_errors=True)
|
||||||
|
pass
|
||||||
|
|
||||||
|
def __render_template(self, string, context=None):
|
||||||
|
|
||||||
|
context = context or {}
|
||||||
|
context = Context(context)
|
||||||
|
return Template(string).render(context)
|
||||||
|
|
||||||
|
def __test_active_theme(self):
|
||||||
|
|
||||||
|
theme = Theme.get_active_theme()
|
||||||
|
print( theme )
|
||||||
|
self.assertTrue(theme != None)
|
||||||
|
self.assertTrue(theme.active)
|
||||||
|
self.assertEqual(Theme.objects.filter( active = True ).count(), 1);
|
||||||
|
|
||||||
|
def test_default_theme_created_if_no_themes(self):
|
||||||
|
|
||||||
|
Theme.objects.all().delete()
|
||||||
|
self.__test_active_theme()
|
||||||
|
|
||||||
|
def test_default_theme_created_if_all_themes_deleted(self):
|
||||||
|
|
||||||
|
Theme.objects.all().delete()
|
||||||
|
self.__test_active_theme()
|
||||||
|
|
||||||
|
def test_default_theme_activated_on_save_if_no_active_themes(self):
|
||||||
|
|
||||||
|
Theme.objects.all().delete()
|
||||||
|
theme = Theme.get_active_theme()
|
||||||
|
theme.active = False
|
||||||
|
theme.save()
|
||||||
|
self.__test_active_theme()
|
||||||
|
|
||||||
|
def test_default_theme_activated_after_update_if_no_active_themes(self):
|
||||||
|
|
||||||
|
Theme.objects.all().delete()
|
||||||
|
Theme.objects.all().update( active = False )
|
||||||
|
self.__test_active_theme()
|
||||||
|
|
||||||
|
def test_default_theme_activated_on_active_theme_deleted(self):
|
||||||
|
|
||||||
|
Theme.objects.all().delete()
|
||||||
|
theme_1 = Theme.objects.create( name = 'Custom 1', active = True )
|
||||||
|
theme_2 = Theme.objects.create( name = 'Custom 2', active = True )
|
||||||
|
theme_3 = Theme.objects.create( name = 'Custom 3', active = True )
|
||||||
|
Theme.objects.filter( pk = Theme.get_active_theme().pk ).delete()
|
||||||
|
self.assertEqual( Theme.get_active_theme().pk, 1 )
|
||||||
|
|
||||||
|
def test_last_theme_activated_on_multiple_themes_created(self):
|
||||||
|
|
||||||
|
Theme.objects.all().delete()
|
||||||
|
theme_1 = Theme.objects.create( name = 'Custom 1', active = True )
|
||||||
|
theme_2 = Theme.objects.create( name = 'Custom 2', active = True )
|
||||||
|
theme_3 = Theme.objects.create( name = 'Custom 3', active = True )
|
||||||
|
self.assertEqual( Theme.get_active_theme().pk, theme_3.pk )
|
||||||
|
self.__test_active_theme()
|
||||||
|
|
||||||
|
def test_templatetags(self):
|
||||||
|
|
||||||
|
Theme.objects.all().delete()
|
||||||
|
rendered = self.__render_template('{% load admin_interface_tags %}{% get_admin_interface_theme as theme %}{{ theme.name }}')
|
||||||
|
self.assertEqual(rendered, 'Django')
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
[tox]
|
||||||
|
envlist =
|
||||||
|
py27-{17,18,19,110,111},
|
||||||
|
py34-{17,18,19,110,111},
|
||||||
|
py35-{18,19,110,111},
|
||||||
|
py36-{18,19,110,111},
|
||||||
|
[testenv]
|
||||||
|
passenv = CI TRAVIS TRAVIS_*
|
||||||
|
deps =
|
||||||
|
17: Django >= 1.7, < 1.8
|
||||||
|
18: Django >= 1.8, < 1.9
|
||||||
|
19: Django >= 1.9, < 1.10
|
||||||
|
110: Django >= 1.10, < 1.11
|
||||||
|
111: Django >= 1.11, < 1.12
|
||||||
|
coverage
|
||||||
|
codecov
|
||||||
|
commands =
|
||||||
|
coverage run --append --source=admin_interface setup.py test
|
||||||
|
coverage report -m
|
||||||
|
codecov
|
||||||
Reference in New Issue
Block a user