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