027879a33cbbbe64fa59fec3148efc10cc803720
[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     'STYLESHEETS': {
20     'main': {
21         # styles both for mobile and for big screen
22         'source_filenames': [
23             'css/jquery.countdown.css',
24
25             'sponsors/css/sponsors.css',
26
27             'uni_form/uni-form.css',
28             'uni_form/default.uni-form.css',
29
30             'css/ui-lightness/jquery-ui-1.8.16.custom.css',
31
32             'scss/main.scss',
33         ],
34         'output_filename': 'css/compressed/main.css',
35     },
36     'book': {
37         'source_filenames': [
38             'css/master.book.css',
39         ],
40         'output_filename': 'css/compressed/book.css',
41     },
42     'book_text': {
43         'source_filenames': [
44             'scss/book_text.scss',
45             'css/new.book.css',
46
47             'css/master.picture.css',
48         ],
49         'output_filename': 'css/compressed/book_text.css',
50     },
51     'picture': {
52         'source_filenames': [
53             'css/master.book.css',
54             'css/master.picture.css',
55         ],
56         'output_filename': 'css/compressed/picture.css',
57     },
58     'player': {
59         'source_filenames': [
60             'jplayer/jplayer.blue.monday.css',
61             'player/player.css',
62         ],
63         'output_filename': 'css/compressed/player.css',
64     },
65     'simple': {
66         'source_filenames': ('css/simple.css',),
67         'output_filename': 'css/compressed/simple.css',
68     },
69     'widget': {
70         'source_filenames': ('scss/widget.scss',),
71         'output_filename': 'css/compressed/widget.css',
72     },
73     },
74     'JAVASCRIPT': {
75     'base': {
76         'source_filenames': (
77             'js/contrib/jquery.cycle.min.js',
78             'js/contrib/jquery.jqmodal.js',
79             'js/contrib/jquery.form.js',
80             'js/contrib/jquery.countdown.js', 'js/contrib/jquery.countdown-pl.js',
81             'js/contrib/jquery.countdown-de.js', 'js/contrib/jquery.countdown-uk.js',
82             'js/contrib/jquery.countdown-es.js', 'js/contrib/jquery.countdown-lt.js',
83             'js/contrib/jquery.countdown-ru.js', 'js/contrib/jquery.countdown-fr.js',
84
85             'js/contrib/jquery-ui-1.8.16.custom.min.js',
86
87             'js/locale.js',
88             'js/dialogs.js',
89             'js/base.js',
90             'pdcounter/pdcounter.js',
91             'sponsors/js/sponsors.js',
92             'player/openplayer.js',
93             'js/search.js',
94             'funding/funding.js',
95
96             'uni_form/uni-form.js',
97             ),
98         'output_filename': 'js/base.min.js',
99     },
100     'player': {
101         'source_filenames': [
102             'jplayer/jquery.jplayer.min.js',
103             'jplayer/jplayer.playlist.min.js',
104             'player/player.js',
105         ],
106         'output_filename': 'js/player.min.js',
107     },
108     'book': {
109         'source_filenames': [
110             'js/contrib/jquery.eventdelegation.js',
111             'js/contrib/jquery.scrollto.js',
112             'js/contrib/jquery.highlightfade.js',
113             'js/book_text/other.js',
114             'js/book.js',
115
116             'js/contrib/raphael-min.js',
117             'js/contrib/progressSpin.min.js',
118             'js/picture.js',
119         ],
120         'output_filename': 'js/book.min.js',
121     },
122     'book_text': {
123         'source_filenames': [
124             'js/contrib/jquery.form.js',
125             'js/contrib/jquery.jqmodal.js',
126             'js/book_text/*.js',
127             'js/locale.js',
128             'js/dialogs.js',
129
130             'js/contrib/jquery.highlightfade.js',
131             'js/contrib/raphael-min.js',
132             'player/openplayer.js',
133             'js/contrib/progressSpin.min.js',
134             'js/picture.js',
135         ],
136         'output_filename': 'js/book_text.js',
137     },
138     'book_ie': {
139         'source_filenames': ('js/contrib/ierange-m2.js',),
140         'output_filename': 'js/book_ie.min.js',
141     },
142     'widget': {
143         'source_filenames': (
144             'js/contrib/jquery.js',
145             'js/contrib/jquery-ui-1.8.16.custom.min.js',
146             'js/search.js',
147             'js/widget_run.js',
148         ),
149         'output_filename': 'js/widget.min.js',
150     },
151     },
152     'CSS_COMPRESSOR': None,
153     'JS_COMPRESSOR': 'pipeline.compressors.jsmin.JSMinCompressor',
154     'COMPILERS': (
155         'pipeline.compilers.sass.SASSCompiler',
156         # We could probably use PySCSS instead,
157         # but they have some serious problems, like:
158         # https://github.com/Kronuz/pyScss/issues/166 (empty list syntax)
159         # https://github.com/Kronuz/pyScss/issues/258 (bad @media order)
160         #'pyscss_compiler.PySCSSCompiler',
161     )
162 }
163
164 #~ STATICFILES_STORAGE = 'fnpdjango.utils.pipeline_storage.GzipPipelineCachedStorage'
165
166 #PIPELINE_PYSCSS_BINARY = '/usr/bin/env pyscss'
167 #PIPELINE_PYSCSS_ARGUMENTS = ''
168
169
170 STATICFILES_FINDERS = [
171     'django.contrib.staticfiles.finders.FileSystemFinder',
172     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
173     'pipeline.finders.PipelineFinder',
174 ]