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