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