Show More
@@ -1,106 +1,106 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | |
|
3 | 3 | # Copyright (C) 2010-2019 RhodeCode GmbH |
|
4 | 4 | # |
|
5 | 5 | # This program is free software: you can redistribute it and/or modify |
|
6 | 6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
7 | 7 | # (only), as published by the Free Software Foundation. |
|
8 | 8 | # |
|
9 | 9 | # This program is distributed in the hope that it will be useful, |
|
10 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | 12 | # GNU General Public License for more details. |
|
13 | 13 | # |
|
14 | 14 | # You should have received a copy of the GNU Affero General Public License |
|
15 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
16 | 16 | # |
|
17 | 17 | # This program is dual-licensed. If you wish to learn more about the |
|
18 | 18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
19 | 19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
20 | 20 | |
|
21 | 21 | """ |
|
22 | 22 | Single source for redirection links. |
|
23 | 23 | |
|
24 | 24 | Goal of this module is to provide a single source of truth regarding external |
|
25 | 25 | links. The data inside this module is used to configure the routing |
|
26 | 26 | system of Enterprise and it is used also as a base to check if this data |
|
27 | 27 | and our server configuration are in sync. |
|
28 | 28 | |
|
29 | 29 | .. py:data:: link_config |
|
30 | 30 | |
|
31 | 31 | Contains the configuration for external links. Each item is supposed to be |
|
32 | 32 | a `dict` like this example:: |
|
33 | 33 | |
|
34 | 34 | {"name": "url_name", |
|
35 | 35 | "target": "https://rhodecode.com/r1/enterprise/keyword/", |
|
36 | 36 | "external_target": "https://example.com/some-page.html", |
|
37 | 37 | } |
|
38 | 38 | |
|
39 | 39 | then you can retrieve the url by simply calling the URL function: |
|
40 | 40 | |
|
41 | 41 | `h.route_path('url_name')` |
|
42 | 42 | |
|
43 | 43 | The redirection must be first implemented in our servers before |
|
44 | 44 | you can see it working. |
|
45 | 45 | """ |
|
46 | 46 | # pragma: no cover |
|
47 | 47 | from __future__ import unicode_literals |
|
48 | 48 | |
|
49 | 49 | link_config = [ |
|
50 | 50 | { |
|
51 | 51 | "name": "enterprise_docs", |
|
52 | 52 | "target": "https://rhodecode.com/r1/enterprise/docs/", |
|
53 | 53 | "external_target": "https://docs.rhodecode.com/RhodeCode-Enterprise/", |
|
54 | 54 | }, |
|
55 | 55 | { |
|
56 | 56 | "name": "enterprise_log_file_locations", |
|
57 | 57 | "target": "https://rhodecode.com/r1/enterprise/docs/admin-system-overview/", |
|
58 | 58 | "external_target": "https://docs.rhodecode.com/RhodeCode-Enterprise/admin/system-overview.html#log-files", |
|
59 | 59 | }, |
|
60 | 60 | { |
|
61 | 61 | "name": "enterprise_issue_tracker_settings", |
|
62 | 62 | "target": "https://rhodecode.com/r1/enterprise/docs/issue-trackers-overview/", |
|
63 | 63 | "external_target": "https://docs.rhodecode.com/RhodeCode-Enterprise/issue-trackers/issue-trackers.html", |
|
64 | 64 | }, |
|
65 | 65 | { |
|
66 | 66 | "name": "enterprise_svn_setup", |
|
67 | 67 | "target": "https://rhodecode.com/r1/enterprise/docs/svn-setup/", |
|
68 | 68 | "external_target": "https://docs.rhodecode.com/RhodeCode-Enterprise/admin/svn-http.html", |
|
69 | 69 | }, |
|
70 | 70 | { |
|
71 | 71 | "name": "enterprise_license_convert_from_old", |
|
72 | 72 | "target": "https://rhodecode.com/r1/enterprise/convert-license/", |
|
73 | 73 | "external_target": "https://rhodecode.com/u/license-upgrade", |
|
74 | 74 | }, |
|
75 | 75 | { |
|
76 | 76 | "name": "rst_help", |
|
77 | 77 | "target": "http://docutils.sourceforge.net/docs/user/rst/quickref.html", |
|
78 |
"external_target": "http://docutils.sourceforge. |
|
|
78 | "external_target": "http://docutils.sourceforge.io/docs/user/rst/quickref.html", | |
|
79 | 79 | }, |
|
80 | 80 | { |
|
81 | 81 | "name": "markdown_help", |
|
82 | 82 | "target": "https://daringfireball.net/projects/markdown/syntax", |
|
83 | 83 | "external_target": "https://daringfireball.net/projects/markdown/syntax", |
|
84 | 84 | }, |
|
85 | 85 | { |
|
86 | 86 | "name": "rhodecode_official", |
|
87 | 87 | "target": "https://rhodecode.com", |
|
88 | 88 | "external_target": "https://rhodecode.com/", |
|
89 | 89 | }, |
|
90 | 90 | { |
|
91 | 91 | "name": "rhodecode_support", |
|
92 | 92 | "target": "https://rhodecode.com/help/", |
|
93 | 93 | "external_target": "https://rhodecode.com/support", |
|
94 | 94 | }, |
|
95 | 95 | { |
|
96 | 96 | "name": "rhodecode_translations", |
|
97 | 97 | "target": "https://rhodecode.com/translate/enterprise", |
|
98 | 98 | "external_target": "https://www.transifex.com/rhodecode/RhodeCode/", |
|
99 | 99 | }, |
|
100 | 100 | |
|
101 | 101 | ] |
|
102 | 102 | |
|
103 | 103 | |
|
104 | 104 | def connect_redirection_links(config): |
|
105 | 105 | for link in link_config: |
|
106 | 106 | config.add_route(link['name'], link['target'], static=True) |
General Comments 0
You need to be logged in to leave comments.
Login now