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