Show More
@@ -1,101 +1,106 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | |
|
3 | 3 | # Copyright (C) 2010-2017 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.url('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 | # flake8: noqa |
|
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 | "name": "enterprise_license_convert_from_old", | |
|
72 | "target": "https://rhodecode.com/r1/enterprise/convert-license/", | |
|
73 | "external_target": "https://rhodecode.com/u/license-upgrade", | |
|
74 | }, | |
|
75 | { | |
|
71 | 76 | "name": "rst_help", |
|
72 | 77 | "target": "http://docutils.sourceforge.net/docs/user/rst/quickref.html", |
|
73 | 78 | "external_target": "http://docutils.sourceforge.net/docs/user/rst/quickref.html", |
|
74 | 79 | }, |
|
75 | 80 | { |
|
76 | 81 | "name": "markdown_help", |
|
77 | 82 | "target": "https://daringfireball.net/projects/markdown/syntax", |
|
78 | 83 | "external_target": "https://daringfireball.net/projects/markdown/syntax", |
|
79 | 84 | }, |
|
80 | 85 | { |
|
81 | 86 | "name": "rhodecode_official", |
|
82 | 87 | "target": "https://rhodecode.com", |
|
83 | 88 | "external_target": "https://rhodecode.com/", |
|
84 | 89 | }, |
|
85 | 90 | { |
|
86 | 91 | "name": "rhodecode_support", |
|
87 | 92 | "target": "https://rhodecode.com/help/", |
|
88 | 93 | "external_target": "https://rhodecode.com/support", |
|
89 | 94 | }, |
|
90 | 95 | { |
|
91 | 96 | "name": "rhodecode_translations", |
|
92 | 97 | "target": "https://rhodecode.com/translate/enterprise", |
|
93 | 98 | "external_target": "https://www.transifex.com/rhodecode/RhodeCode/", |
|
94 | 99 | }, |
|
95 | 100 | |
|
96 | 101 | ] |
|
97 | 102 | |
|
98 | 103 | |
|
99 | 104 | def connect_redirection_links(config): |
|
100 | 105 | for link in link_config: |
|
101 | 106 | config.add_route(link['name'], link['target'], static=True) |
General Comments 0
You need to be logged in to leave comments.
Login now