Compare commits

...

30 Commits

Author SHA1 Message Date
Fabio Caccamo 54f120c9ba Updated version 2016-02-24 10:04:49 +01:00
Fabio Caccamo 816c05bebd Cleaned whitespace 2016-02-24 10:04:35 +01:00
Fabio Caccamo 710370e903 Fixed Django 1.9 support 2016-02-24 10:03:19 +01:00
Fabio Caccamo 10476e5675 Updated version 2016-02-15 16:21:27 +01:00
Fabio Caccamo bb5867460f Added django-flat-theme dependency 2016-02-15 16:21:16 +01:00
Fabio Caccamo 0ed341bdfd Cleaned white-space 2016-02-15 16:20:53 +01:00
Fabio Caccamo dd8a556d79 Fixed list filter selected link color 2016-02-15 16:20:35 +01:00
Fabio Caccamo f1c37feacb Improved fieldsets alignment and links colors 2016-02-15 16:01:28 +01:00
Fabio Caccamo 6b05143bcc Updated README.md 2015-12-03 11:53:47 +01:00
Fabio Caccamo 9f22ce4b70 Updated package description 2015-12-03 11:46:43 +01:00
Fabio Caccamo 12078589aa Updated version 2015-12-03 11:45:37 +01:00
Fabio Caccamo 98d7153b24 Added admin-interface and flat-theme body classes 2015-12-03 11:44:34 +01:00
Fabio Caccamo d702b0a328 Updated README.md 2015-11-26 11:25:07 +01:00
Fabio Caccamo 8bc899f107 Updated README.md 2015-11-26 11:24:44 +01:00
Fabio Caccamo 48a226ca9f Updated version 2015-11-25 19:27:06 +01:00
Fabio Caccamo 8752520ebe Fixed dashboard modules links color 2015-11-25 19:26:31 +01:00
Fabio Caccamo a006fef0e0 Removed duplicated css rules 2015-11-25 19:25:29 +01:00
Fabio Caccamo a18ec73656 Add migrations 2015-11-25 19:07:03 +01:00
Fabio Caccamo 40cf1daa84 Added .gitattributes 2015-11-19 11:04:47 +01:00
Fabio Caccamo 15ca13c98a Updated README.md 2015-11-18 12:44:04 +01:00
Fabio Caccamo 5b8ad7b04b Update README.md 2015-11-17 16:09:26 +01:00
Fabio Caccamo 690924df51 Updated README.md 2015-11-17 10:42:44 +01:00
Fabio Caccamo 7a57b35554 Updated README.md 2015-11-16 12:22:50 +01:00
Fabio Caccamo 6b92499395 Updated LICENSE.txt 2015-11-16 12:22:29 +01:00
Fabio Caccamo f38ca148e6 Updated README.md 2015-11-16 11:10:25 +01:00
Fabio Caccamo 01e7f05ca1 Updated README.md 2015-11-16 11:08:04 +01:00
Fabio Caccamo 385602ac5f Updated README.md 2015-11-16 11:07:15 +01:00
Fabio Caccamo e392341591 Updated README.md 2015-11-13 19:00:36 +01:00
Fabio Caccamo ea36322ca1 Updated README.md 2015-11-13 18:50:10 +01:00
Fabio Caccamo 4a45afed18 Updated README.md 2015-11-13 17:10:17 +01:00
12 changed files with 347 additions and 189 deletions
+1
View File
@@ -0,0 +1 @@
admin_interface/static/ckeditor/* linguist-vendored
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2015 Fabio Cacccamo - fabio.caccamo@gmail.com Copyright (c) 2015 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
+66 -1
View File
@@ -1 +1,66 @@
# django-admin-interface #django-admin-interface
django-admin-interface is a modern **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**.
##Requirements
- Python 2.6, Python 2.7
- Django 1.6.5 through Django 1.8.4
##Installation
- Run `pip install django-admin-interface`
- Add `admin_interface`, `flat` and `colorfield` to `settings.INSTALLED_APPS` **before** `django.contrib.admin`
```python
INSTALLED_APPS = (
#...
'flat',
'colorfield',
'admin_interface',
#...
'django.contrib.admin',
#...
)
```
- Run ``python manage.py migrate`` *(add ``--fake-initial`` if you are upgrading from 0.1.0 version)*
- Run ``python manage.py collectstatic``
- Restart your application server
##Screenshots
######Admin login
![django-admin-interface_login](https://cloud.githubusercontent.com/assets/1035294/11240233/55c8d4ba-8df1-11e5-9568-00fdc987ede8.gif)
---
######Admin dashboard
![django-admin-interface_dashboard](https://cloud.githubusercontent.com/assets/1035294/11240239/627c0362-8df1-11e5-81fa-216366a5d8da.gif)
---
######Admin themes management
![django-admin-interface_themes_management](https://cloud.githubusercontent.com/assets/1035294/11240245/6cd1c342-8df1-11e5-928b-f22217474d3d.gif)
---
######Admin theme customization
![django-admin-interface_theme_customization](https://cloud.githubusercontent.com/assets/1035294/11240250/7350d942-8df1-11e5-9b28-f2f54c333cdc.gif)
####Thanks
- [django-flat-theme](https://github.com/elky/django-flat-theme/)
- [django-colorfield](https://github.com/jaredly/django-colorfield/)
##License
The MIT License (MIT)
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.
+4 -4
View File
@@ -6,10 +6,10 @@ from admin_interface.models import Theme
class ThemeAdmin(admin.ModelAdmin): class ThemeAdmin(admin.ModelAdmin):
list_display = ('name', 'active', ) list_display = ('name', 'active', )
list_editable = ('active', ) list_editable = ('active', )
fieldsets = ( fieldsets = (
(None, { (None, {
'classes': ('wide', ), 'classes': ('wide', ),
@@ -48,8 +48,8 @@ class ThemeAdmin(admin.ModelAdmin):
'fields': ('list_filter_dropdown', ) 'fields': ('list_filter_dropdown', )
}), }),
) )
save_on_top = True save_on_top = True
admin.site.register(Theme, ThemeAdmin) admin.site.register(Theme, ThemeAdmin)
+5 -7
View File
@@ -3,16 +3,14 @@
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):
name = 'admin_interface' name = 'admin_interface'
verbose_name = 'Admin Interface' verbose_name = 'Admin Interface'
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)
@@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import colorfield.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Theme',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(default=b'Django', max_length=50)),
('active', models.BooleanField(default=True)),
('title', models.CharField(default=b'Django administration', max_length=50, blank=True)),
('title_visible', models.BooleanField(default=True, verbose_name=b'visible')),
('logo', models.FileField(upload_to=b'admin-interface/logo/', blank=True)),
('logo_visible', models.BooleanField(default=True, verbose_name=b'visible')),
('css_header_background_color', colorfield.fields.ColorField(default=b'#0C4B33', help_text=b'#0C4B33', max_length=10, verbose_name=b'background color', blank=True)),
('css_header_title_color', colorfield.fields.ColorField(default=b'#F5DD5D', help_text=b'#F5DD5D', max_length=10, verbose_name=b'title color', blank=True)),
('css_header_text_color', colorfield.fields.ColorField(default=b'#44B78B', help_text=b'#44B78B', max_length=10, verbose_name=b'text color', blank=True)),
('css_header_link_color', colorfield.fields.ColorField(default=b'#FFFFFF', help_text=b'#FFFFFF', max_length=10, verbose_name=b'link color', blank=True)),
('css_header_link_hover_color', colorfield.fields.ColorField(default=b'#C9F0DD', help_text=b'#C9F0DD', max_length=10, verbose_name=b'link hover color', blank=True)),
('css_module_background_color', colorfield.fields.ColorField(default=b'#44B78B', help_text=b'#44B78B', max_length=10, verbose_name=b'background color', blank=True)),
('css_module_text_color', colorfield.fields.ColorField(default=b'#FFFFFF', help_text=b'#FFFFFF', max_length=10, verbose_name=b'text color', blank=True)),
('css_module_link_color', colorfield.fields.ColorField(default=b'#FFFFFF', help_text=b'#FFFFFF', max_length=10, verbose_name=b'link color', blank=True)),
('css_module_link_hover_color', colorfield.fields.ColorField(default=b'#C9F0DD', help_text=b'#C9F0DD', max_length=10, verbose_name=b'link hover color', blank=True)),
('css_module_rounded_corners', models.BooleanField(default=True, verbose_name=b'rounded corners')),
('css_generic_link_color', colorfield.fields.ColorField(default=b'#0C3C26', help_text=b'#0C3C26', max_length=10, verbose_name=b'link color', blank=True)),
('css_generic_link_hover_color', colorfield.fields.ColorField(default=b'#156641', help_text=b'#156641', max_length=10, verbose_name=b'link hover color', blank=True)),
('css_save_button_background_color', colorfield.fields.ColorField(default=b'#0C4B33', help_text=b'#0C4B33', max_length=10, verbose_name=b'background color', blank=True)),
('css_save_button_background_hover_color', colorfield.fields.ColorField(default=b'#0C3C26', help_text=b'#0C3C26', max_length=10, verbose_name=b'background hover color', blank=True)),
('css_save_button_text_color', colorfield.fields.ColorField(default=b'#FFFFFF', help_text=b'#FFFFFF', max_length=10, verbose_name=b'text color', blank=True)),
('css_delete_button_background_color', colorfield.fields.ColorField(default=b'#BA2121', help_text=b'#BA2121', max_length=10, verbose_name=b'background color', blank=True)),
('css_delete_button_background_hover_color', colorfield.fields.ColorField(default=b'#A41515', help_text=b'#A41515', max_length=10, verbose_name=b'background hover color', blank=True)),
('css_delete_button_text_color', colorfield.fields.ColorField(default=b'#FFFFFF', help_text=b'#FFFFFF', max_length=10, verbose_name=b'text color', blank=True)),
('css', models.TextField(blank=True)),
('list_filter_dropdown', models.BooleanField(default=False)),
],
options={
'verbose_name': 'Theme',
'verbose_name_plural': 'Themes',
},
),
]
+32 -32
View File
@@ -10,101 +10,101 @@ import os
class Theme(models.Model): 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_or_create_default_theme()
@staticmethod @staticmethod
def post_delete_handler(instance, **kwargs): def post_delete_handler(instance, **kwargs):
Theme.get_or_create_default_theme() Theme.get_or_create_default_theme()
@staticmethod @staticmethod
def post_save_handler(instance, created, **kwargs): def post_save_handler(instance, created, **kwargs):
instance.set_active(instance.active) instance.set_active(instance.active)
Theme.get_or_create_default_theme() Theme.get_or_create_default_theme()
@staticmethod @staticmethod
def get_or_create_default_theme(): def get_or_create_default_theme():
obj_active = (True if len(list(Theme.objects.filter(active = True))) == 0 else False) obj_active = (True if len(list(Theme.objects.filter(active = True))) == 0 else False)
obj, obj_created = Theme.objects.get_or_create(pk = '1', defaults = { 'active':obj_active }) obj, obj_created = Theme.objects.get_or_create(pk = '1', defaults = { 'active':obj_active })
if not obj.logo: if not obj.logo:
obj.set_default_logo() obj.set_default_logo()
if not obj_created and obj_active: if not obj_created and obj_active:
obj.set_active(True) obj.set_active(True)
return (obj, obj_created, ) 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 )
title = models.CharField( max_length = 50, default = 'Django administration', blank = True ) title = models.CharField( max_length = 50, default = 'Django administration', blank = True )
title_visible = models.BooleanField( default = True, verbose_name = 'visible' ) title_visible = models.BooleanField( default = True, verbose_name = 'visible' )
logo = models.FileField( upload_to = 'admin-interface/logo/', blank = True ) logo = models.FileField( upload_to = 'admin-interface/logo/', blank = True )
logo_visible = models.BooleanField( default = True, verbose_name = 'visible' ) logo_visible = models.BooleanField( default = True, verbose_name = 'visible' )
css_header_background_color = ColorField( blank = True, default = '#0C4B33', help_text = '#0C4B33', verbose_name = 'background color' ) css_header_background_color = ColorField( blank = True, default = '#0C4B33', help_text = '#0C4B33', verbose_name = 'background color' )
css_header_title_color = ColorField( blank = True, default = '#F5DD5D', help_text = '#F5DD5D', verbose_name = 'title color' ) css_header_title_color = ColorField( blank = True, default = '#F5DD5D', help_text = '#F5DD5D', verbose_name = 'title color' )
css_header_text_color = ColorField( blank = True, default = '#44B78B', help_text = '#44B78B', verbose_name = 'text color' ) css_header_text_color = ColorField( blank = True, default = '#44B78B', help_text = '#44B78B', verbose_name = 'text color' )
css_header_link_color = ColorField( blank = True, default = '#FFFFFF', help_text = '#FFFFFF', verbose_name = 'link color' ) css_header_link_color = ColorField( blank = True, default = '#FFFFFF', help_text = '#FFFFFF', verbose_name = 'link color' )
css_header_link_hover_color = ColorField( blank = True, default = '#C9F0DD', help_text = '#C9F0DD', verbose_name = 'link hover color' ) css_header_link_hover_color = ColorField( blank = True, default = '#C9F0DD', help_text = '#C9F0DD', verbose_name = 'link hover color' )
css_module_background_color = ColorField( blank = True, default = '#44B78B', help_text = '#44B78B', verbose_name = 'background color' ) css_module_background_color = ColorField( blank = True, default = '#44B78B', help_text = '#44B78B', verbose_name = 'background color' )
css_module_text_color = ColorField( blank = True, default = '#FFFFFF', help_text = '#FFFFFF', verbose_name = 'text color' ) css_module_text_color = ColorField( blank = True, default = '#FFFFFF', help_text = '#FFFFFF', verbose_name = 'text color' )
css_module_link_color = ColorField( blank = True, default = '#FFFFFF', help_text = '#FFFFFF', verbose_name = 'link color' ) css_module_link_color = ColorField( blank = True, default = '#FFFFFF', help_text = '#FFFFFF', verbose_name = 'link color' )
css_module_link_hover_color = ColorField( blank = True, default = '#C9F0DD', help_text = '#C9F0DD', verbose_name = 'link hover color' ) css_module_link_hover_color = ColorField( blank = True, default = '#C9F0DD', help_text = '#C9F0DD', verbose_name = 'link hover color' )
css_module_rounded_corners = models.BooleanField( default = True, verbose_name = 'rounded corners' ) css_module_rounded_corners = models.BooleanField( default = True, verbose_name = 'rounded corners' )
css_generic_link_color = ColorField( blank = True, default = '#0C3C26', help_text = '#0C3C26', verbose_name = 'link color' ) css_generic_link_color = ColorField( blank = True, default = '#0C3C26', help_text = '#0C3C26', verbose_name = 'link color' )
css_generic_link_hover_color = ColorField( blank = True, default = '#156641', help_text = '#156641', verbose_name = 'link hover color' ) css_generic_link_hover_color = ColorField( blank = True, default = '#156641', help_text = '#156641', verbose_name = 'link hover color' )
css_save_button_background_color = ColorField( blank = True, default = '#0C4B33', help_text = '#0C4B33', verbose_name = 'background color' ) css_save_button_background_color = ColorField( blank = True, default = '#0C4B33', help_text = '#0C4B33', verbose_name = 'background color' )
css_save_button_background_hover_color = ColorField( blank = True, default = '#0C3C26', help_text = '#0C3C26', verbose_name = 'background hover color' ) css_save_button_background_hover_color = ColorField( blank = True, default = '#0C3C26', help_text = '#0C3C26', verbose_name = 'background hover color' )
css_save_button_text_color = ColorField( blank = True, default = '#FFFFFF', help_text = '#FFFFFF', verbose_name = 'text color' ) css_save_button_text_color = ColorField( blank = True, default = '#FFFFFF', help_text = '#FFFFFF', verbose_name = 'text color' )
css_delete_button_background_color = ColorField( blank = True, default = '#BA2121', help_text = '#BA2121', verbose_name = 'background color' ) css_delete_button_background_color = ColorField( blank = True, default = '#BA2121', help_text = '#BA2121', verbose_name = 'background color' )
css_delete_button_background_hover_color = ColorField( blank = True, default = '#A41515', help_text = '#A41515', verbose_name = 'background hover color' ) css_delete_button_background_hover_color = ColorField( blank = True, default = '#A41515', help_text = '#A41515', verbose_name = 'background hover color' )
css_delete_button_text_color = ColorField( blank = True, default = '#FFFFFF', help_text = '#FFFFFF', verbose_name = 'text color' ) css_delete_button_text_color = ColorField( blank = True, default = '#FFFFFF', help_text = '#FFFFFF', verbose_name = 'text color' )
css = models.TextField( blank = True ) css = models.TextField( blank = True )
list_filter_dropdown = models.BooleanField( default = False ) list_filter_dropdown = models.BooleanField( default = False )
def set_active(self, value): def set_active(self, value):
if value: 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) Theme.objects.filter(pk = self.pk).update(active = True)
else: else:
Theme.objects.filter(pk = self.pk).update(active = False) Theme.objects.filter(pk = self.pk).update(active = False)
def set_default_logo(self): def set_default_logo(self):
logo_path = os.path.normpath(os.path.dirname(__file__) + '/data/logo-django.svg') logo_path = os.path.normpath(os.path.dirname(__file__) + '/data/logo-django.svg')
logo_file = open(logo_path) logo_file = open(logo_path)
self.logo = File(logo_file) self.logo = File(logo_file)
self.save() self.save()
logo_file.close() logo_file.close()
class Meta: class Meta:
app_label = 'admin_interface' app_label = 'admin_interface'
verbose_name = 'Theme' verbose_name = 'Theme'
verbose_name_plural = 'Themes' verbose_name_plural = 'Themes'
def __unicode__(self): def __unicode__(self):
return unicode(u'%s' % (self.name, )) return unicode(u'%s' % (self.name, ))
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)
+180 -136
View File
@@ -6,399 +6,441 @@
<style type="text/css"> <style type="text/css">
{% if theme.active %} {% if theme.active %}
#header { #header {
height:auto; height:auto;
min-height:40px; min-height:40px;
background:{{ theme.css_header_background_color }}; background:{{ theme.css_header_background_color }};
color:{{ theme.css_header_text_color }}; color:{{ theme.css_header_text_color }};
} }
#header #user-tools a { #header #user-tools a {
color:{{ theme.css_header_link_color }}; color:{{ theme.css_header_link_color }};
} }
#header #user-tools a:hover, #header #user-tools a:hover,
#header #user-tools a:active { #header #user-tools a:active {
color:{{ theme.css_header_link_hover_color }}; color:{{ theme.css_header_link_hover_color }};
border-bottom-color:rgba(255, 255, 255, 0.5); border-bottom-color:rgba(255, 255, 255, 0.5);
} }
#branding h1 img.logo { #branding h1 img.logo {
max-height:100px; max-height:100px;
margin-top:10px; margin-top:10px;
margin-bottom:10px; margin-bottom:10px;
margin-right:15px; margin-right:15px;
} }
#branding h1 { #branding h1 {
color:{{ theme.css_header_title_color }}; color:{{ theme.css_header_title_color }};
} }
#branding h1 img+span { #branding h1 img+span {
white-space:nowrap; white-space:nowrap;
} }
.module h2, .module h2,
.module caption, .module caption,
.inline-group h2, .module.filtered h2 {
.module.filtered h2, background:{{ theme.css_module_background_color }};
.inline-group h2, color:{{ theme.css_module_text_color }};
}
.module a.section:link,
.module a.section:visited {
color:{{ theme.css_module_link_color }};
}
.module a.section:active,
.module a.section:hover {
color:{{ theme.css_module_link_hover_color }};
}
div.breadcrumbs { div.breadcrumbs {
background:{{ theme.css_module_background_color }}; background:{{ theme.css_module_background_color }};
color:{{ theme.css_module_text_color }}; color:{{ theme.css_module_text_color }};
} }
div.breadcrumbs a { div.breadcrumbs a {
color:{{ theme.css_module_link_color }}; color:{{ theme.css_module_link_color }};
} }
div.breadcrumbs a:hover, div.breadcrumbs a:hover,
div.breadcrumbs a:active, div.breadcrumbs a:active {
fieldset a.collapse-toggle:hover {
color:{{ theme.css_module_link_hover_color }} !important; color:{{ theme.css_module_link_hover_color }} !important;
} }
fieldset.collapsed a.collapse-toggle { fieldset.collapse {
color:{{ theme.css_module_background_color }} !important; border: 1px solid transparent;
} }
/* same color as above, but this requires !important */ fieldset.collapse.collapsed a.collapse-toggle {
/* support for modeltranslation tabs */ color:{{ theme.css_generic_link_color }} !important;
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, font-weight: bold;
text-transform: lowercase;
}
fieldset.collapse.collapsed a.collapse-toggle:hover,
fieldset.collapse.collapsed a.collapse-toggle:active {
color:{{ theme.css_generic_link_hover_color }} !important;
}
fieldset.collapse a.collapse-toggle {
color:{{ theme.css_module_link_color }} !important;
font-weight: bold;
text-transform: lowercase;
}
fieldset.collapse a.collapse-toggle:hover,
fieldset.collapse a.collapse-toggle:active {
color:{{ theme.css_module_link_hover_color }} !important;
}
.inline-group h2,
.inline-group h2 {
background:{{ theme.css_module_background_color }};
color:{{ theme.css_module_text_color }};
}
.selector-chosen h2 { .selector-chosen h2 {
background:{{ theme.css_module_background_color }} !important; background:{{ theme.css_module_background_color }} !important;
color:{{ theme.css_module_text_color }} !important; color:{{ theme.css_module_text_color }} !important;
} }
a:link, a:visited { a:link, a:visited {
color:{{ theme.css_generic_link_color }}; color:{{ theme.css_generic_link_color }};
} }
a:hover { a:hover {
color:{{ theme.css_generic_link_hover_color }}; color:{{ theme.css_generic_link_hover_color }};
} }
.button, input[type=submit], input[type=button], .submit-row input, a.button { .button, input[type=submit], input[type=button], .submit-row input, a.button {
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 }};
} }
.button:active, input[type=submit]:active, input[type=button]:active, .button:active, input[type=submit]:active, input[type=button]:active,
.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 }};
} }
.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 }};
} }
.button.default:active, input[type=submit].default:active, .button.default:active, input[type=submit].default:active,
.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 }};
} }
.submit-row a.deletelink:link, .submit-row a.deletelink:link,
.submit-row a.deletelink:visited { .submit-row a.deletelink:visited {
background:{{ theme.css_delete_button_background_color }}; background:{{ theme.css_delete_button_background_color }};
color:{{ theme.css_delete_button_text_color }}; color:{{ theme.css_delete_button_text_color }};
} }
.submit-row a.deletelink:hover { .submit-row a.deletelink:hover {
background:{{ theme.css_delete_button_background_hover_color }} !important; background:{{ theme.css_delete_button_background_hover_color }} !important;
color:{{ theme.css_delete_button_text_color }}; color:{{ theme.css_delete_button_text_color }};
} }
/* /*
#changelist table tbody tr.selected { #changelist table tbody tr.selected {
background-color:#FFFFCC; background-color:#FFFFCC;
} }
*/ */
#changelist .paginator { #changelist .paginator {
margin-top:-1px !important; /* merge 2 borders into 1 */ margin-top:-1px !important; /* merge 2 borders into 1 */
line-height:42px; line-height:42px;
} }
.paginator a, .paginator a,
.paginator a:link, .paginator a:link,
.paginator a:visited, .paginator a:visited,
.paginator .this-page { .paginator .this-page {
padding:7px 12px !important; padding:7px 12px !important;
{% if theme.css_module_rounded_corners %}border-radius:4px;{% endif %} {% if theme.css_module_rounded_corners %}border-radius:4px;{% endif %}
} }
.paginator a, .paginator a,
.paginator a:link, .paginator a:link,
.paginator a:visited { .paginator a:visited {
background-color:#ffffff !important; background-color:#ffffff !important;
color:{{ theme.css_generic_link_color }} !important; color:{{ theme.css_generic_link_color }} !important;
} }
.paginator a:hover, .paginator a:hover,
.paginator a:active { .paginator a:active {
background-color:#f8f8f8 !important; background-color:#f8f8f8 !important;
color:{{ theme.css_generic_link_hover_color }} !important; color:{{ theme.css_generic_link_hover_color }} !important;
} }
.paginator .this-page { .paginator .this-page {
background-color:{{ theme.css_module_background_color }} !important; background-color:{{ theme.css_module_background_color }} !important;
color:{{ theme.css_module_link_color }} !important; color:{{ theme.css_module_link_color }} !important;
} }
.paginator a, .paginator a,
.paginator .this-page { .paginator .this-page {
margin-left:0px; margin-left:0px;
} }
.paginator .this-page, .paginator .this-page,
.paginator a.end { .paginator a.end {
margin-right:25px; margin-right:25px;
} }
.paginator .this-page + a:not(.showall) { .paginator .this-page + a:not(.showall) {
margin-left:-25px !important; margin-left:-25px !important;
} }
body .paginator a.showall, body .paginator a.showall,
body .paginator a.showall:link, body .paginator a.showall:link,
body .paginator a.showall:visited { body .paginator a.showall:visited {
margin-left:20px; margin-left:20px;
color:{{ theme.css_generic_link_color }} !important; color:{{ theme.css_generic_link_color }} !important;
} }
body .paginator a.showall:hover, body .paginator a.showall:hover,
body .paginator a.showall:active { body .paginator a.showall:active {
color:{{ theme.css_generic_link_hover_color }} !important; color:{{ theme.css_generic_link_hover_color }} !important;
} }
/* OTHER FIXES */ /* OTHER FIXES */
/* reduced width */ /* reduced width */
.login #container { .login #container {
width:320px !important; width:320px !important;
min-width:320px !important; min-width:320px !important;
} }
/* same lateral padding as in logged view */ /* same lateral padding as in logged view */
.login #header { .login #header {
padding:10px 25px !important; padding:10px 25px !important;
} }
/* login button right aligned */ /* login button right aligned */
.login #header #branding h1 img+span { .login #header #branding h1 img+span {
display:block; display:block;
} }
/* login button right aligned */ /* login button right aligned */
.login .submit-row { .login .submit-row {
padding-left:0 !important; padding-left:0 !important;
text-align:right !important; text-align:right !important;
} }
/* top-right buttons color on hover -> just a lighten grey */ /* top-right buttons color on hover -> just a lighten grey */
.object-tools a:hover, .object-tools a:hover,
.object-tools li:hover a { .object-tools li:hover a {
background-color:#AAAAAA; background-color:#AAAAAA;
} }
/* fix help text icon on newline */ /* fix help text icon on newline */
.inline-group thead th { .inline-group thead th {
white-space:nowrap; white-space:nowrap;
} }
.inline-group thead th img { .inline-group thead th img {
vertical-align: -2px; vertical-align: -2px;
margin-left: 5px; margin-left: 5px;
} }
form .form-row p.file-upload > a { form .form-row p.file-upload > a {
margin-right:10px; margin-right:10px;
} }
form .form-row p.file-upload .clearable-file-input { form .form-row p.file-upload .clearable-file-input {
display:inline-block; display:inline-block;
} }
form .wide p.help { form .wide p.help {
padding-left:10px !important; padding-left:10px !important;
} }
textarea.tinymce ~ p.help { textarea.tinymce ~ p.help {
margin-top:5px !important; margin-top:5px !important;
} }
.aligned p.file-upload { .aligned p.file-upload {
display:table; display:table;
} }
/* fix lateral padding to align text with field labels */ /* fix lateral padding to align text with field labels */
.module h2, .module h2,
.dashboard .module caption, .dashboard .module caption,
.inline-group h2, .inline-group h2,
.module.filtered h2, .module.filtered h2,
.inline-group h2 { .inline-group h2 {
padding:8px 10px; padding:8px 10px;
{% if theme.css_module_rounded_corners %}border-radius:4px;{% endif %} {% if theme.css_module_rounded_corners %}border-radius:4px;{% endif %}
} }
.module.filtered h2 { .module.filtered h2 {
border-bottom-left-radius:0; border-bottom-left-radius:0;
border-bottom-right-radius:0; border-bottom-right-radius:0;
} }
.module.filtered #changelist-filter { .module.filtered #changelist-filter {
border-bottom-left-radius:4px; border-bottom-left-radius:4px;
border-bottom-right-radius:4px; border-bottom-right-radius:4px;
} }
.module.filtered #changelist-filter select { .module.filtered #changelist-filter select {
background-color:#ffffff; background-color:#ffffff;
} }
.module.filtered #changelist-filter li.selected a,
.module.filtered #changelist-filter li.selected a:hover {
color: {{ theme.css_generic_link_color }};
}
#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 */
a.selector-chooseall:hover, a.selector-clearall:hover { a.selector-chooseall:hover, a.selector-clearall:hover {
color:#888888 !important; color:#888888 !important;
} }
.inline-related h3 { .inline-related h3 {
padding:6px 10px !important; padding:6px 10px !important;
} }
/* /*
.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:center;
} }
*/ */
/*.inline-group .tabular tr.has_original td.original, */ /*.inline-group .tabular tr.has_original td.original, */
.inline-group .tabular tr td.delete { .inline-group .tabular tr td.delete {
vertical-align:middle !important; vertical-align:middle !important;
text-align:center !important; text-align:center !important;
} }
.inline-group .tabular tr td.delete a.inline-deletelink { .inline-group .tabular tr td.delete a.inline-deletelink {
float:none; float:none;
display:inline-block; display:inline-block;
} }
/* improve django-modeltranslation support - https://github.com/deschler/django-modeltranslation/pull/313/commits */ /* improve 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;
} }
.ui-tabs .ui-tabs-nav { .ui-tabs .ui-tabs-nav {
padding:10px 0 0 10px !important; padding:10px 0 0 10px !important;
} }
.ui-tabs .ui-tabs-nav li { .ui-tabs .ui-tabs-nav li {
margin-left:-1px !important; margin-left:-1px !important;
} }
.ui-tabs .ui-tabs-nav li a { .ui-tabs .ui-tabs-nav li a {
outline:none; outline:none;
background-color:#f8f8f8 !important; background-color:#f8f8f8 !important;
border:1px solid #eeeeee !important; border:1px solid #eeeeee !important;
border-bottom:none !important; border-bottom:none !important;
text-transform:uppercase; text-transform:uppercase;
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,
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a { .ui-tabs .ui-tabs-nav li.ui-tabs-selected a {
padding:8px 14px 8px 14px !important; padding:8px 14px 8px 14px !important;
margin-top:0px !important; margin-top:0px !important;
margin-bottom:-1px !important; margin-bottom:-1px !important;
background-color:#FFFFFF !important; background-color:#FFFFFF !important;
color:{{ theme.css_module_background_color }} !important; color:{{ theme.css_module_background_color }} !important;
border-bottom:1px solid #FFFFFF !important; border-bottom:1px solid #FFFFFF !important;
} }
.inline-group .tabular .ui-tabs .ui-tabs-panel { .inline-group .tabular .ui-tabs .ui-tabs-panel {
padding:8px !important; padding:8px !important;
} }
#changelist .row1:not(.selected):hover, #changelist .row1:not(.selected):hover,
#changelist .row2:not(.selected):hover { #changelist .row2:not(.selected):hover {
background:#f9f9f9; background:#f9f9f9;
} }
.row2 { .row2 {
background:#fcfcfc; background:#fcfcfc;
} }
.row2 .ui-tabs .ui-tabs-nav li a { .row2 .ui-tabs .ui-tabs-nav li a {
background-color:#f5f5f5 !important; background-color:#f5f5f5 !important;
border:1px solid #ebebeb !important; border:1px solid #ebebeb !important;
} }
.row2 .ui-tabs .ui-tabs-nav li.ui-tabs-active a, .row2 .ui-tabs .ui-tabs-nav li.ui-tabs-active a,
.row2 .ui-tabs .ui-tabs-nav li.ui-tabs-selected a { .row2 .ui-tabs .ui-tabs-nav li.ui-tabs-selected a {
background-color:#fcfcfc !important; background-color:#fcfcfc !important;
border-bottom:1px solid #fcfcfc !important; border-bottom:1px solid #fcfcfc !important;
} }
.list-filter-dropdown { .list-filter-dropdown {
margin-top:10px; margin-top:10px;
margin-bottom:20px; margin-bottom:20px;
} }
.list-filter-dropdown select { .list-filter-dropdown select {
width:90%; width:90%;
margin-right:5%; margin-right:5%;
} }
/* ckeditor + light theme - https://github.com/Ikimea/ckeditor-light-theme */ /* 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;
border-bottom-left-radius: 4px !important; border-bottom-left-radius: 4px !important;
border-bottom-right-radius: 4px !important; border-bottom-right-radius: 4px !important;
} }
.cke_top { .cke_top {
background: #f6f6f6 !important; background: #f6f6f6 !important;
border-top: none; border-top: none;
border-top-left-radius: 4px !important; border-top-left-radius: 4px !important;
border-top-right-radius: 4px !important; border-top-right-radius: 4px !important;
-moz-box-shadow: none !important; -moz-box-shadow: none !important;
-webkit-box-shadow: none !important; -webkit-box-shadow: none !important;
box-shadow: none !important; box-shadow: none !important;
} }
.cke_bottom { .cke_bottom {
background: #f6f6f6 !important; background: #f6f6f6 !important;
border-top: 1px solid #efefef !important; border-top: 1px solid #efefef !important;
border-bottom-left-radius: 4px !important; border-bottom-left-radius: 4px !important;
border-bottom-right-radius: 4px !important; border-bottom-right-radius: 4px !important;
} }
.cke_source { .cke_source {
padding: 13px 15px !important; padding: 13px 15px !important;
box-sizing: border-box !important; box-sizing: border-box !important;
} }
a.cke_button_on { a.cke_button_on {
-moz-box-shadow: none !important; -moz-box-shadow: none !important;
-webkit-box-shadow: none !important; -webkit-box-shadow: none !important;
@@ -406,21 +448,21 @@
background-color: rgba(0,0,0,0.1) !important; background-color: rgba(0,0,0,0.1) !important;
border-radius: 4px !important; border-radius: 4px !important;
} }
.cke_resizer { .cke_resizer {
border-color: transparent #999 transparent transparent !important; border-color: transparent #999 transparent transparent !important;
} }
{% if theme.css %} {% if theme.css %}
{{ theme.css|safe }} {{ theme.css|safe }}
{% endif %} {% endif %}
{% else %} {% else %}
#branding h1 img.logo { #branding h1 img.logo {
display:none; display:none;
} }
{% endif %} {% endif %}
</style> </style>
@@ -445,5 +487,7 @@
</h1> </h1>
{% endblock %} {% endblock %}
{% block bodyclass %}admin-interface flat-theme{% endblock %}
{% block sidebar %} {% block sidebar %}
{% endblock %} {% endblock %}
@@ -10,16 +10,15 @@ 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] obj_qs = Theme.objects.filter(active = True)[:1]
obj_ls = list(obj_qs) obj_ls = list(obj_qs)
obj = None obj = None
if len(obj_ls): if len(obj_ls):
obj = obj_ls[0] obj = obj_ls[0]
else: else:
obj = Theme.get_or_create_default_theme() obj = Theme.get_or_create_default_theme()
return obj return obj
+1 -1
View File
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
__version__ = '0.1.0' __version__ = '0.1.4'
+3 -2
View File
@@ -10,14 +10,15 @@ setup(
include_package_data=True, include_package_data=True,
license='MIT License', license='MIT License',
version=__version__, version=__version__,
description='django-admin-interface is a modern admin interface customizable by the admin itself.', description='django-admin-interface is a modern 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', 'ui', 'flat', 'theme', 'custom'],
install_requires=[ install_requires=[
'django-colorfield==0.1.10' 'django-colorfield==0.1.10',
'django-flat-theme==1.1.2'
], ],
classifiers=[] classifiers=[]
) )