Compare commits

..

35 Commits

Author SHA1 Message Date
Fabio Caccamo 9350575898 Updated setup.py 2016-11-08 12:18:35 +01:00
Fabio Caccamo 4789ee1dab Updated README.md 2016-11-08 12:18:19 +01:00
Fabio Caccamo a924c6cf5e Updated version 2016-11-08 12:17:53 +01:00
Fabio Caccamo 42b6e01f1f Added responsive support 2016-11-08 12:17:24 +01:00
Fabio Caccamo d7fa681c56 Fixed login padding 2016-11-08 12:15:42 +01:00
Fabio Caccamo 18e1425156 Updated version 2016-09-10 18:49:31 +02:00
Fabio Caccamo 1f39ceb0ad Fixed missing admin title #7 2016-09-10 18:49:20 +02:00
Fabio Caccamo 48cb73a604 Updated version 2016-09-04 18:44:07 +02:00
Fabio Caccamo c5bbbbc855 Updated README 2016-09-04 18:43:55 +02:00
Fabio Caccamo 793a019460 Fixed buttons color on focus and removed outline. 2016-09-04 18:43:29 +02:00
Fabio Caccamo 674178ecbe Updated README 2016-08-05 10:37:36 +02:00
Fabio Caccamo 07a51c1678 Updated version 2016-08-05 10:37:24 +02:00
Fabio Caccamo a58605a385 Renamed var 2016-08-05 10:36:59 +02:00
Fabio Caccamo e1d2c81ebe Merge pull request #6 from cereigido/master
Adding filename to File for Django 1.10 compatibility
2016-08-05 10:17:22 +02:00
Paulo Cereigido e5e55bdfcd adding filename to File from Django 1.10 compatibility 2016-08-05 01:29:53 -03:00
Fabio Caccamo f6ce51c839 Updated README.md 2016-07-12 18:55:01 +02:00
Fabio Caccamo b4b19650f1 Updated version 2016-06-29 16:05:34 +02:00
Fabio Caccamo 3d4f249487 Improved backward compatibility with South 2016-06-29 16:05:13 +02:00
Fabio Caccamo 7c236c6641 Updated version and dependencies version 2016-04-13 17:25:54 +02:00
Fabio Caccamo 91b3809d61 Improved sorl-thumbnail AdminImageMixin widget layout 2016-04-12 18:03:50 +02:00
Fabio Caccamo f918551971 Fixed login logo overflow 2016-04-11 17:53:50 +02:00
Fabio Caccamo 149c95311f Updated README.md 2016-04-11 12:56:09 +02:00
Fabio Caccamo 858f077bd4 Updated README.md 2016-03-01 12:05:06 +01:00
Fabio Caccamo e46daa8f99 Updated README 2016-02-24 10:14:26 +01:00
Fabio Caccamo e3320b2034 Updated LICENSE 2016-02-24 10:12:32 +01:00
Fabio Caccamo 8991863fb1 Updated README 2016-02-24 10:11:54 +01:00
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
11 changed files with 349 additions and 222 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
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
of this software and associated documentation files (the "Software"), to deal
+10 -28
View File
@@ -1,27 +1,28 @@
#django-admin-interface
django-admin-interface is a modern **flat admin interface customizable by the admin itself**.
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**.
##Requirements
- Python 2.6, Python 2.7
- Django 1.6.5 through Django 1.8.4
- Python 2.6, Python 2.7, Python 3.4
- Django 1.6.5 through Django 1.10
##Installation
- 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
INSTALLED_APPS = (
#...
'flat',
'admin_interface',
'flat_responsive',
'flat', #if django version < 1.9
'colorfield',
'admin_interface',
#...
'django.contrib.admin',
#...
)
```
- Run ``python manage.py migrate`` *(add ``--fake-initial`` if you are upgrading from 0.1.0 to 0.1.1 version)*
- 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
@@ -40,27 +41,8 @@ INSTALLED_APPS = (
####Thanks
- [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/)
##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.
Released under [MIT License](LICENSE).
+4 -4
View File
@@ -6,10 +6,10 @@ from admin_interface.models import Theme
class ThemeAdmin(admin.ModelAdmin):
list_display = ('name', 'active', )
list_editable = ('active', )
fieldsets = (
(None, {
'classes': ('wide', ),
@@ -48,8 +48,8 @@ class ThemeAdmin(admin.ModelAdmin):
'fields': ('list_filter_dropdown', )
}),
)
save_on_top = True
admin.site.register(Theme, ThemeAdmin)
+5 -7
View File
@@ -3,16 +3,14 @@
from django.apps import AppConfig
from django.db.models.signals import post_migrate
from admin_interface.models import Theme
class AdminInterfaceConfig(AppConfig):
name = 'admin_interface'
verbose_name = 'Admin Interface'
def ready(self):
from admin_interface.models import Theme
post_migrate.connect(Theme.post_migrate_handler, sender = self)
+36 -35
View File
@@ -10,101 +10,102 @@ import os
class Theme(models.Model):
@staticmethod
def post_migrate_handler(sender, **kwargs):
Theme.get_or_create_default_theme()
@staticmethod
def post_delete_handler(instance, **kwargs):
Theme.get_or_create_default_theme()
@staticmethod
def post_save_handler(instance, created, **kwargs):
instance.set_active(instance.active)
Theme.get_or_create_default_theme()
@staticmethod
def get_or_create_default_theme():
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 })
if not obj.logo:
obj.set_default_logo()
if not obj_created and obj_active:
obj.set_active(True)
return (obj, obj_created, )
name = models.CharField( max_length = 50, default = 'Django' )
active = models.BooleanField( default = True )
title = models.CharField( max_length = 50, default = 'Django administration', blank = True )
title_visible = models.BooleanField( default = True, verbose_name = 'visible' )
logo = models.FileField( upload_to = 'admin-interface/logo/', blank = True )
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_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_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_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_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_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_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_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_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_text_color = ColorField( blank = True, default = '#FFFFFF', help_text = '#FFFFFF', verbose_name = 'text color' )
css = models.TextField( blank = True )
list_filter_dropdown = models.BooleanField( default = False )
def set_active(self, value):
if value:
Theme.objects.exclude(pk = self.pk).update(active = False)
Theme.objects.filter(pk = self.pk).update(active = True)
else:
Theme.objects.filter(pk = self.pk).update(active = False)
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)
self.logo = File(logo_file)
self.logo = File(logo_file, logo_filename)
self.save()
logo_file.close()
class Meta:
app_label = 'admin_interface'
verbose_name = 'Theme'
verbose_name_plural = 'Themes'
def __unicode__(self):
return unicode(u'%s' % (self.name, ))
post_delete.connect(Theme.post_delete_handler, sender = Theme)
post_save.connect(Theme.post_save_handler, sender = Theme)
@@ -0,0 +1,82 @@
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Theme'
db.create_table(u'admin_interface_theme', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('name', self.gf('django.db.models.fields.CharField')(default='Django', max_length=50)),
('active', self.gf('django.db.models.fields.BooleanField')(default=True)),
('title', self.gf('django.db.models.fields.CharField')(default='Django administration', max_length=50, blank=True)),
('title_visible', self.gf('django.db.models.fields.BooleanField')(default=True)),
('logo', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)),
('logo_visible', self.gf('django.db.models.fields.BooleanField')(default=True)),
('css_header_background_color', self.gf('colorfield.fields.ColorField')(default='#0C4B33', max_length=10, blank=True)),
('css_header_title_color', self.gf('colorfield.fields.ColorField')(default='#F5DD5D', max_length=10, blank=True)),
('css_header_text_color', self.gf('colorfield.fields.ColorField')(default='#44B78B', max_length=10, blank=True)),
('css_header_link_color', self.gf('colorfield.fields.ColorField')(default='#FFFFFF', max_length=10, blank=True)),
('css_header_link_hover_color', self.gf('colorfield.fields.ColorField')(default='#C9F0DD', max_length=10, blank=True)),
('css_module_background_color', self.gf('colorfield.fields.ColorField')(default='#44B78B', max_length=10, blank=True)),
('css_module_text_color', self.gf('colorfield.fields.ColorField')(default='#FFFFFF', max_length=10, blank=True)),
('css_module_link_color', self.gf('colorfield.fields.ColorField')(default='#FFFFFF', max_length=10, blank=True)),
('css_module_link_hover_color', self.gf('colorfield.fields.ColorField')(default='#C9F0DD', max_length=10, blank=True)),
('css_module_rounded_corners', self.gf('django.db.models.fields.BooleanField')(default=True)),
('css_generic_link_color', self.gf('colorfield.fields.ColorField')(default='#0C3C26', max_length=10, blank=True)),
('css_generic_link_hover_color', self.gf('colorfield.fields.ColorField')(default='#156641', max_length=10, blank=True)),
('css_save_button_background_color', self.gf('colorfield.fields.ColorField')(default='#0C4B33', max_length=10, blank=True)),
('css_save_button_background_hover_color', self.gf('colorfield.fields.ColorField')(default='#0C3C26', max_length=10, blank=True)),
('css_save_button_text_color', self.gf('colorfield.fields.ColorField')(default='#FFFFFF', max_length=10, blank=True)),
('css_delete_button_background_color', self.gf('colorfield.fields.ColorField')(default='#BA2121', max_length=10, blank=True)),
('css_delete_button_background_hover_color', self.gf('colorfield.fields.ColorField')(default='#A41515', max_length=10, blank=True)),
('css_delete_button_text_color', self.gf('colorfield.fields.ColorField')(default='#FFFFFF', max_length=10, blank=True)),
('css', self.gf('django.db.models.fields.TextField')(blank=True)),
('list_filter_dropdown', self.gf('django.db.models.fields.BooleanField')(default=False)),
))
db.send_create_signal('admin_interface', ['Theme'])
def backwards(self, orm):
# Deleting model 'Theme'
db.delete_table(u'admin_interface_theme')
models = {
'admin_interface.theme': {
'Meta': {'object_name': 'Theme'},
'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'css': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'css_delete_button_background_color': ('colorfield.fields.ColorField', [], {'default': "'#BA2121'", 'max_length': '10', 'blank': 'True'}),
'css_delete_button_background_hover_color': ('colorfield.fields.ColorField', [], {'default': "'#A41515'", 'max_length': '10', 'blank': 'True'}),
'css_delete_button_text_color': ('colorfield.fields.ColorField', [], {'default': "'#FFFFFF'", 'max_length': '10', 'blank': 'True'}),
'css_generic_link_color': ('colorfield.fields.ColorField', [], {'default': "'#0C3C26'", 'max_length': '10', 'blank': 'True'}),
'css_generic_link_hover_color': ('colorfield.fields.ColorField', [], {'default': "'#156641'", 'max_length': '10', 'blank': 'True'}),
'css_header_background_color': ('colorfield.fields.ColorField', [], {'default': "'#0C4B33'", 'max_length': '10', 'blank': 'True'}),
'css_header_link_color': ('colorfield.fields.ColorField', [], {'default': "'#FFFFFF'", 'max_length': '10', 'blank': 'True'}),
'css_header_link_hover_color': ('colorfield.fields.ColorField', [], {'default': "'#C9F0DD'", 'max_length': '10', 'blank': 'True'}),
'css_header_text_color': ('colorfield.fields.ColorField', [], {'default': "'#44B78B'", 'max_length': '10', 'blank': 'True'}),
'css_header_title_color': ('colorfield.fields.ColorField', [], {'default': "'#F5DD5D'", 'max_length': '10', 'blank': 'True'}),
'css_module_background_color': ('colorfield.fields.ColorField', [], {'default': "'#44B78B'", 'max_length': '10', 'blank': 'True'}),
'css_module_link_color': ('colorfield.fields.ColorField', [], {'default': "'#FFFFFF'", 'max_length': '10', 'blank': 'True'}),
'css_module_link_hover_color': ('colorfield.fields.ColorField', [], {'default': "'#C9F0DD'", 'max_length': '10', 'blank': 'True'}),
'css_module_rounded_corners': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'css_module_text_color': ('colorfield.fields.ColorField', [], {'default': "'#FFFFFF'", 'max_length': '10', 'blank': 'True'}),
'css_save_button_background_color': ('colorfield.fields.ColorField', [], {'default': "'#0C4B33'", 'max_length': '10', 'blank': 'True'}),
'css_save_button_background_hover_color': ('colorfield.fields.ColorField', [], {'default': "'#0C3C26'", 'max_length': '10', 'blank': 'True'}),
'css_save_button_text_color': ('colorfield.fields.ColorField', [], {'default': "'#FFFFFF'", 'max_length': '10', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'list_filter_dropdown': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'logo': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
'logo_visible': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'default': "'Django'", 'max_length': '50'}),
'title': ('django.db.models.fields.CharField', [], {'default': "'Django administration'", 'max_length': '50', 'blank': 'True'}),
'title_visible': ('django.db.models.fields.BooleanField', [], {'default': 'True'})
}
}
complete_apps = ['admin_interface']
+201 -138
View File
@@ -1,419 +1,476 @@
{% extends "admin/base.html" %}
{% 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 %}
{% get_admin_interface_theme as theme %}
<style type="text/css">
{% if theme.active %}
#header {
height:auto;
min-height:40px;
#header {
height:auto;
min-height:40px;
background:{{ theme.css_header_background_color }};
color:{{ theme.css_header_text_color }};
}
#header #user-tools a {
color:{{ theme.css_header_link_color }};
}
#header #user-tools a:hover,
#header #user-tools a:hover,
#header #user-tools a:active {
color:{{ theme.css_header_link_hover_color }};
border-bottom-color:rgba(255, 255, 255, 0.5);
}
#branding h1 img.logo {
max-height:100px;
margin-top:10px;
margin-bottom:10px;
#branding h1 img.logo {
max-height:100px;
margin-top:10px;
margin-bottom:10px;
margin-right:15px;
}
#branding h1 {
color:{{ theme.css_header_title_color }};
}
#branding h1 img+span {
white-space:nowrap;
}
.module h2,
.module caption,
.module h2,
.module caption,
.module.filtered h2 {
background:{{ theme.css_module_background_color }};
color:{{ theme.css_module_text_color }};
}
.module a.section:link,
.module a.section:link,
.module a.section:visited {
color:{{ theme.css_module_link_color }};
}
.module a.section:active,
.module a.section:active,
.module a.section:hover {
color:{{ theme.css_module_link_hover_color }};
}
div.breadcrumbs {
background:{{ theme.css_module_background_color }};
color:{{ theme.css_module_text_color }};
}
div.breadcrumbs a {
color:{{ theme.css_module_link_color }};
}
div.breadcrumbs a:hover,
div.breadcrumbs a:active,
fieldset a.collapse-toggle:hover {
div.breadcrumbs a:hover,
div.breadcrumbs a:active {
color:{{ theme.css_module_link_hover_color }} !important;
}
fieldset.collapsed a.collapse-toggle {
color:{{ theme.css_module_background_color }} !important;
fieldset.collapse {
border: 1px solid transparent;
}
.inline-group h2,
fieldset.collapse.collapsed a.collapse-toggle {
color:{{ theme.css_generic_link_color }} !important;
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 {
background:{{ theme.css_module_background_color }} !important;
color:{{ theme.css_module_text_color }} !important;
}
a:link, a:visited {
color:{{ theme.css_generic_link_color }};
}
a:hover {
color:{{ theme.css_generic_link_hover_color }};
}
.button, input[type=submit], input[type=button], .submit-row input, a.button {
background:{{ theme.css_save_button_background_color }};
color:{{ theme.css_save_button_text_color }};
}
.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 {
background:{{ theme.css_save_button_background_hover_color }};
color:{{ theme.css_save_button_text_color }};
outline: none;
}
.button.default, input[type=submit].default, .submit-row input.default {
background:{{ theme.css_save_button_background_color }};
color:{{ theme.css_save_button_text_color }};
outline: none;
}
.button.default:active, input[type=submit].default:active,
.button.default:focus, input[type=submit].default:focus,
.button.default:hover, input[type=submit].default:hover {
background:{{ theme.css_save_button_background_hover_color }};
color:{{ theme.css_save_button_text_color }};
outline: none;
}
.submit-row a.deletelink:link,
.submit-row a.deletelink:link,
.submit-row a.deletelink:visited {
background:{{ theme.css_delete_button_background_color }};
color:{{ theme.css_delete_button_text_color }};
}
.submit-row a.deletelink:hover {
background:{{ theme.css_delete_button_background_hover_color }} !important;
color:{{ theme.css_delete_button_text_color }};
}
/*
#changelist table tbody tr.selected {
background-color:#FFFFCC;
}
*/
#changelist .paginator {
margin-top:-1px !important; /* merge 2 borders into 1 */
line-height:42px;
}
.paginator a,
.paginator a:link,
.paginator a,
.paginator a:link,
.paginator a:visited,
.paginator .this-page {
padding:7px 12px !important;
{% if theme.css_module_rounded_corners %}border-radius:4px;{% endif %}
}
.paginator a,
.paginator a:link,
.paginator a,
.paginator a:link,
.paginator a:visited {
background-color:#ffffff !important;
background-color:#ffffff !important;
color:{{ theme.css_generic_link_color }} !important;
}
.paginator a:hover,
.paginator a:hover,
.paginator a:active {
background-color:#f8f8f8 !important;
color:{{ theme.css_generic_link_hover_color }} !important;
}
.paginator .this-page {
background-color:{{ theme.css_module_background_color }} !important;
color:{{ theme.css_module_link_color }} !important;
}
.paginator a,
.paginator a,
.paginator .this-page {
margin-left:0px;
}
.paginator .this-page,
.paginator .this-page,
.paginator a.end {
margin-right:25px;
}
.paginator .this-page + a:not(.showall) {
margin-left:-25px !important;
}
body .paginator a.showall,
body .paginator a.showall:link,
body .paginator a.showall,
body .paginator a.showall:link,
body .paginator a.showall:visited {
margin-left:20px;
color:{{ theme.css_generic_link_color }} !important;
}
body .paginator a.showall:hover,
body .paginator a.showall:hover,
body .paginator a.showall:active {
color:{{ theme.css_generic_link_hover_color }} !important;
}
/* OTHER FIXES */
/* reduced width */
.login #container {
width:320px !important;
min-width:320px !important;
}
.login #content {
padding:10px 30px 10px 30px !important;
}
/* same lateral padding as in logged view */
.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 #header #branding h1 img+span {
display:block;
}
/* login button right aligned */
.login .submit-row {
padding-left:0 !important;
text-align:right !important;
}
/* top-right buttons color on hover -> just a lighten grey */
.object-tools a:hover,
.object-tools a:hover,
.object-tools li:hover a {
background-color:#AAAAAA;
}
}
/* fix help text icon on newline */
.inline-group thead th {
white-space:nowrap;
}
.inline-group thead th img {
vertical-align: -2px;
margin-left: 5px;
}
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;
}
form .wide p.help {
padding-left:10px !important;
}
textarea.tinymce ~ p.help {
margin-top:5px !important;
}
.aligned p.file-upload {
display:table;
}
/* fix lateral padding to align text with field labels */
.module h2,
.dashboard .module caption,
.inline-group h2,
.module.filtered h2,
.module h2,
.dashboard .module caption,
.inline-group h2,
.module.filtered h2,
.inline-group h2 {
padding:8px 10px;
padding:8px 10px;
{% if theme.css_module_rounded_corners %}border-radius:4px;{% endif %}
}
.module.filtered h2 {
border-bottom-left-radius:0;
border-bottom-right-radius:0;
}
.module.filtered #changelist-filter {
border-bottom-left-radius:4px;
border-bottom-right-radius:4px;
}
.module.filtered #changelist-filter select {
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 {
{% if theme.css_module_rounded_corners %}border-radius:4px;{% endif %}
}
/* selector chooseall / clearall color on hover -> just a lighten grey */
a.selector-chooseall:hover, a.selector-clearall:hover {
color:#888888 !important;
}
.inline-related h3 {
padding:6px 10px !important;
}
/*
.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 {
vertical-align:middle !important;
text-align:center !important;
}
.inline-group .tabular tr td.delete a.inline-deletelink {
float:none;
display:inline-block;
}
/* improve django-modeltranslation support - https://github.com/deschler/django-modeltranslation/pull/313/commits */
#content h1 select {
text-transform:uppercase;
margin-left:15px;
margin-left:15px;
}
.ui-tabs .ui-tabs-nav {
padding:10px 0 0 10px !important;
}
.ui-tabs .ui-tabs-nav li {
margin-left:-1px !important;
}
.ui-tabs .ui-tabs-nav li a {
outline:none;
background-color:#f8f8f8 !important;
border:1px solid #eeeeee !important;
border-bottom:none !important;
text-transform:uppercase;
padding:7px 14px 8px 14px !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 {
padding:8px 14px 8px 14px !important;
margin-top:0px !important;
margin-bottom:-1px !important;
background-color:#FFFFFF !important;
color:{{ theme.css_module_background_color }} !important;
border-bottom:1px solid #FFFFFF !important;
}
.inline-group .tabular .ui-tabs .ui-tabs-panel {
padding:8px !important;
}
#changelist .row1:not(.selected):hover,
#changelist .row1:not(.selected):hover,
#changelist .row2:not(.selected):hover {
background:#f9f9f9;
}
.row2 {
background:#fcfcfc;
}
.row2 .ui-tabs .ui-tabs-nav li a {
background-color:#f5f5f5 !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 {
background-color:#fcfcfc !important;
border-bottom:1px solid #fcfcfc !important;
}
.list-filter-dropdown {
margin-top:10px;
margin-top:10px;
margin-bottom:20px;
}
.list-filter-dropdown select {
width:90%;
width:90%;
margin-right:5%;
}
/* sorl-thumbnail - improved AdminImageMixin widget layout */
a.thumbnail + input[type="checkbox"] {
margin:10px 0;
}
/* ckeditor + light theme - https://github.com/Ikimea/ckeditor-light-theme */
.cke_inner, .cke_wysiwyg_frame {
border-top-left-radius: 4px !important;
border-top-right-radius: 4px !important;
border-bottom-left-radius: 4px !important;
border-bottom-right-radius: 4px !important;
}
.cke_top {
background: #f6f6f6 !important;
background: #f6f6f6 !important;
border-top: none;
border-top-left-radius: 4px !important;
border-top-right-radius: 4px !important;
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
}
.cke_bottom {
background: #f6f6f6 !important;
border-top: 1px solid #efefef !important;
border-bottom-left-radius: 4px !important;
border-bottom-right-radius: 4px !important;
}
.cke_source {
padding: 13px 15px !important;
box-sizing: border-box !important;
}
a.cke_button_on {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
@@ -421,21 +478,21 @@
background-color: rgba(0,0,0,0.1) !important;
border-radius: 4px !important;
}
.cke_resizer {
border-color: transparent #999 transparent transparent !important;
}
{% if theme.css %}
{{ theme.css|safe }}
{% endif %}
{% else %}
#branding h1 img.logo {
display:none;
}
{% endif %}
</style>
@@ -462,5 +519,11 @@
{% 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">
<link rel="stylesheet" type="text/css" href="{% static "admin/css/responsive.css" %}" />
{% endblock %}
{% block sidebar %}
{% endblock %}
@@ -10,16 +10,15 @@ register = template.Library()
@register.assignment_tag(takes_context = True)
def get_admin_interface_theme(context):
obj_qs = Theme.objects.filter(active = True)[:1]
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 -1
View File
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
__version__ = '0.1.2'
__version__ = '0.2.0'
+5 -3
View File
@@ -10,14 +10,16 @@ setup(
include_package_data=True,
license='MIT License',
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_email='fabio.caccamo@gmail.com',
url='https://github.com/fabiocaccamo/django-admin-interface',
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'],
install_requires=[
'django-colorfield==0.1.10'
'django-colorfield==0.1.10',
'django-flat-theme==1.1.4',
'django-flat-responsive==1.0.0'
],
classifiers=[]
)