6f7938ded458a87a72c7b595a4010b1a001e2244
[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                 'uni_form/uni-form.css',
35                 'uni_form/default.uni-form.css',
36
37                 'css/ui-lightness/jquery-ui-1.8.16.custom.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
54                 'css/master.picture.css',
55             ],
56             'output_filename': 'css/compressed/book_text.css',
57         },
58         'picture': {
59             'source_filenames': [
60                 'css/master.book.css',
61                 'css/master.picture.css',
62             ],
63             'output_filename': 'css/compressed/picture.css',
64         },
65         'player': {
66             'source_filenames': [
67                 'jplayer/jplayer.blue.monday.css',
68                 'player/player.css',
69             ],
70             'output_filename': 'css/compressed/player.css',
71         },
72         'simple': {
73             'source_filenames': ('css/simple.css',),
74             'output_filename': 'css/compressed/simple.css',
75         },
76         'widget': {
77             'source_filenames': ('scss/widget.scss',),
78             'output_filename': 'css/compressed/widget.css',
79         },
80     },
81     'JAVASCRIPT': {
82         'base': {
83             'source_filenames': (
84                 'js/contrib/jquery.cycle.min.js',
85                 'js/contrib/jquery.jqmodal.js',
86                 'js/contrib/jquery.form.js',
87                 'js/contrib/jquery.paging.min.js',
88                 'js/contrib/jquery.countdown.js', 'js/contrib/jquery.countdown-pl.js',
89                 'js/contrib/jquery.countdown-de.js', 'js/contrib/jquery.countdown-uk.js',
90                 'js/contrib/jquery.countdown-es.js', 'js/contrib/jquery.countdown-lt.js',
91                 'js/contrib/jquery.countdown-ru.js', 'js/contrib/jquery.countdown-fr.js',
92
93                 'js/contrib/jquery-ui-1.8.16.custom.min.js',
94
95                 'jplayer/jquery.jplayer.min.js',
96                 'jplayer/jplayer.playlist.min.js',
97                 'player/player.js',
98
99                 'js/locale.js',
100                 'js/dialogs.js',
101                 'js/base.js',
102                 'pdcounter/pdcounter.js',
103                 'sponsors/js/sponsors.js',
104                 'player/openplayer.js',
105                 'js/search.js',
106                 'funding/funding.js',
107
108                 'uni_form/uni-form.js',
109                 ),
110             'output_filename': 'js/base.min.js',
111         },
112         'player': {
113             'source_filenames': [
114                 'jplayer/jquery.jplayer.min.js',
115                 'jplayer/jplayer.playlist.min.js',
116                 'player/player.js',
117             ],
118             'output_filename': 'js/player.min.js',
119         },
120         'book': {
121             'source_filenames': [
122                 'js/contrib/jquery.eventdelegation.js',
123                 'js/contrib/jquery.scrollto.js',
124                 'js/contrib/jquery.highlightfade.js',
125                 'js/book_text/other.js',
126                 'js/book.js',
127
128                 'js/contrib/raphael-min.js',
129                 'js/contrib/progressSpin.min.js',
130                 'js/picture.js',
131             ],
132             'output_filename': 'js/book.min.js',
133         },
134         'book_text': {
135             'source_filenames': [
136                 'js/contrib/jquery.form.js',
137                 'js/contrib/jquery.jqmodal.js',
138                 'js/book_text/*.js',
139                 'js/locale.js',
140                 'js/dialogs.js',
141
142                 'js/contrib/jquery.highlightfade.js',
143                 'js/contrib/raphael-min.js',
144                 'player/openplayer.js',
145                 'js/contrib/progressSpin.min.js',
146                 'js/picture.js',
147             ],
148             'output_filename': 'js/book_text.js',
149         },
150         'book_ie': {
151             'source_filenames': ('js/contrib/ierange-m2.js',),
152             'output_filename': 'js/book_ie.min.js',
153         },
154         'widget': {
155             'source_filenames': (
156                 'js/contrib/jquery.js',
157                 'js/contrib/jquery-ui-1.8.16.custom.min.js',
158                 'js/search.js',
159                 'js/widget_run.js',
160             ),
161             'output_filename': 'js/widget.min.js',
162         },
163     },
164     'CSS_COMPRESSOR': None,
165     'JS_COMPRESSOR': 'pipeline.compressors.jsmin.JSMinCompressor',
166     'COMPILERS': (
167         'pipeline.compilers.sass.SASSCompiler',
168         # We could probably use PySCSS instead,
169         # but they have some serious problems, like:
170         # https://github.com/Kronuz/pyScss/issues/166 (empty list syntax)
171         # https://github.com/Kronuz/pyScss/issues/258 (bad @media order)
172         # 'pyscss_compiler.PySCSSCompiler',
173     )
174 }
175
176 STATICFILES_STORAGE = 'fnpdjango.utils.pipeline_storage.GzipPipelineCachedStorage'
177
178 # PIPELINE_PYSCSS_BINARY = '/usr/bin/env pyscss'
179 # PIPELINE_PYSCSS_ARGUMENTS = ''
180
181
182 STATICFILES_FINDERS = [
183     'django.contrib.staticfiles.finders.FileSystemFinder',
184     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
185     'pipeline.finders.PipelineFinder',
186 ]