From 1493bbaac67573921d52303f2d7d15dca26ea787 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 19 Dec 2024 01:18:13 +1100 Subject: [PATCH] [Refactor] Template fix (#8710) * Commonize favicon template * Cleanup templates --- src/backend/InvenTree/templates/base.html | 49 +-------------- src/backend/InvenTree/templates/favicon.html | 20 ++++++ src/backend/InvenTree/templates/skeleton.html | 63 +------------------ 3 files changed, 22 insertions(+), 110 deletions(-) create mode 100644 src/backend/InvenTree/templates/favicon.html diff --git a/src/backend/InvenTree/templates/base.html b/src/backend/InvenTree/templates/base.html index c0e3e959a86d..60f824381297 100644 --- a/src/backend/InvenTree/templates/base.html +++ b/src/backend/InvenTree/templates/base.html @@ -19,49 +19,11 @@ - - - - - - - - - - - - - - - - - - +{% include "favicon.html" %} - - - - - - - - - - - - - - -{% block head %} -{% endblock head %} - {% block page_title %} {% inventree_title %} @@ -72,7 +34,6 @@ <body> <div class='main body wrapper container-fluid inventree-body'> - <div class='row flex-nowrap inventree-body'> <div class='col-auto px-1 sidebar-wrapper'> <div id='sidebar' class='collapse collapse-horizontal show' style='display: none;'> @@ -137,11 +98,6 @@ </div> </div> - -<!-- general JS --> -{% block js_load %} -{% endblock js_load %} - <script defer type='text/javascript'> $(document).ready(function () { @@ -174,8 +130,5 @@ </script> -{% block js %} -{% endblock js %} - </body> </html> diff --git a/src/backend/InvenTree/templates/favicon.html b/src/backend/InvenTree/templates/favicon.html new file mode 100644 index 000000000000..4bbb326454b7 --- /dev/null +++ b/src/backend/InvenTree/templates/favicon.html @@ -0,0 +1,20 @@ +{% load static %} + +<!-- Favicon --> +<link rel="apple-touch-icon" sizes="57x57" href="{% static 'img/favicon/apple-icon-57x57.png' %}"> +<link rel="apple-touch-icon" sizes="60x60" href="{% static 'img/favicon/apple-icon-60x60.png' %}"> +<link rel="apple-touch-icon" sizes="72x72" href="{% static 'img/favicon/apple-icon-72x72.png' %}"> +<link rel="apple-touch-icon" sizes="76x76" href="{% static 'img/favicon/apple-icon-76x76.png' %}"> +<link rel="apple-touch-icon" sizes="114x114" href="{% static 'img/favicon/apple-icon-114x114.png' %}"> +<link rel="apple-touch-icon" sizes="120x120" href="{% static 'img/favicon/apple-icon-120x120.png' %}"> +<link rel="apple-touch-icon" sizes="144x144" href="{% static 'img/favicon/apple-icon-144x144.png' %}"> +<link rel="apple-touch-icon" sizes="152x152" href="{% static 'img/favicon/apple-icon-152x152.png' %}"> +<link rel="apple-touch-icon" sizes="180x180" href="{% static 'img/favicon/apple-icon-180x180.png' %}"> +<link rel="icon" type="image/png" sizes="192x192" href="{% static 'img/favicon/android-icon-192x192.png' %}"> +<link rel="icon" type="image/png" sizes="32x32" href="{% static 'img/favicon/favicon-32x32.png' %}"> +<link rel="icon" type="image/png" sizes="96x96" href="{% static 'img/favicon/favicon-96x96.png' %}"> +<link rel="icon" type="image/png" sizes="16x16" href="{% static 'img/favicon/favicon-16x16.png' %}"> +<link rel="manifest" href="{% static 'img/favicon/manifest.json' %}"> +<meta name="msapplication-TileColor" content="#ffffff"> +<meta name="msapplication-TileImage" content="{% static 'img/favicon/ms-icon-144x144.png' %}"> +<meta name="theme-color" content="#ffffff"> diff --git a/src/backend/InvenTree/templates/skeleton.html b/src/backend/InvenTree/templates/skeleton.html index 985ad3d0c1e8..3e77e83f9fb3 100644 --- a/src/backend/InvenTree/templates/skeleton.html +++ b/src/backend/InvenTree/templates/skeleton.html @@ -10,45 +10,11 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> -<!-- Favicon --> -<link rel="apple-touch-icon" sizes="57x57" href="{% static 'img/favicon/apple-icon-57x57.png' %}"> -<link rel="apple-touch-icon" sizes="60x60" href="{% static 'img/favicon/apple-icon-60x60.png' %}"> -<link rel="apple-touch-icon" sizes="72x72" href="{% static 'img/favicon/apple-icon-72x72.png' %}"> -<link rel="apple-touch-icon" sizes="76x76" href="{% static 'img/favicon/apple-icon-76x76.png' %}"> -<link rel="apple-touch-icon" sizes="114x114" href="{% static 'img/favicon/apple-icon-114x114.png' %}"> -<link rel="apple-touch-icon" sizes="120x120" href="{% static 'img/favicon/apple-icon-120x120.png' %}"> -<link rel="apple-touch-icon" sizes="144x144" href="{% static 'img/favicon/apple-icon-144x144.png' %}"> -<link rel="apple-touch-icon" sizes="152x152" href="{% static 'img/favicon/apple-icon-152x152.png' %}"> -<link rel="apple-touch-icon" sizes="180x180" href="{% static 'img/favicon/apple-icon-180x180.png' %}"> -<link rel="icon" type="image/png" sizes="192x192" href="{% static 'img/favicon/android-icon-192x192.png' %}"> -<link rel="icon" type="image/png" sizes="32x32" href="{% static 'img/favicon/favicon-32x32.png' %}"> -<link rel="icon" type="image/png" sizes="96x96" href="{% static 'img/favicon/favicon-96x96.png' %}"> -<link rel="icon" type="image/png" sizes="16x16" href="{% static 'img/favicon/favicon-16x16.png' %}"> -<link rel="manifest" href="{% static 'img/favicon/manifest.json' %}"> -<meta name="msapplication-TileColor" content="#ffffff"> -<meta name="msapplication-TileImage" content="{% static 'img/favicon/ms-icon-144x144.png' %}"> -<meta name="theme-color" content="#ffffff"> - +{% include "favicon.html" %} <!-- CSS --> -<link rel="stylesheet" href="{% static 'bootstrap/css/bootstrap.min.css' %}"> -<link rel="stylesheet" href="{% static 'fontawesome/css/brands.css' %}"> -<link rel="stylesheet" href="{% static 'fontawesome/css/solid.css' %}"> -<link rel="stylesheet" href="{% static 'select2/css/select2.css' %}"> -<link rel="stylesheet" href="{% static 'select2/css/select2-bootstrap-5-theme.css' %}"> <link rel="stylesheet" href="{% static 'css/inventree.css' %}"> -{% block head_css %} -{% endblock head_css %} - -<style> - {% block css %} - {% endblock css %} -</style> - -{% block head %} -{% endblock head %} - <title> {% block page_title %} {% endblock page_title %} @@ -59,32 +25,5 @@ {% block body %} {% endblock body %} -<!-- Scripts --> -<script type="text/javascript" src="{% static 'script/jquery_3.3.1_jquery.min.js' %}"></script> -<script type='text/javascript' src="{% static 'script/jquery-ui/jquery-ui.min.js' %}"></script> -<script type="text/javascript" src="{% static 'bootstrap/js/bootstrap.bundle.min.js' %}"></script> -{% block body_scripts_general %} -{% endblock body_scripts_general %} - -<!-- general JS --> -<script type='text/javascript' src="{% static 'script/inventree/inventree.js' %}"></script> -<script type='text/javascript' src="{% static 'script/inventree/message.js' %}"></script> -{% block body_scripts_inventree %} -{% endblock body_scripts_inventree %} - -<!-- fontawesome --> -<script type='text/javascript' src="{% static 'fontawesome/js/solid.js' %}"></script> -<script type='text/javascript' src="{% static 'fontawesome/js/brands.js' %}"></script> -<script type='text/javascript' src="{% static 'fontawesome/js/fontawesome.js' %}"></script> - -{% block js_load %} -{% endblock js_load %} - -{% block js_base %} -{% endblock js_base %} - -{% block js %} -{% endblock js %} - </body> </html>