0d599f2fc0abf90720b3f303349316be255e3945
[wolnelektury.git] / src / wolnelektury / settings / static.py
1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 #
5 from os import path
6 from .paths import VAR_DIR
7
8 # Absolute path to the directory that holds media.
9 # Example: "/home/media/media.lawrence.com/"
10 MEDIA_ROOT = path.join(VAR_DIR, 'media/')
11 STATIC_ROOT = path.join(VAR_DIR, 'static/')
12 SEARCH_INDEX = path.join(VAR_DIR, 'search_index/')
13
14 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
15 # trailing slash if there is a path component (optional in other cases).
16 # Examples: "http://media.lawrence.com", "http://example.com/media/"
17 MEDIA_URL = '/media/'
18 STATIC_URL = '/static/'
19
20 IMAGE_DIR = 'book/pictures/'
21
22 # CSS and JavaScript file groups
23
24 PIPELINE = {
25     'STYLESHEETS': {
26         'main': {
27             # styles both for mobile and for big screen
28             'source_filenames': [
29                 'css/jquery.countdown.css',
30                 'jplayer/jplayer.blue.monday.css',
31
32                 'sponsors/css/sponsors.css',
33
34                 'css/annoy.css',
35
36                 'css/ui-lightness/jquery-ui-1.8.16.custom.css',
37
38                 'css/tlite.css',
39
40                 'scss/main.scss',
41             ],
42             'output_filename': 'css/compressed/main.css',
43         },
44         'book': {
45             'source_filenames': [
46                 'css/master.book.css',
47             ],
48             'output_filename': 'css/compressed/book.css',
49         },
50         'book_text': {
51             'source_filenames': [
52                 'scss/book_text.scss',
53                 'css/new.book.css',
54
55                 'css/master.picture.css',
56             ],
57             'output_filename': 'css/compressed/book_text.css',
58         },
59         'picture': {
60             'source_filenames': [
61                 'css/master.book.css',
62                 'css/master.picture.css',
63             ],
64             'output_filename': 'css/compressed/picture.css',
65         },
66         'player': {
67             'source_filenames': [
68                 'jplayer/jplayer.blue.monday.css',
69                 'player/player.css',
70             ],
71             'output_filename': 'css/compressed/player.css',
72         },
73         'simple': {
74             'source_filenames': ('css/simple.css',),
75             'output_filename': 'css/compressed/simple.css',
76         },
77         'widget': {
78             'source_filenames': ('scss/widget.scss',),
79             'output_filename': 'css/compressed/widget.css',
80         },
81     },
82     'JAVASCRIPT': {
83         'base': {
84             'source_filenames': (
85                 'js/contrib/jquery.cycle.min.js',
86                 'js/contrib/jquery.jqmodal.js',
87                 'js/contrib/jquery.form.js',
88                 'js/contrib/jquery.paging.min.js',
89                 'js/contrib/jquery.countdown.js', 'js/contrib/jquery.countdown-pl.js',
90                 'js/contrib/jquery.countdown-de.js', 'js/contrib/jquery.countdown-uk.js',
91                 'js/contrib/jquery.countdown-es.js', 'js/contrib/jquery.countdown-lt.js',
92                 'js/contrib/jquery.countdown-ru.js', 'js/contrib/jquery.countdown-fr.js',
93                 'js/contrib/jquery.shorten.js',
94
95                 'js/contrib/jquery-ui-1.8.16.custom.min.js',
96
97                 'js/contrib/tlite.min.js',
98
99                 'jplayer/jquery.jplayer.min.js',
100                 'jplayer/jplayer.playlist.min.js',
101                 'player/player.js',
102
103                 'js/locale.js',
104                 'js/dialogs.js',
105                 'js/base.js',
106                 'pdcounter/pdcounter.js',
107                 'sponsors/js/sponsors.js',
108                 'player/openplayer.js',
109                 'js/search.js',
110                 'funding/funding.js',
111                 'club/form.js',
112
113                 'js/annoy.js',
114                 ),
115             'output_filename': 'js/base.min.js',
116         },
117         'player': {
118             'source_filenames': [
119                 'jplayer/jquery.jplayer.min.js',
120                 'jplayer/jplayer.playlist.min.js',
121                 'player/player.js',
122             ],
123             'output_filename': 'js/player.min.js',
124         },
125         'book': {
126             'source_filenames': [
127                 'js/contrib/jquery.eventdelegation.js',
128                 'js/contrib/jquery.scrollto.js',
129                 'js/contrib/jquery.highlightfade.js',
130                 'js/book_text/other.js',
131                 'js/book.js',
132
133                 'js/contrib/raphael-min.js',
134                 'js/contrib/progressSpin.min.js',
135                 'js/picture.js',
136             ],
137             'output_filename': 'js/book.min.js',
138         },
139         'book_text': {
140             'source_filenames': [
141                 'js/contrib/jquery.form.js',
142                 'js/contrib/jquery.jqmodal.js',
143                 'js/book_text/info.js',
144                 'js/book_text/menu.js',
145                 'js/book_text/note.js',
146                 'js/book_text/settings.js',
147                 'js/book_text/toc.js',
148                 'js/locale.js',
149                 'js/dialogs.js',
150
151                 'js/contrib/jquery.highlightfade.js',
152                 'js/contrib/raphael-min.js',
153                 'player/openplayer.js',
154                 'js/contrib/progressSpin.min.js',
155                 'js/picture.js',
156             ],
157             'output_filename': 'js/book_text.js',
158         },
159         'book_ie': {
160             'source_filenames': ('js/contrib/ierange-m2.js',),
161             'output_filename': 'js/book_ie.min.js',
162         },
163         'widget': {
164             'source_filenames': (
165                 'js/contrib/jquery.js',
166                 'js/contrib/jquery-ui-1.8.16.custom.min.js',
167                 'js/search.js',
168                 'js/widget_run.js',
169             ),
170             'output_filename': 'js/widget.min.js',
171         },
172     },
173     'CSS_COMPRESSOR': None,
174     'JS_COMPRESSOR': 'pipeline.compressors.jsmin.JSMinCompressor',
175     'COMPILERS': (
176         'pipeline.compilers.sass.SASSCompiler',
177         # We could probably use PySCSS instead,
178         # but they have some serious problems, like:
179         # https://github.com/Kronuz/pyScss/issues/166 (empty list syntax)
180         # https://github.com/Kronuz/pyScss/issues/258 (bad @media order)
181         # 'pyscss_compiler.PySCSSCompiler',
182     )
183 }
184
185 STATICFILES_STORAGE = 'fnpdjango.pipeline_storage.GzipPipelineCachedStorage'
186 #STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
187
188 # PIPELINE_PYSCSS_BINARY = '/usr/bin/env pyscss'
189 # PIPELINE_PYSCSS_ARGUMENTS = ''
190
191
192 STATICFILES_FINDERS = [
193     'django.contrib.staticfiles.finders.FileSystemFinder',
194     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
195     'pipeline.finders.CachedFileFinder',
196     'pipeline.finders.PipelineFinder',
197 ]