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