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