Added favicon support #28

pull/32/head
Fabio Caccamo 2017-08-24 14:28:36 +02:00
parent 3b982a84c3
commit 4d07e9fec5
4 changed files with 29 additions and 0 deletions

View File

@ -19,6 +19,10 @@ class ThemeAdmin(admin.ModelAdmin):
'classes': ('wide', ),
'fields': ('logo', 'logo_color', 'logo_visible', )
}),
('Favicon', {
'classes': ('wide', ),
'fields': ('favicon', )
}),
('Title', {
'classes': ('wide', ),
'fields': ('title', 'title_color', 'title_visible', )

View File

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-08-24 10:49
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('admin_interface', '0006_bytes_to_str'),
]
operations = [
migrations.AddField(
model_name='theme',
name='favicon',
field=models.FileField(blank=True, help_text='(.ico|.png|.gif - 16x16|32x32 px)', upload_to='admin-interface/favicon/', verbose_name='favicon'),
),
]

View File

@ -60,6 +60,8 @@ class Theme(models.Model):
logo_color = ColorField( blank = True, default = '#FFFFFF', help_text = '#FFFFFF', max_length = 10, verbose_name = 'logo color' )
logo_visible = models.BooleanField( default = True, verbose_name = 'visible' )
favicon = models.FileField( upload_to = 'admin-interface/favicon/', blank = True, help_text = '(.ico|.png|.gif - 16x16|32x32 px)', verbose_name = 'favicon' )
css_header_background_color = ColorField( blank = True, default = '#0C4B33', help_text = '#0C4B33', max_length = 10, verbose_name = 'background color' )
css_header_text_color = ColorField( blank = True, default = '#44B78B', help_text = '#44B78B', max_length = 10, verbose_name = 'text color' )
css_header_link_color = ColorField( blank = True, default = '#FFFFFF', help_text = '#FFFFFF', max_length = 10, verbose_name = 'link color' )

View File

@ -38,6 +38,9 @@ https://github.com/fabiocaccamo/django-admin-interface
{# https://github.com/elky/django-flat-responsive#important-note #}
<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' %}?v={{ version }}" />
{% if theme.favicon %}
<link rel="icon" type="image/x-icon" href="{{ theme.favicon.url }}?v={{ version }}" />
{% endif %}
{% if theme.related_modal_active %}
<link rel="stylesheet" type="text/css" href="{% static 'admin_interface/magnific-popup/magnific-popup.css' %}?v={{ version }}" />
<script type="text/javascript" src="{% static 'admin_interface/magnific-popup/jquery.magnific-popup.js' %}?v={{ version }}"></script>