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