##// END OF EJS Templates
front-end: Use DataTables from node_modules and stop bundling it...
Mads Kiilerich -
r7385:cc2c473a default
parent child Browse files
Show More
@@ -1,47 +1,49 b''
1 1 syntax: glob
2 2 *.pyc
3 3 *.swp
4 4 *.sqlite
5 5 *.tox
6 6 *.egg-info
7 7 *.egg
8 8 *.mo
9 9 .eggs/
10 10 tarballcache/
11 11
12 12 syntax: regexp
13 13 ^rcextensions
14 14 ^build
15 15 ^dist/
16 16 ^docs/build/
17 17 ^docs/_build/
18 18 ^data$
19 19 ^sql_dumps/
20 20 ^\.settings$
21 21 ^\.project$
22 22 ^\.pydevproject$
23 23 ^\.coverage$
24 24 ^kallithea/front-end/node_modules$
25 25 ^kallithea/front-end/package-lock\.json$
26 26 ^kallithea/front-end/tmp$
27 27 ^kallithea/public/css/select2-spinner\.gif$
28 28 ^kallithea/public/css/select2\.png$
29 29 ^kallithea/public/css/select2x2\.png$
30 30 ^kallithea/public/css/style\.css$
31 31 ^kallithea/public/css/style\.css\.map$
32 32 ^kallithea/public/js/bootstrap\.js$
33 ^kallithea/public/js/dataTables\.bootstrap\.js$
34 ^kallithea/public/js/jquery\.dataTables\.js$
33 35 ^kallithea/public/js/jquery\.flot\.js$
34 36 ^kallithea/public/js/jquery\.flot\.selection\.js$
35 37 ^kallithea/public/js/jquery\.flot\.time\.js$
36 38 ^kallithea/public/js/jquery\.min\.js$
37 39 ^kallithea/public/js/select2\.js$
38 40 ^theme\.less$
39 41 ^kallithea\.db$
40 42 ^test\.db$
41 43 ^Kallithea\.egg-info$
42 44 ^my\.ini$
43 45 ^fabfile.py
44 46 ^\.idea$
45 47 ^\.cache$
46 48 ^\.pytest_cache$
47 49 /__pycache__$
@@ -1,311 +1,311 b''
1 1 Kallithea License
2 2 =================
3 3
4 4 Kallithea as a whole is copyrighted by various authors and is licensed under
5 5 the terms of the GNU General Public License, version 3 (GPLv3), which is a
6 6 license published by the Free Software Foundation,
7 7 Inc. [A copy of GPLv3](/COPYING) is included herein.
8 8
9 9 Some individual files have copyright notices and those who offer changes to
10 10 those files should update the copyright notices in those specific files if
11 11 they so chose.
12 12
13 13 However, the definitive list of copyright holders for this project is kept in
14 14 [the about page template](kallithea/templates/about.html) so that it is
15 15 displayed appropriately when Kallithea is installed. This is the most
16 16 important place to update copyright notices.
17 17
18 18 Third-Party Code Incorporated in Kallithea
19 19 ==========================================
20 20
21 21 Various third-party code under GPLv3-compatible licenses is included as part
22 22 of Kallithea.
23 23
24 24
25 25 Alembic
26 26 -------
27 27
28 28 Kallithea incorporates an [Alembic](http://alembic.zzzcomputing.com/en/latest/)
29 29 "migration environment" in `kallithea/alembic`, portions of which is:
30 30
31 31 Copyright © 2009-2016 by Michael Bayer.
32 32 Alembic is a trademark of Michael Bayer.
33 33
34 34 and licensed under the MIT-permissive license, which is
35 35 [included in this distribution](MIT-Permissive-License.txt).
36 36
37 37
38 38 Bootstrap
39 39 ---------
40 40
41 41 Kallithea uses the web framework called
42 42 [Bootstrap](http://getbootstrap.com/), which is:
43 43
44 44 Copyright © 2011-2016 Twitter, Inc.
45 45
46 46 and licensed under the MIT-permissive license, which is
47 47 [included in this distribution](MIT-Permissive-License.txt).
48 48
49 49 It is not distributed with Kallithea, but will be downloaded
50 50 using the ''kallithea-cli front-end-build'' command.
51 51
52 52
53 53
54 54 Codemirror
55 55 ----------
56 56
57 57 Kallithea incorporates parts of the Javascript system called
58 58 [Codemirror](http://codemirror.net/), version 4.7.0, which is primarily:
59 59
60 60 Copyright &copy; 2013-2014 by Marijn Haverbeke <marijnh@gmail.com>
61 61
62 62 and licensed under the MIT-permissive license, which is
63 63 [included in this distribution](MIT-Permissive-License.txt).
64 64
65 65 Additional files from upstream Codemirror are copyrighted by various authors
66 66 and licensed under other permissive licenses. The sub-directories under
67 67 [.../public/codemirror](kallithea/public/codemirror) include the copyright and
68 68 license notice and information as they appeared in Codemirror's upstream
69 69 release.
70 70
71 71
72 72
73 73 jQuery
74 74 ------
75 75
76 76 Kallithea uses the Javascript system called
77 77 [jQuery](http://jquery.org/).
78 78
79 79 It is Copyright 2013 jQuery Foundation and other contributors http://jquery.com/ and is under an
80 80 [MIT-permissive license](MIT-Permissive-License.txt).
81 81
82 82 It is not distributed with Kallithea, but will be downloaded
83 83 using the ''kallithea-cli front-end-build'' command.
84 84
85 85
86 86
87 87 DataTables
88 88 ----------
89 89
90 Kallithea incorporates the Javascript system called
91 [DataTables](http://www.datatables.net/)
92 which can be found together with their Corresponding Source in
93 https://github.com/DataTables/DataTables at tag 1.10.13 (mirrored at
94 https://kallithea-scm.org/repos/mirror/DataTables/files/1.10.13/ ).
90 Kallithea uses the Javascript system called
91 [DataTables](http://www.datatables.net/).
95 92
96 93 It is Copyright 2008-2015 SpryMedia Ltd. and is under an
97 94 [MIT-permissive license](MIT-Permissive-License.txt).
98 95
96 It is not distributed with Kallithea, but will be downloaded
97 using the ''kallithea-cli front-end-build'' command.
98
99 99
100 100
101 101 Mergely
102 102 -------
103 103
104 104 Kallithea incorporates some code from the Javascript system called
105 105 [Mergely](http://www.mergely.com/), version 3.3.9.
106 106 [Mergely's license](http://www.mergely.com/license.php), a
107 107 [copy of which is included in this repository](LICENSE-MERGELY.html),
108 108 is (GPL|LGPL|MPL). Kallithea as GPLv3'd project chooses the GPL arm of that
109 109 tri-license.
110 110
111 111
112 112
113 113 Select2
114 114 -------
115 115
116 116 Kallithea uses the Javascript system called
117 117 [Select2](http://ivaynberg.github.io/select2/), which is:
118 118
119 119 Copyright 2012 Igor Vaynberg (and probably others)
120 120
121 121 and is licensed [under the following license](https://github.com/ivaynberg/select2/blob/master/LICENSE):
122 122
123 123 > This software is licensed under the Apache License, Version 2.0 (the
124 124 > "Apache License") or the GNU General Public License version 2 (the "GPL
125 125 > License"). You may choose either license to govern your use of this
126 126 > software only upon the condition that you accept all of the terms of either
127 127 > the Apache License or the GPL License.
128 128
129 129 A [copy of the Apache License 2.0](Apache-License-2.0.txt) is also included
130 130 in this distribution.
131 131
132 132 Kallithea will take the Apache license fork of the dual license, since
133 133 Kallithea is GPLv3'd.
134 134
135 135 It is not distributed with Kallithea, but will be downloaded
136 136 using the ''kallithea-cli front-end-build'' command.
137 137
138 138
139 139
140 140 Select2-Bootstrap-CSS
141 141 ---------------------
142 142
143 143 Kallithea uses some CSS from a system called
144 144 [Select2-bootstrap-css](https://github.com/t0m/select2-bootstrap-css), which
145 145 is:
146 146
147 147 Copyright &copy; 2013 Tom Terrace (and likely others)
148 148
149 149 and licensed under the MIT-permissive license, which is
150 150 [included in this distribution](MIT-Permissive-License.txt).
151 151
152 152 It is not distributed with Kallithea, but will be downloaded
153 153 using the ''kallithea-cli front-end-build'' command.
154 154
155 155
156 156
157 157 History.js
158 158 ----------
159 159
160 160 Kallithea incorporates some CSS from a system called History.js, which is
161 161
162 162 Copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
163 163
164 164 Redistribution and use in source and binary forms, with or without
165 165 modification, are permitted provided that the following conditions are met:
166 166
167 167 1. Redistributions of source code must retain the above copyright notice,
168 168 this list of conditions and the following disclaimer.
169 169
170 170 2. Redistributions in binary form must reproduce the above copyright notice,
171 171 this list of conditions and the following disclaimer in the documentation
172 172 and/or other materials provided with the distribution.
173 173
174 174 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
175 175 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
176 176 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
177 177 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
178 178 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
179 179 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
180 180 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
181 181 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
182 182 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
183 183 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
184 184 POSSIBILITY OF SUCH DAMAGE.
185 185
186 186
187 187
188 188 YUI
189 189 ---
190 190
191 191 Kallithea incorporates parts of the Javascript system called
192 192 [YUI 2 — Yahoo! User Interface Library](http://yui.github.io/yui2/docs/yui_2.9.0_full/),
193 193 which is made available under the [BSD License](http://yuilibrary.com/license/):
194 194
195 195 Copyright &copy; 2013 Yahoo! Inc. All rights reserved.
196 196
197 197 Redistribution and use of this software in source and binary forms, with or
198 198 without modification, are permitted provided that the following conditions are
199 199 met:
200 200
201 201 * Redistributions of source code must retain the above copyright notice, this
202 202 list of conditions and the following disclaimer.
203 203
204 204 * Redistributions in binary form must reproduce the above copyright notice,
205 205 this list of conditions and the following disclaimer in the documentation
206 206 and/or other materials provided with the distribution.
207 207
208 208 * Neither the name of Yahoo! Inc. nor the names of YUI's contributors may be
209 209 used to endorse or promote products derived from this software without
210 210 specific prior written permission of Yahoo! Inc.
211 211
212 212 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
213 213 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
214 214 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
215 215 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
216 216 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
217 217 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
218 218 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
219 219 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
220 220 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
221 221 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
222 222
223 223
224 224 Kallithea includes a minified version of YUI 2.9. To build yui.2.9.js:
225 225
226 226 git clone https://github.com/yui/builder
227 227 git clone https://github.com/yui/yui2
228 228 cd yui2/
229 229 git checkout hudson-yui2-2800
230 230 ln -sf JumpToPageDropDown.js src/paginator/js/JumpToPageDropdown.js # work around inconsistent casing
231 231 rm -f tmp.js
232 232 for m in yahoo event dom animation datasource autocomplete event-delegate; do
233 233 rm -f build/$m/$m.js
234 234 ( cd src/$m && ant build deploybuild ) && sed -e 's,@VERSION@,2.9.0,g' -e 's,@BUILD@,2800,g' build/$m/$m.js >> tmp.js
235 235 done
236 236 java -jar ../builder/componentbuild/lib/yuicompressor/yuicompressor-2.4.4.jar tmp.js -o yui.2.9.js
237 237
238 238 In compliance with GPLv3 the Corresponding Source for this Object Code is made
239 239 available on
240 240 [https://kallithea-scm.org/repos/mirror](https://kallithea-scm.org/repos/mirror).
241 241
242 242
243 243
244 244 YUI Flot
245 245 --------
246 246
247 247 Kallithea incorporates some CSS from a system called
248 248 [Flot](http://code.google.com/p/flot/), which is:
249 249
250 250 Copyright 2006 Google Inc.
251 251
252 252 Licensed under the Apache License, Version 2.0 (the "License");
253 253 you may not use this file except in compliance with the License.
254 254
255 255 A [copy of the Apache License 2.0](Apache-License-2.0.txt) is also included
256 256 in this distribution.
257 257
258 258
259 259
260 260 Flot
261 261 ----
262 262
263 263 Kallithea uses some parts of a Javascript system called
264 264 [Flot](http://www.flotcharts.org/), which is:
265 265
266 266 Copyright (c) 2007-2014 IOLA and Ole Laursen
267 267
268 268 Permission is hereby granted, free of charge, to any person
269 269 obtaining a copy of this software and associated documentation
270 270 files (the "Software"), to deal in the Software without
271 271 restriction, including without limitation the rights to use,
272 272 copy, modify, merge, publish, distribute, sublicense, and/or sell
273 273 copies of the Software, and to permit persons to whom the
274 274 Software is furnished to do so, subject to the following
275 275 conditions:
276 276
277 277 The above copyright notice and this permission notice shall be
278 278 included in all copies or substantial portions of the Software.
279 279
280 280 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
281 281 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
282 282 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
283 283 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
284 284 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
285 285 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
286 286 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
287 287 OTHER DEALINGS IN THE SOFTWARE.
288 288
289 289 It is not distributed with Kallithea, but will be downloaded
290 290 using the ''kallithea-cli front-end-build'' command.
291 291
292 292
293 293
294 294 Icon fonts
295 295 ----------
296 296
297 297 Kallithea incorporates subsets of both
298 298 [Font Awesome](http://fontawesome.io) and
299 299 [GitHub Octicons](https://octicons.github.com) for icons. Font Awesome is:
300 300
301 301 Copyright (c) 2016, Dave Gandy
302 302
303 303 Octicons is:
304 304
305 305 Copyright (c) 2012-2014 GitHub
306 306
307 307 These two sets are distributed under [SIL OFL 1.1](http://scripts.sil.org/OFL)
308 308 and have been combined into one font called "kallithea."
309 309
310 310
311 311 EOF
@@ -1,99 +1,103 b''
1 1 # -*- coding: utf-8 -*-
2 2 # This program is free software: you can redistribute it and/or modify
3 3 # it under the terms of the GNU General Public License as published by
4 4 # the Free Software Foundation, either version 3 of the License, or
5 5 # (at your option) any later version.
6 6 #
7 7 # This program is distributed in the hope that it will be useful,
8 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 10 # GNU General Public License for more details.
11 11 #
12 12 # You should have received a copy of the GNU General Public License
13 13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 14
15 15 import click
16 16 import kallithea.bin.kallithea_cli_base as cli_base
17 17
18 18 import os
19 19 import shutil
20 20 import subprocess
21 21 import json
22 22
23 23 import kallithea
24 24
25 25 @cli_base.register_command()
26 26 @click.option('--install-deps/--no-install-deps', default=True,
27 27 help='Skip installation of dependencies, via "npm".')
28 28 @click.option('--generate/--no-generate', default=True,
29 29 help='Skip generation of front-end files.')
30 30 def front_end_build(install_deps, generate):
31 31 """Build the front-end.
32 32
33 33 Install required dependencies for the front-end and generate the necessary
34 34 files. This step is complementary to any 'pip install' step which only
35 35 covers Python dependencies.
36 36
37 37 The installation of front-end dependencies happens via the tool 'npm' which
38 38 is expected to be installed already.
39 39 """
40 40 front_end_dir = os.path.abspath(os.path.join(kallithea.__file__, '..', 'front-end'))
41 41 public_dir = os.path.abspath(os.path.join(kallithea.__file__, '..', 'public'))
42 42
43 43 if install_deps:
44 44 click.echo("Running 'npm install' to install front-end dependencies from package.json")
45 45 subprocess.check_call(['npm', 'install'], cwd=front_end_dir)
46 46
47 47 if generate:
48 48 tmp_dir = os.path.join(front_end_dir, 'tmp')
49 49 if not os.path.isdir(tmp_dir):
50 50 os.mkdir(tmp_dir)
51 51
52 52 click.echo("Building CSS styling based on Bootstrap")
53 53 with open(os.path.join(tmp_dir, 'pygments.css'), 'w') as f:
54 54 subprocess.check_call(['pygmentize',
55 55 '-S', 'default',
56 56 '-f', 'html',
57 57 '-a', '.code-highlight'],
58 58 stdout=f)
59 59 lesscpath = os.path.join(front_end_dir, 'node_modules', '.bin', 'lessc')
60 60 lesspath = os.path.join(public_dir, 'less', 'main.less')
61 61 csspath = os.path.join(public_dir, 'css', 'style.css')
62 62 subprocess.check_call([lesscpath, '--relative-urls', '--source-map',
63 63 '--source-map-less-inline', lesspath, csspath],
64 64 cwd=front_end_dir)
65 65
66 66 click.echo("Preparing Bootstrap JS")
67 67 shutil.copy(os.path.join(front_end_dir, 'node_modules', 'bootstrap', 'dist', 'js', 'bootstrap.js'), os.path.join(public_dir, 'js', 'bootstrap.js'))
68 68
69 69 click.echo("Preparing jQuery JS with Flot")
70 70 shutil.copy(os.path.join(front_end_dir, 'node_modules', 'jquery', 'dist', 'jquery.min.js'), os.path.join(public_dir, 'js', 'jquery.min.js'))
71 71 shutil.copy(os.path.join(front_end_dir, 'node_modules', 'jquery.flot', 'jquery.flot.js'), os.path.join(public_dir, 'js', 'jquery.flot.js'))
72 72 shutil.copy(os.path.join(front_end_dir, 'node_modules', 'jquery.flot', 'jquery.flot.selection.js'), os.path.join(public_dir, 'js', 'jquery.flot.selection.js'))
73 73 shutil.copy(os.path.join(front_end_dir, 'node_modules', 'jquery.flot', 'jquery.flot.time.js'), os.path.join(public_dir, 'js', 'jquery.flot.time.js'))
74 74
75 click.echo("Preparing DataTables JS")
76 shutil.copy(os.path.join(front_end_dir, 'node_modules', 'datatables.net', 'js', 'jquery.dataTables.js'), os.path.join(public_dir, 'js', 'jquery.dataTables.js'))
77 shutil.copy(os.path.join(front_end_dir, 'node_modules', 'datatables.net-bs', 'js', 'dataTables.bootstrap.js'), os.path.join(public_dir, 'js', 'dataTables.bootstrap.js'))
78
75 79 click.echo("Preparing Select2 JS")
76 80 shutil.copy(os.path.join(front_end_dir, 'node_modules', 'select2', 'select2.js'), os.path.join(public_dir, 'js', 'select2.js'))
77 81 shutil.copy(os.path.join(front_end_dir, 'node_modules', 'select2', 'select2.png'), os.path.join(public_dir, 'css', 'select2.png'))
78 82 shutil.copy(os.path.join(front_end_dir, 'node_modules', 'select2', 'select2x2.png'), os.path.join(public_dir, 'css', 'select2x2.png'))
79 83 shutil.copy(os.path.join(front_end_dir, 'node_modules', 'select2', 'select2-spinner.gif'), os.path.join(public_dir, 'css', 'select2-spinner.gif'))
80 84
81 85 click.echo("Generating LICENSES.txt")
82 86 check_licensing_json_path = os.path.join(tmp_dir, 'licensing.json')
83 87 licensing_txt_path = os.path.join(public_dir, 'LICENSES.txt')
84 88 subprocess.check_call([
85 89 os.path.join(front_end_dir, 'node_modules', '.bin', 'license-checker'),
86 90 '--json',
87 91 '--out', check_licensing_json_path,
88 92 ], cwd=front_end_dir)
89 93 with open(check_licensing_json_path) as jsonfile:
90 94 rows = json.loads(jsonfile.read())
91 95 with open(licensing_txt_path, 'w') as out:
92 96 out.write("The Kallithea front-end was built using the following Node modules:\n\n")
93 97 for name_version, values in sorted(rows.items()):
94 98 name, version = name_version.rsplit('@', 1)
95 99 line = "%s from https://www.npmjs.com/package/%s/v/%s\n License: %s\n Repository: %s\n" % (
96 100 name_version, name, version, values['licenses'], values.get('repository', '-'))
97 101 if values.get('copyright'):
98 102 line += " Copyright: %s\n" % (values['copyright'])
99 103 out.write(line + '\n')
@@ -1,16 +1,18 b''
1 1 {
2 2 "name": "kallithea",
3 3 "private": true,
4 4 "dependencies": {
5 5 "bootstrap": "3.3.7",
6 "datatables.net": "1.10.13",
7 "datatables.net-bs": "1.10.13",
6 8 "jquery": "1.12.3",
7 9 "jquery.flot": "0.8.3",
8 10 "select2": "3.5.1",
9 11 "select2-bootstrap-css": "1.2.4"
10 12 },
11 13 "devDependencies": {
12 14 "less": "~2.7",
13 15 "less-plugin-clean-css": "~1.5",
14 16 "license-checker": "24.1.0"
15 17 }
16 18 }
@@ -1,28 +1,28 b''
1 1 /*!
2 2 * Don't edit the css file directly.
3 3 *
4 4 * Instead, edit the less file(s) and regenerate the css:
5 5 *
6 6 * npm install
7 7 * npm run less
8 8 *
9 9 */
10 10
11 11 /* 3rd party styles */
12 12 @import "node_modules/bootstrap/less/bootstrap.less";
13 @import (inline) "3rd-party/dataTables.bootstrap.css";
13 @import (inline) "node_modules/datatables.net-bs/css/dataTables.bootstrap.css";
14 14 @import (less) "node_modules/select2/select2.css";
15 15 @import (less) "node_modules/select2-bootstrap-css/select2-bootstrap.css";
16 16 @import (less) "tmp/pygments.css";
17 17 @import (less) "../fontello/css/kallithea.css";
18 18
19 19 /* kallithea styles */
20 20 @import "kallithea-variables.less";
21 21 @import "kallithea-labels.less";
22 22 @import "yui-ac.less";
23 23 @import "kallithea-select2.less";
24 24 @import "kallithea-diff.less";
25 25 @import "style.less";
26 26
27 27 /* finally, import the optional theme file with local customizations */
28 28 @import (optional) "theme.less";
@@ -1,141 +1,141 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <!DOCTYPE html>
3 3 <html xmlns="http://www.w3.org/1999/xhtml">
4 4 <head>
5 5 <title><%block name="title"/><%block name="branding_title"/></title>
6 6 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
7 7 <meta http-equiv="X-UA-Compatible" content="IE=10"/>
8 8 <meta name="robots" content="index, nofollow"/>
9 9 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
10 10 <link rel="shortcut icon" href="${h.url('/images/favicon.ico')}" type="image/x-icon" />
11 11 <link rel="icon" type="image/png" href="${h.url('/images/favicon-32x32.png')}" sizes="32x32">
12 12 <link rel="icon" type="image/png" href="${h.url('/images/favicon-16x16.png')}" sizes="16x16">
13 13 <link rel="apple-touch-icon" sizes="180x180" href="${h.url('/images/apple-touch-icon.png')}">
14 14 <link rel="manifest" href="${h.url('/images/manifest.json')}">
15 15 <link rel="mask-icon" href="${h.url('/images/safari-pinned-tab.svg')}" color="#b1d579">
16 16 <meta name="msapplication-config" content="${h.url('/images/browserconfig.xml')}">
17 17 <meta name="theme-color" content="#ffffff">
18 18
19 19 ## CSS ###
20 20 <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css', ver=c.kallithea_version)}" media="screen"/>
21 21 <%block name="css_extra"/>
22 22
23 23 ## JAVASCRIPT ##
24 24 <script type="text/javascript">
25 25 ## JS translations map
26 26 var TRANSLATION_MAP = {
27 27 'Cancel': ${h.jshtml(_("Cancel"))},
28 28 'Retry': ${h.jshtml(_("Retry"))},
29 29 'Submitting ...': ${h.jshtml(_("Submitting ..."))},
30 30 'Unable to post': ${h.jshtml(_("Unable to post"))},
31 31 'Add Another Comment': ${h.jshtml(_("Add Another Comment"))},
32 32 'Stop following this repository': ${h.jshtml(_('Stop following this repository'))},
33 33 'Start following this repository': ${h.jshtml(_('Start following this repository'))},
34 34 'Group': ${h.jshtml(_('Group'))},
35 35 'Loading ...': ${h.jshtml(_('Loading ...'))},
36 36 'loading ...': ${h.jshtml(_('loading ...'))},
37 37 'Search truncated': ${h.jshtml(_('Search truncated'))},
38 38 'No matching files': ${h.jshtml(_('No matching files'))},
39 39 'Open New Pull Request from {0}': ${h.jshtml(_('Open New Pull Request from {0}'))},
40 40 'Open New Pull Request for {0} &rarr; {1}': ${h.js(_('Open New Pull Request for {0} &rarr; {1}'))},
41 41 'Show Selected Changesets {0} &rarr; {1}': ${h.js(_('Show Selected Changesets {0} &rarr; {1}'))},
42 42 'Selection Link': ${h.jshtml(_('Selection Link'))},
43 43 'Collapse Diff': ${h.jshtml(_('Collapse Diff'))},
44 44 'Expand Diff': ${h.jshtml(_('Expand Diff'))},
45 45 'No revisions': ${h.jshtml(_('No revisions'))},
46 46 'Type name of user or member to grant permission': ${h.jshtml(_('Type name of user or member to grant permission'))},
47 47 'Failed to revoke permission': ${h.jshtml(_('Failed to revoke permission'))},
48 48 'Confirm to revoke permission for {0}: {1} ?': ${h.jshtml(_('Confirm to revoke permission for {0}: {1} ?'))},
49 49 'Enabled': ${h.jshtml(_('Enabled'))},
50 50 'Disabled': ${h.jshtml(_('Disabled'))},
51 51 'Select changeset': ${h.jshtml(_('Select changeset'))},
52 52 'Specify changeset': ${h.jshtml(_('Specify changeset'))},
53 53 'MSG_SORTASC': ${h.jshtml(_('Click to sort ascending'))},
54 54 'MSG_SORTDESC': ${h.jshtml(_('Click to sort descending'))},
55 55 'MSG_EMPTY': ${h.jshtml(_('No records found.'))},
56 56 'MSG_ERROR': ${h.jshtml(_('Data error.'))},
57 57 'MSG_LOADING': ${h.jshtml(_('Loading...'))}
58 58 };
59 59 var _TM = TRANSLATION_MAP;
60 60
61 61 var TOGGLE_FOLLOW_URL = ${h.js(h.url('toggle_following'))};
62 62
63 63 var REPO_NAME = "";
64 64 %if hasattr(c, 'repo_name'):
65 65 var REPO_NAME = ${h.js(c.repo_name)};
66 66 %endif
67 67
68 68 var _authentication_token = ${h.js(h.authentication_token())};
69 69 </script>
70 70 <script type="text/javascript" src="${h.url('/js/yui.2.9.js', ver=c.kallithea_version)}"></script>
71 71 <script type="text/javascript" src="${h.url('/js/jquery.min.js', ver=c.kallithea_version)}"></script>
72 <script type="text/javascript" src="${h.url('/js/jquery.dataTables.min.js', ver=c.kallithea_version)}"></script>
72 <script type="text/javascript" src="${h.url('/js/jquery.dataTables.js', ver=c.kallithea_version)}"></script>
73 73 <script type="text/javascript" src="${h.url('/js/dataTables.bootstrap.js', ver=c.kallithea_version)}"></script>
74 74 <script type="text/javascript" src="${h.url('/js/bootstrap.js', ver=c.kallithea_version)}"></script>
75 75 <script type="text/javascript" src="${h.url('/js/select2.js', ver=c.kallithea_version)}"></script>
76 76 <script type="text/javascript" src="${h.url('/js/native.history.js', ver=c.kallithea_version)}"></script>
77 77 <script type="text/javascript" src="${h.url('/js/base.js', ver=c.kallithea_version)}"></script>
78 78 ## EXTRA FOR JS
79 79 <%block name="js_extra"/>
80 80 <script type="text/javascript">
81 81 (function(window,undefined){
82 82 var History = window.History; // Note: We are using a capital H instead of a lower h
83 83 if ( !History.enabled ) {
84 84 // History.js is disabled for this browser.
85 85 // This is because we can optionally choose to support HTML4 browsers or not.
86 86 return false;
87 87 }
88 88 })(window);
89 89
90 90 $(document).ready(function(){
91 91 tooltip_activate();
92 92 show_more_event();
93 93 // routes registration
94 94 pyroutes.register('home', ${h.js(h.url('home'))}, []);
95 95 pyroutes.register('new_gist', ${h.js(h.url('new_gist'))}, []);
96 96 pyroutes.register('gists', ${h.js(h.url('gists'))}, []);
97 97 pyroutes.register('new_repo', ${h.js(h.url('new_repo'))}, []);
98 98
99 99 pyroutes.register('summary_home', ${h.js(h.url('summary_home', repo_name='%(repo_name)s'))}, ['repo_name']);
100 100 pyroutes.register('changelog_home', ${h.js(h.url('changelog_home', repo_name='%(repo_name)s'))}, ['repo_name']);
101 101 pyroutes.register('files_home', ${h.js(h.url('files_home', repo_name='%(repo_name)s',revision='%(revision)s',f_path='%(f_path)s'))}, ['repo_name', 'revision', 'f_path']);
102 102 pyroutes.register('edit_repo', ${h.js(h.url('edit_repo', repo_name='%(repo_name)s'))}, ['repo_name']);
103 103 pyroutes.register('edit_repo_perms', ${h.js(h.url('edit_repo_perms', repo_name='%(repo_name)s'))}, ['repo_name']);
104 104 pyroutes.register('pullrequest_home', ${h.js(h.url('pullrequest_home', repo_name='%(repo_name)s'))}, ['repo_name']);
105 105
106 106 pyroutes.register('toggle_following', ${h.js(h.url('toggle_following'))});
107 107 pyroutes.register('changeset_info', ${h.js(h.url('changeset_info', repo_name='%(repo_name)s', revision='%(revision)s'))}, ['repo_name', 'revision']);
108 108 pyroutes.register('changeset_home', ${h.js(h.url('changeset_home', repo_name='%(repo_name)s', revision='%(revision)s'))}, ['repo_name', 'revision']);
109 109 pyroutes.register('repo_size', ${h.js(h.url('repo_size', repo_name='%(repo_name)s'))}, ['repo_name']);
110 110 pyroutes.register('repo_refs_data', ${h.js(h.url('repo_refs_data', repo_name='%(repo_name)s'))}, ['repo_name']);
111 111 pyroutes.register('users_and_groups_data', ${h.js(h.url('users_and_groups_data'))}, []);
112 112 });
113 113 </script>
114 114
115 115 <%block name="head_extra"/>
116 116 </head>
117 117 <body>
118 118 <nav class="navbar navbar-inverse mainmenu">
119 119 <div class="navbar-header" id="logo">
120 120 <a class="navbar-brand" href="${h.url('home')}">
121 121 <span class="branding">${c.site_name}</span>
122 122 </a>
123 123 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
124 124 <span class="sr-only">Toggle navigation</span>
125 125 <span class="icon-bar"></span>
126 126 <span class="icon-bar"></span>
127 127 <span class="icon-bar"></span>
128 128 </button>
129 129 </div>
130 130 <div id="navbar" class="navbar-collapse collapse">
131 131 <%block name="header_menu"/>
132 132 </div>
133 133 </nav>
134 134
135 135 ${next.body()}
136 136
137 137 %if c.ga_code:
138 138 ${h.literal(c.ga_code)}
139 139 %endif
140 140 </body>
141 141 </html>
@@ -1,20 +1,20 b''
1 1 #!/bin/bash -x
2 2
3 3 # Enforce some consistency in whitespace - just to avoid spurious whitespaces changes
4 4
5 files=`hg mani | egrep -v '/codemirror/|/fontello/|/email_templates/|(/lockfiles.py|^LICENSE-MERGELY.html|^docs/Makefile|^scripts/whitespacecleanup.sh|/(graph|mergely|native.history|yui.2.9|jquery.dataTables)\.js|/test_dump_html_mails.ref.html|\.png|\.gif|\.ico|\.pot|\.po|\.mo|\.tar\.gz|\.diff)$'`
5 files=`hg mani | egrep -v '/codemirror/|/fontello/|/email_templates/|(/lockfiles.py|^LICENSE-MERGELY.html|^docs/Makefile|^scripts/whitespacecleanup.sh|/(graph|mergely|native.history|yui.2.9)\.js|/test_dump_html_mails.ref.html|\.png|\.gif|\.ico|\.pot|\.po|\.mo|\.tar\.gz|\.diff)$'`
6 6
7 7 sed -i "s/`printf '\r'`//g" $files
8 8 sed -i -e "s,`printf '\t'`, ,g" $files
9 9 sed -i -e "s, *$,,g" $files
10 10 sed -i -e 's,\([^ ]\)\\$,\1 \\,g' -e 's,\(["'"'"']["'"'"']["'"'"']\) \\$,\1\\,g' $files
11 11 # ensure one trailing newline - remove empty last line and make last line include trailing newline:
12 12 sed -i -e '$,${/^$/d}' -e '$a\' $files
13 13
14 14 sed -i -e 's,\([^ /]\){,\1 {,g' `hg loc '*.css'`
15 15 sed -i -e 's|^\([^ /].*,\)\([^ ]\)|\1 \2|g' `hg loc '*.css'`
16 16
17 17 hg mani | xargs chmod -x
18 18 hg loc 'set:!binary()&grep("^#!")&!(**_tmpl.py)&!(**/template**)' | xargs chmod +x
19 19
20 20 hg diff
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now