Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 |
@@ -1,20 +1,21 @@
|
|||||||
#django-admin-interface
|
#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**.
|
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 3.4
|
- Python 2.6, Python 2.7, Python 3.4
|
||||||
- Django 1.6.5 through Django 1.9
|
- Django 1.6.5 through Django 1.10
|
||||||
|
|
||||||
##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 = (
|
||||||
#...
|
#...
|
||||||
'admin_interface',
|
'admin_interface',
|
||||||
'flat',
|
'flat_responsive',
|
||||||
|
'flat', #if django version < 1.9
|
||||||
'colorfield',
|
'colorfield',
|
||||||
#...
|
#...
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
@@ -40,27 +41,8 @@ INSTALLED_APPS = (
|
|||||||
|
|
||||||
####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) 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
|
|
||||||
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.
|
|
||||||
|
|||||||
@@ -83,12 +83,14 @@ class Theme(models.Model):
|
|||||||
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_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()
|
||||||
@@ -107,4 +109,3 @@ class Theme(models.Model):
|
|||||||
|
|
||||||
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)
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
{% 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">
|
||||||
@@ -65,8 +70,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 +102,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 +126,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,
|
||||||
@@ -221,7 +230,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.login #content {
|
.login #content {
|
||||||
padding:0px 30px 10px 30px !important;
|
padding:10px 30px 10px 30px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* same lateral padding as in logged view */
|
/* same lateral padding as in logged view */
|
||||||
@@ -277,6 +286,10 @@
|
|||||||
padding-left:10px !important;
|
padding-left:10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
form .aligned.wide p.help {
|
||||||
|
margin-left: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
textarea.tinymce ~ p.help {
|
textarea.tinymce ~ p.help {
|
||||||
margin-top:5px !important;
|
margin-top:5px !important;
|
||||||
}
|
}
|
||||||
@@ -285,15 +298,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;
|
||||||
@@ -315,7 +351,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 */
|
||||||
@@ -323,26 +361,36 @@
|
|||||||
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 */
|
/* improve django-modeltranslation support - https://github.com/deschler/django-modeltranslation/pull/313/commits */
|
||||||
|
|
||||||
@@ -509,5 +557,11 @@
|
|||||||
|
|
||||||
{% 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">
|
||||||
|
<link rel="stylesheet" type="text/css" href="{% static "admin/css/responsive.css" %}" />
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block sidebar %}
|
{% block sidebar %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
__version__ = '0.1.6'
|
__version__ = '0.2.0'
|
||||||
|
|
||||||
|
|||||||
@@ -10,15 +10,16 @@ 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 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'],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'django-colorfield==0.1.10',
|
'django-colorfield==0.1.12',
|
||||||
'django-flat-theme==1.1.3'
|
'django-flat-theme==1.1.4',
|
||||||
|
'django-flat-responsive==1.2.0'
|
||||||
],
|
],
|
||||||
classifiers=[]
|
classifiers=[]
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user