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