Преглед на файлове

compressor installed and enabled

Juan Carlos преди 5 години
родител
ревизия
463dfc5182
променени са 3 файла, в които са добавени 39 реда и са изтрити 35 реда
  1. 5 3
      marktplatz/templates/marktplatz/add.html
  2. 11 0
      project_base/settings.py
  3. 23 32
      project_base/templates/base_generic.html

+ 5 - 3
marktplatz/templates/marktplatz/add.html

@@ -1,5 +1,6 @@
 {% extends "base_generic.html" %}
 {% load static %}
+{% load compress %}
 {% load crispy_forms_tags %}
 {% crispy product product.helper %}
 {% crispy credits credits.helper %}
@@ -73,9 +74,10 @@
      
 </div>
 
-<script src="{% static "jquery/dist/jquery.js" %}"></script>
-<script src="{% static "ajaxuploader/js/fileuploader.js" %}"></script>
-<script src="{% static "file_form/file_form.js" %}"></script>
+  {% compress js  %}
+  <script src="{% static "ajaxuploader/js/fileuploader.js" %}"></script>
+  <script src="{% static "file_form/file_form.js" %}"></script>
+  {% endcompress %}
 <script>
   $(function() {
     initUploadFields($('#upload_mab'));

+ 11 - 0
project_base/settings.py

@@ -237,6 +237,7 @@ INSTALLED_APPS = [
     'fullurl',
     'django_user_agents',
      'email_obfuscator',
+     'compressor',
 
     'project_base.apps.PostOfficeBase',
     'project_base.apps.project_base',
@@ -272,6 +273,16 @@ INTERNAL_IPS = [
     # ...
 ]
 
+# for compressor
+STATICFILES_FINDERS = (
+    'django.contrib.staticfiles.finders.FileSystemFinder',
+    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
+    # other finders..
+    'compressor.finders.CompressorFinder',
+)
+
+COMPRESS_ENABLED = True
+
 #
 #
 #

+ 23 - 32
project_base/templates/base_generic.html

@@ -1,4 +1,5 @@
 {% load fullurl %}
+{% load compress %}
 <!DOCTYPE html>
 <html lang="de">
 <head>
@@ -7,34 +8,33 @@
     <title>{% block title %} {{ config.WEBSITE_TITEL }} {% endblock %}</title>
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
     {% load static %}
-
     <link rel="icon" href="{% static 'favicon.ico'%}">
     <link rel="apple-touch-icon" href="{% static 'favicon.ico'%}">
-
-
+    {% compress css %}
     <link rel="stylesheet" href="{% static 'css/bootstrap.min.css'%}" >
     <link rel="stylesheet" href="{% static 'css/styles.css' %}">
     <link href="{% static '/fontawesome/css/all.css'' %}" rel="stylesheet">
+    {% endcompress %}
+    {% compress js  %}
     <script src="{% static 'jquery-3.2.1.slim.min.js' %}" ></script>
     <script src="{% static 'popper.min.js' %}" ></script>
     <script src="{% static 'bootstrap.min.js' %}" ></script>
     <script src="{% static 'jquery.min.js' %}"></script>
-
+    {% endcompress %}
 
     <style media="screen">
+      .mab-navbar {
 
-      .mab-navbar{
-
-        	padding-left: 15px;
-        	padding-bottom: 4px;
-        	margin-bottom: 16px;
-        	position: sticky;
-        	top: 0;
-        	z-index: 2;
-        	background-color: #FCFCFC;
-        	padding-right: 15px;
-          border-bottom: 1px solid #469CA8;
-          /* box-shadow: 0 8px 4px -6px gray; */
+        padding-left: 15px;
+        padding-bottom: 4px;
+        margin-bottom: 16px;
+        position: sticky;
+        top: 0;
+        z-index: 2;
+        background-color: #FCFCFC;
+        padding-right: 15px;
+        border-bottom: 1px solid #469CA8;
+        /* box-shadow: 0 8px 4px -6px gray; */
       }
 
 
@@ -42,15 +42,16 @@
         cursor: pointer;
       }
 
-      .text-decoration-none, .text-decoration-none:hover, .text-decoration-none a:hover{
+      .text-decoration-none,
+      .text-decoration-none:hover,
+      .text-decoration-none a:hover {
         text-decoration: none;
       }
-
     </style>
 
 
 
-    <style>
+    <style media="screen">
       /* The Modal (background) */
       .modal {
         display: none;
@@ -101,7 +102,6 @@
 
 
       .mab-menu-mega {
-
         padding: .15em .75em .15em 0.75em;
         border-style: solid;
         border-width: 0px;
@@ -115,7 +115,6 @@
         /* font-family: NeuzeitGro-Bla; */
         text-align: center;
         margin: 5px 10px 5px 10px;
-
       }
 
 
@@ -128,17 +127,14 @@
         color: #469CA8;
         padding: 12px 8px 12px 8px;
         display: block;
-
       }
 
-      .mab-nav-fix{
-
+      .mab-nav-fix {
         padding-top: 8px;
       }
 
       .mab-menu-elm:hover {
         color: #FFF;
-
       }
 
       .mab-logo {
@@ -159,8 +155,8 @@
         width: 100%;
         height: 100%;
         overflow: auto;
-        background-color: rgb(0,0,0);
-        background-color: rgba(0,0,0,0.4);
+        background-color: rgb(0, 0, 0);
+        background-color: rgba(0, 0, 0, 0.4);
       }
 
       .modal-content {
@@ -184,13 +180,8 @@
         text-decoration: none;
         cursor: pointer;
       }
-
-
-
-
     </style>
 
-
     {% block script %}
 
     {% endblock %}