Commit 4cb22d55 authored by Olga Brani's avatar Olga Brani Committed by Athina Bekakou
Browse files

admin-ui: Use compressed css for production

Compass outputs both extended and compressed css files.
Extended css files are used when settings.DEBUG is True and
compressed ones are used in production mode.
parent 34b8db95
......@@ -22,3 +22,13 @@ output_style = :nested
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
if environment == :development
line_comments = true
output_style = :nested
if environment == :production
line_comments = false
output_style = :compressed
css_dir = "css/min/"
{% load admin_tags %}
<!DOCTYPE html>
<html lang="en">
......@@ -5,12 +6,13 @@
<link rel="shortcut icon" href="{{ BRANDING_FAVICON_URL }}" />
<title>{{BRANDING_SERVICE_NAME}} admin</title>
<link href="{{ ADMIN_MEDIA_URL }}css/icon-fonts.css" rel="stylesheet">
<!-- There is no minified version of jquery.dataTables.css in DataTables 1.10.0 -->
<link href="{{ ADMIN_MEDIA_URL }}css/jquery.dataTables.css" rel="stylesheet">
{% if request.COOKIES.theme == 'dark' %}
<link href="{{ ADMIN_MEDIA_URL }}css/main.css" rel="stylesheet">
<link href="{{ ADMIN_MEDIA_URL }}css/{% min_dir %}main.css" rel="stylesheet">
{% else %}
<link href="{{ ADMIN_MEDIA_URL }}css/main-light.css" rel="stylesheet">
<link href="{{ ADMIN_MEDIA_URL }}css/{% min_dir %}main-light.css" rel="stylesheet">
{% endif %}
<link href="{{ ADMIN_MEDIA_URL }}css/ie7.css" rel="stylesheet"> -->
......@@ -17,6 +17,7 @@
from importlib import import_module
from collections import OrderedDict
from django import template
from django.conf import settings
import logging
import django_filters
......@@ -422,3 +423,14 @@ def show_more_exception_message(assoc):
if assoc.type == "user":
return """</br>Alternatively, you may consult the "Members" tab of the project."""
return ""
def min_dir():
Return minified files folder for production environment
if settings.DEBUG == False:
return 'min/'
return ''
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment