From 7e7a05be8a63c798c59a23ad6188637faf632c3d Mon Sep 17 00:00:00 2001
From: "N. Geisler" <ngeisler@fachschaft.informatik.tu-darmstadt.de>
Date: Sun, 17 Jan 2021 15:54:52 +0100
Subject: [PATCH] set different color accents in admin interface when deployed
 for production

---
 .../admin/AKModel/ak_csv_export.html          |   2 +-
 .../admin/AKModel/message_delete.html         |   2 +-
 AKModel/templates/admin/AKModel/status.html   |   2 +-
 .../admin/AKScheduling/scheduling.html        |   2 +-
 .../admin/AKScheduling/unscheduled.html       |   2 +-
 static_common/common/css/admin-color.css      | 160 ++++++++++++++++++
 .../{admin_base.html => admin/base_site.html} |   7 +
 7 files changed, 172 insertions(+), 5 deletions(-)
 create mode 100644 static_common/common/css/admin-color.css
 rename templates/{admin_base.html => admin/base_site.html} (65%)

diff --git a/AKModel/templates/admin/AKModel/ak_csv_export.html b/AKModel/templates/admin/AKModel/ak_csv_export.html
index d73a24f5..b6f1e089 100644
--- a/AKModel/templates/admin/AKModel/ak_csv_export.html
+++ b/AKModel/templates/admin/AKModel/ak_csv_export.html
@@ -1,4 +1,4 @@
-{% extends "admin_base.html" %}
+{% extends "admin/base_site.html" %}
 
 {% load tz %}
 
diff --git a/AKModel/templates/admin/AKModel/message_delete.html b/AKModel/templates/admin/AKModel/message_delete.html
index df8ac3cb..03b5899b 100644
--- a/AKModel/templates/admin/AKModel/message_delete.html
+++ b/AKModel/templates/admin/AKModel/message_delete.html
@@ -1,4 +1,4 @@
-{% extends "admin_base.html" %}
+{% extends "admin/base_site.html" %}
 {% load tags_AKModel %}
 
 {% load i18n %}
diff --git a/AKModel/templates/admin/AKModel/status.html b/AKModel/templates/admin/AKModel/status.html
index ab04ffd7..032181e5 100644
--- a/AKModel/templates/admin/AKModel/status.html
+++ b/AKModel/templates/admin/AKModel/status.html
@@ -1,4 +1,4 @@
-{% extends "admin_base.html" %}
+{% extends "admin/base_site.html" %}
 {% load tags_AKModel %}
 
 {% load i18n %}
diff --git a/AKScheduling/templates/admin/AKScheduling/scheduling.html b/AKScheduling/templates/admin/AKScheduling/scheduling.html
index 6403b51a..980b3bea 100644
--- a/AKScheduling/templates/admin/AKScheduling/scheduling.html
+++ b/AKScheduling/templates/admin/AKScheduling/scheduling.html
@@ -1,4 +1,4 @@
-{% extends "admin_base.html" %}
+{% extends "admin/base_site.html" %}
 {% load tags_AKModel %}
 
 {% load i18n %}
diff --git a/AKScheduling/templates/admin/AKScheduling/unscheduled.html b/AKScheduling/templates/admin/AKScheduling/unscheduled.html
index 2fc9eb71..18bbe051 100644
--- a/AKScheduling/templates/admin/AKScheduling/unscheduled.html
+++ b/AKScheduling/templates/admin/AKScheduling/unscheduled.html
@@ -1,4 +1,4 @@
-{% extends "admin_base.html" %}
+{% extends "admin/base_site.html" %}
 {% load tags_AKModel %}
 
 {% load i18n %}
diff --git a/static_common/common/css/admin-color.css b/static_common/common/css/admin-color.css
new file mode 100644
index 00000000..41de66b0
--- /dev/null
+++ b/static_common/common/css/admin-color.css
@@ -0,0 +1,160 @@
+#branding h1, #branding h1 a:link, #branding h1 a:visited {
+    color: #fff;
+}
+
+#header {
+    background: #7a1324;
+    color: #fff;
+}
+#header a:link, #header a:visited {
+    color: #fff;
+}
+
+#header a:hover {
+    color: #fff;
+}
+
+div.breadcrumbs {
+    background: #a4585d;
+    color: #c4dce8;
+}
+div.breadcrumbs a.active {
+    color: #c4dce8;
+!important;
+    font-weight: 300;
+}
+
+div.breadcrumbs a:focus, div.breadcrumbs a:hover {
+    color: #c4dce8;
+!important;
+    font-weight: 300;
+}
+
+.select2-container--admin-autocomplete .select2-results__option--highlighted[aria-selected] {
+    background-color: #292D32;
+}
+
+.paginator a:link, .paginator a:visited {
+    background: #292D32;
+}
+
+.button, input[type=submit], input[type=button], .submit-row input, a.button {
+    background: #a4585d;
+}
+.button:hover, input[type=submit]:hover, input[type=button]:hover {
+    background: #878787;
+}
+
+.module h2, .module caption, .inline-group h2 {
+    background: #a4585d;
+}
+#user-tools a:focus, #user-tools a:hover {
+    border: 0;
+    color: #ddd;
+}
+
+.selector-chosen h2 {
+    background: #a4585d !important;
+}
+
+.calendar td.selected a {
+    background: #a4585d !important;
+}
+
+.calendar td a:focus, .timelist a:focus,
+.calendar td a:hover, .timelist a:hover {
+    background: #a4585d !important;
+}
+
+#changelist-filter li.selected a {
+    color: #444;
+}
+
+fieldset.collapsed .collapse-toggle {
+    color: #444;
+}
+
+a:link, a:visited {
+    color: #777;
+}
+
+a:focus, a:hover {
+    color: #999;
+}
+
+table thead th.sorted .sortoptions a.sortremove:focus:after,
+table thead th.sorted .sortoptions a.sortremove:hover:after {
+    color: #444;
+}
+
+a.active.selector-chooseall:focus, a.active.selector-clearall:focus,
+a.active.selector-chooseall:hover, a.active.selector-clearall:hover {
+    color: #999;
+}
+
+.calendar td a:active, .timelist a:active {
+    background: #444;
+}
+
+.change-list ul.toplinks .date-back a:focus,
+.change-list ul.toplinks .date-back a:hover {
+    color: #222;
+}
+
+.paginator a.showall:focus, .paginator a.showall:hover {
+    color: #222;
+}
+
+.paginator a:focus, .paginator a:hover {
+    background: #222;
+}
+
+#changelist-filter a:focus, #changelist-filter a:hover,
+#changelist-filter li.selected a:focus,
+#changelist-filter li.selected a:hover {
+    color: #222;
+}
+
+.calendar td a:active, .timelist a:active {
+    background: #292D32;
+    color: white;
+}
+
+.calendar caption, .calendarbox h2 {
+    background: #999;
+}
+
+.button.default, input[type=submit].default, .submit-row input.default {
+    background: #7a1324;
+}
+
+.button.default:hover, input[type=submit].default:hover {
+    background: #191D22;
+}
+
+.select2-container--admin-autocomplete .select2-results__option--highlighted[aria-selected] {
+    background-color: #292D32;
+}
+
+.button.default, input[type=submit].default, .submit-row input.default {
+    background: #7a1324;
+}
+
+.object-tools a:focus, .object-tools a:hover {
+    background-color: #292D32;
+}
+
+input[type=file]::-webkit-file-upload-button:hover {
+    border: 0;
+    background: #292D32;
+}
+
+#changelist-filter {
+    top: -250px;
+    right: 15px;
+}
+
+#changelist-filter h2 {
+    padding-top: 0px;
+    padding-bottom: 0px
+}
diff --git a/templates/admin_base.html b/templates/admin/base_site.html
similarity index 65%
rename from templates/admin_base.html
rename to templates/admin/base_site.html
index 1022bb45..bcb2a34f 100644
--- a/templates/admin_base.html
+++ b/templates/admin/base_site.html
@@ -2,6 +2,13 @@
 
 {% load bootstrap4 %}
 {% load fontawesome_5 %}
+{% load static %}
+
+{% block extrastyle %}
+    {% if not debug %}
+        <link rel="stylesheet" type="text/css" href="{% static "common/css/admin-color.css" %}"/>
+    {% endif %}
+{% endblock %}
 
 {% block extrahead %}
     {% bootstrap_css %}
-- 
GitLab