625b4c77fab439c5ab6fff7b17ea81f17c3cf963
[wolnelektury.git] / src / wolnelektury / settings / static.py
1 from os import path
2 from .paths import VAR_DIR
3
4 # Absolute path to the directory that holds media.
5 # Example: "/home/media/media.lawrence.com/"
6 MEDIA_ROOT = path.join(VAR_DIR, 'media/')
7 STATIC_ROOT = path.join(VAR_DIR, 'static/')
8 SEARCH_INDEX = path.join(VAR_DIR, 'search_index/')
9
10 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
11 # trailing slash if there is a path component (optional in other cases).
12 # Examples: "http://media.lawrence.com", "http://example.com/media/"
13 MEDIA_URL = '/media/'
14 STATIC_URL = '/static/'
15
16 # CSS and JavaScript file groups
17
18 PIPELINE = {
19     'PIPELINE_ENABLED': False,
20     'STYLESHEETS': {
21     'main': {
22         # styles both for mobile and for big screen
23         'source_filenames': [
24             'css/jquery.countdown.css',
25             'jplayer/jplayer.blue.monday.css',
26
27             'sponsors/css/sponsors.css',
28
29             'uni_form/uni-form.css',
30             'uni_form/default.uni-form.css',
31
32             'css/ui-lightness/jquery-ui-1.8.16.custom.css',
33
34             'scss/main.scss',
35         ],
36         'output_filename': 'css/compressed/main.css',
37     },
38     'book': {
39         'source_filenames': [
40             'css/master.book.css',
41         ],
42         'output_filename': 'css/compressed/book.css',
43     },
44     'book_text': {
45         'source_filenames': [
46             'scss/book_text.scss',
47             'css/new.book.css',
48
49             'css/master.picture.css',
50         ],
51         'output_filename': 'css/compressed/book_text.css',
52     },
53     'picture': {
54         'source_filenames': [
55             'css/master.book.css',
56             'css/master.picture.css',
57         ],
58         'output_filename': 'css/compressed/picture.css',
59     },
60     'player': {
61         'source_filenames': [
62             'jplayer/jplayer.blue.monday.css',
63             'player/player.css',
64         ],
65         'output_filename': 'css/compressed/player.css',
66     },
67     'simple': {
68         'source_filenames': ('css/simple.css',),
69         'output_filename': 'css/compressed/simple.css',
70     },
71     'widget': {
72         'source_filenames': ('scss/widget.scss',),
73         'output_filename': 'css/compressed/widget.css',
74     },
75     },
76     'JAVASCRIPT': {
77     'base': {
78         'source_filenames': (
79             'js/contrib/jquery.cycle.min.js',
80             'js/contrib/jquery.jqmodal.js',
81             'js/contrib/jquery.form.js',
82             'js/contrib/jquery.paging.min.js',
83             'js/contrib/jquery.countdown.js', 'js/contrib/jquery.countdown-pl.js',
84             'js/contrib/jquery.countdown-de.js', 'js/contrib/jquery.countdown-uk.js',
85             'js/contrib/jquery.countdown-es.js', 'js/contrib/jquery.countdown-lt.js',
86             'js/contrib/jquery.countdown-ru.js', 'js/contrib/jquery.countdown-fr.js',
87
88             'js/contrib/jquery-ui-1.8.16.custom.min.js',
89
90             'jplayer/jquery.jplayer.min.js',
91             'jplayer/jplayer.playlist.min.js',
92             'player/player.js',
93
94             'js/locale.js',
95             'js/dialogs.js',
96             'js/base.js',
97             'pdcounter/pdcounter.js',
98             'sponsors/js/sponsors.js',
99             'player/openplayer.js',
100             'js/search.js',
101             'funding/funding.js',
102
103             'uni_form/uni-form.js',
104             ),
105         'output_filename': 'js/base.min.js',
106     },
107     'player': {
108         'source_filenames': [
109             'jplayer/jquery.jplayer.min.js',
110             'jplayer/jplayer.playlist.min.js',
111             'player/player.js',
112         ],
113         'output_filename': 'js/player.min.js',
114     },
115     'book': {
116         'source_filenames': [
117             'js/contrib/jquery.eventdelegation.js',
118             'js/contrib/jquery.scrollto.js',
119             'js/contrib/jquery.highlightfade.js',
120             'js/book_text/other.js',
121             'js/book.js',
122
123             'js/contrib/raphael-min.js',
124             'js/contrib/progressSpin.min.js',
125             'js/picture.js',
126         ],
127         'output_filename': 'js/book.min.js',
128     },
129     'book_text': {
130         'source_filenames': [
131             'js/contrib/jquery.form.js',
132             'js/contrib/jquery.jqmodal.js',
133             'js/book_text/*.js',
134             'js/locale.js',
135             'js/dialogs.js',
136
137             'js/contrib/jquery.highlightfade.js',
138             'js/contrib/raphael-min.js',
139             'player/openplayer.js',
140             'js/contrib/progressSpin.min.js',
141             'js/picture.js',
142         ],
143         'output_filename': 'js/book_text.js',
144     },
145     'book_ie': {
146         'source_filenames': ('js/contrib/ierange-m2.js',),
147         'output_filename': 'js/book_ie.min.js',
148     },
149     'widget': {
150         'source_filenames': (
151             'js/contrib/jquery.js',
152             'js/contrib/jquery-ui-1.8.16.custom.min.js',
153             'js/search.js',
154             'js/widget_run.js',
155         ),
156         'output_filename': 'js/widget.min.js',
157     },
158     },
159     'CSS_COMPRESSOR': None,
160     'JS_COMPRESSOR': 'pipeline.compressors.jsmin.JSMinCompressor',
161     'COMPILERS': (
162         'pipeline.compilers.sass.SASSCompiler',
163         # We could probably use PySCSS instead,
164         # but they have some serious problems, like:
165         # https://github.com/Kronuz/pyScss/issues/166 (empty list syntax)
166         # https://github.com/Kronuz/pyScss/issues/258 (bad @media order)
167         #'pyscss_compiler.PySCSSCompiler',
168     )
169 }
170
171 #~ STATICFILES_STORAGE = 'fnpdjango.utils.pipeline_storage.GzipPipelineCachedStorage'
172
173 #PIPELINE_PYSCSS_BINARY = '/usr/bin/env pyscss'
174 #PIPELINE_PYSCSS_ARGUMENTS = ''
175
176
177 STATICFILES_FINDERS = [
178     'django.contrib.staticfiles.finders.FileSystemFinder',
179     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
180     'pipeline.finders.PipelineFinder',
181 ]