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