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