33da2d53b779656e23dfb86b3ce3cf889856d656
[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         '2022': {
26             'source_filenames': [
27                 'contrib/jquery-ui-1.13.1.custom/jquery-ui.css',
28                 'css/jquery.countdown.css',
29                 '2022/styles/main.scss',
30                 '2022/more.scss',
31                 'chunks/edit.scss',
32             ],
33             'output_filename': 'css/compressed/2022.css',
34         },
35         'main': {
36             # styles both for mobile and for big screen
37             'source_filenames': [
38                 'css/import/gelasio.css',
39
40                 'css/jquery.countdown.css',
41                 'jplayer/jplayer.blue.monday.css',
42
43                 'sponsors/css/sponsors.css',
44
45                 'annoy/banner.scss',
46
47                 'css/ui-lightness/jquery-ui-1.8.16.custom.css',
48
49                 'css/tlite.css',
50
51                 'scss/main.scss',
52                 'club/club.scss',
53             ],
54             'output_filename': 'css/compressed/main.css',
55         },
56         'book': {
57             'source_filenames': [
58                 'css/import/gelasio.css',
59                 'css/master.book.css',
60             ],
61             'output_filename': 'css/compressed/book.css',
62         },
63         'book_text': {
64             'source_filenames': [
65                 'css/import/gelasio.css',
66                 'scss/book_text.scss',
67                 'css/new.book.css',
68                 'annoy/banner.scss',
69                 'annoy/book_text.scss',
70
71                 'css/master.picture.css',
72             ],
73             'output_filename': 'css/compressed/book_text.css',
74         },
75         'forum': {
76             'source_filenames': [
77                 'scss/forum.scss',
78             ],
79             'output_filename': 'css/compressed/compressed/forum.css',
80         },
81         'picture': {
82             'source_filenames': [
83                 'css/import/gelasio.css',
84                 'css/master.book.css',
85                 'css/master.picture.css',
86             ],
87             'output_filename': 'css/compressed/picture.css',
88         },
89         'player': {
90             'source_filenames': [
91                 'jplayer/jplayer.blue.monday.css',
92                 'player/player.css',
93             ],
94             'output_filename': 'css/compressed/player.css',
95         },
96         'simple': {
97             'source_filenames': ('css/simple.css',),
98             'output_filename': 'css/compressed/simple.css',
99         },
100         'widget': {
101             'source_filenames': ('scss/widget.scss',),
102             'output_filename': 'css/compressed/widget.css',
103         },
104     },
105     'JAVASCRIPT': {
106         'base': {
107             'source_filenames': (
108                 'js/contrib/jquery.cycle2.min.js',
109                 'js/contrib/jquery.jqmodal.js',
110                 'js/contrib/jquery.form.js',
111                 'js/contrib/jquery.paging.min.js',
112                 'js/contrib/jquery.countdown.js', 'js/contrib/jquery.countdown-pl.js',
113                 'js/contrib/jquery.countdown-de.js', 'js/contrib/jquery.countdown-uk.js',
114                 'js/contrib/jquery.countdown-es.js', 'js/contrib/jquery.countdown-lt.js',
115                 'js/contrib/jquery.countdown-ru.js', 'js/contrib/jquery.countdown-fr.js',
116                 'js/contrib/jquery.shorten.js',
117
118                 'js/contrib/jquery-ui-1.8.16.custom.min.js',
119
120                 'js/contrib/tlite.min.js',
121
122                 'jplayer/jquery.jplayer.min.js',
123                 'jplayer/jplayer.playlist.min.js',
124                 'player/player.js',
125
126                 'js/locale.js',
127                 'js/dialogs.js',
128                 'js/base.js',
129                 'pdcounter/pdcounter.js',
130                 'sponsors/js/sponsors.js',
131                 'player/openplayer.js',
132                 'js/search.js',
133                 'funding/funding.js',
134                 'club/form.js',
135
136                 'annoy/banner.js',
137                 ),
138             'output_filename': 'js/base.min.js',
139         },
140         '2022': {
141             'source_filenames': [
142                 '2022/scripts/vendor.js',
143                 'contrib/jquery-ui-1.13.1.custom/jquery-ui.js',
144                 'js/search.js',
145                 'js/2022.js',
146                 '2022/book/filter.js',
147                 'chunks/edit.js',
148                 '2022/scripts/modernizr.js',
149                 '2021/scripts/main.js',
150
151                 'js/contrib/jquery.cycle2.min.js',
152                 'sponsors/js/sponsors.js',
153
154                 'js/contrib/jquery.countdown.js', 'js/contrib/jquery.countdown-pl.js',
155                 'js/contrib/jquery.countdown-de.js', 'js/contrib/jquery.countdown-uk.js',
156                 'js/contrib/jquery.countdown-es.js', 'js/contrib/jquery.countdown-lt.js',
157                 'js/contrib/jquery.countdown-ru.js', 'js/contrib/jquery.countdown-fr.js',
158                 'pdcounter/pdcounter.js',
159
160             ],
161             'output_filename': 'js/2022.min.js'
162         },
163         'player': {
164             'source_filenames': [
165                 'jplayer/jquery.jplayer.min.js',
166                 'jplayer/jplayer.playlist.min.js',
167                 'player/player.js',
168             ],
169             'output_filename': 'js/player.min.js',
170         },
171         '2022_player': {
172             'source_filenames': [
173                 'js/contrib/jplayer/jquery.jplayer.min.js',
174                 'js/contrib/jplayer/jplayer.playlist.min.js',
175                 'player/2022_player.js',
176             ],
177             'output_filename': 'js/2022_player.min.js',
178         },
179         'book': {
180             'source_filenames': [
181                 'js/contrib/jquery.eventdelegation.js',
182                 'js/contrib/jquery.scrollto.js',
183                 'js/contrib/jquery.highlightfade.js',
184                 'js/book_text/other.js',
185                 'js/book.js',
186
187                 'js/contrib/raphael-min.js',
188                 'js/contrib/progressSpin.min.js',
189                 'js/picture.js',
190             ],
191             'output_filename': 'js/book.min.js',
192         },
193         'book_text': {
194             'source_filenames': [
195                 'js/contrib/jquery.cycle2.min.js',
196                 'js/contrib/jquery.form.js',
197                 'js/contrib/jquery.jqmodal.js',
198                 'js/book_text/info.js',
199                 'js/book_text/menu.js',
200                 'js/book_text/note.js',
201                 'js/book_text/references.js',
202                 'js/book_text/settings.js',
203                 'js/book_text/toc.js',
204                 'js/locale.js',
205                 'js/dialogs.js',
206                 'annoy/book_text.js',
207
208                 'js/contrib/jquery.highlightfade.js',
209                 'js/contrib/raphael-min.js',
210                 'player/openplayer.js',
211                 'js/contrib/progressSpin.min.js',
212                 'annoy/banner.js',
213             ],
214             'output_filename': 'js/book_text.js',
215         },
216         'picture': {
217             'source_filenames': [
218                 'js/picture.js',
219             ],
220             'output_filename': 'js/picture.min.js',
221         },
222         'book_ie': {
223             'source_filenames': ('js/contrib/ierange-m2.js',),
224             'output_filename': 'js/book_ie.min.js',
225         },
226         'widget': {
227             'source_filenames': (
228                 'js/contrib/jquery.js',
229                 'js/contrib/jquery-ui-1.8.16.custom.min.js',
230                 'js/search.js',
231                 'js/widget_run.js',
232             ),
233             'output_filename': 'js/widget.min.js',
234         },
235     },
236     'CSS_COMPRESSOR': None,
237     'JS_COMPRESSOR': 'pipeline.compressors.jsmin.JSMinCompressor',
238     'COMPILERS': (
239         'libsasscompiler.LibSassCompiler',
240     )
241 }
242
243 STATICFILES_STORAGE = 'fnpdjango.pipeline_storage.GzipPipelineManifestStorage'
244
245 # PIPELINE_PYSCSS_BINARY = '/usr/bin/env pyscss'
246 # PIPELINE_PYSCSS_ARGUMENTS = ''
247
248
249 STATICFILES_FINDERS = [
250     'django.contrib.staticfiles.finders.FileSystemFinder',
251     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
252     'pipeline.finders.CachedFileFinder',
253     'pipeline.finders.PipelineFinder',
254 ]