Added env badge to favicon.

This commit is contained in:
Fabio Caccamo
2019-02-21 17:16:48 +01:00
parent 1c335f83e9
commit 7d9edddf82
8 changed files with 966 additions and 20 deletions
@@ -40,14 +40,8 @@ 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>
<script type="text/javascript" src="{% static 'admin_interface/related-modal/related-modal.js' %}?v={{ version }}"></script>
{% endif %}
{% include "admin_interface/favicon.html" %}
{% include "admin_interface/related-modal.html" %}
{% endblock %}
{% block bodyclass %}admin-interface flat-theme {% get_admin_interface_theme as theme %}{% if theme.name %}{{ theme.name|slugify }}-theme{% endif %}{% endblock %}
@@ -1,6 +1,6 @@
.admin-interface #header {
background:{{ theme.css_header_background_color }};
color:{{ theme.css_header_text_color }};
background: {{ theme.css_header_background_color }};
color: {{ theme.css_header_text_color }};
}
.admin-interface .enviroment-label {
@@ -20,19 +20,19 @@
}
.admin-interface .enviroment-label.development::before {
background-color: #e74c3c;
background-color: {{ theme.env_colors.development }};
}
.admin-interface .enviroment-label.testing::before {
background-color: #e67e22;
background-color: {{ theme.env_colors.testing }};
}
.admin-interface .enviroment-label.staging::before {
background-color: #f1c40f;
background-color: {{ theme.env_colors.staging }};
}
.admin-interface .enviroment-label.production::before {
background-color: #2ecc71;
background-color: {{ theme.env_colors.production }};
}
.admin-interface .enviroment-label::after {
@@ -10,4 +10,3 @@
</select>
</div>
</div>
@@ -0,0 +1,17 @@
{% load static %}
{% if theme.favicon %}
<link rel="icon" type="image/x-icon" href="{{ theme.favicon.url }}?v={{ version }}" />
{% if theme.env_visible %}
<script type="text/javascript" src="{% static 'admin_interface/favico/favico-0.3.10-patched.min.js' %}?v={{ version }}"></script>
<script type="text/javascript">
var favicon = new Favico({
type: 'circle',
bgColor: '{{ theme.env_color }}',
textColor: '#FFFFFF',
animation: 'none'
});
favicon.badge(' ');
</script>
{% endif %}
{% endif %}
@@ -0,0 +1,7 @@
{% load static %}
{% 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>
<script type="text/javascript" src="{% static 'admin_interface/related-modal/related-modal.js' %}?v={{ version }}"></script>
{% endif %}