Show More
@@ -0,0 +1,48 b'' | |||||
|
1 | # -*- coding: utf-8 -*- | |||
|
2 | ||||
|
3 | # Copyright (C) 2011-2019 RhodeCode GmbH | |||
|
4 | # | |||
|
5 | # This program is free software: you can redistribute it and/or modify | |||
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |||
|
7 | # (only), as published by the Free Software Foundation. | |||
|
8 | # | |||
|
9 | # This program is distributed in the hope that it will be useful, | |||
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
|
12 | # GNU General Public License for more details. | |||
|
13 | # | |||
|
14 | # You should have received a copy of the GNU Affero General Public License | |||
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
|
16 | # | |||
|
17 | # This program is dual-licensed. If you wish to learn more about the | |||
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |||
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |||
|
20 | ||||
|
21 | import logging | |||
|
22 | ||||
|
23 | from pyramid.view import view_config | |||
|
24 | ||||
|
25 | from rhodecode.apps._base import RepoAppView | |||
|
26 | from rhodecode.lib.auth import ( | |||
|
27 | LoginRequired, HasRepoPermissionAnyDecorator) | |||
|
28 | ||||
|
29 | log = logging.getLogger(__name__) | |||
|
30 | ||||
|
31 | ||||
|
32 | class RepoArtifactsView(RepoAppView): | |||
|
33 | ||||
|
34 | def load_default_context(self): | |||
|
35 | c = self._get_local_tmpl_context(include_app_defaults=True) | |||
|
36 | c.rhodecode_repo = self.rhodecode_vcs_repo | |||
|
37 | return c | |||
|
38 | ||||
|
39 | @LoginRequired() | |||
|
40 | @HasRepoPermissionAnyDecorator( | |||
|
41 | 'repository.read', 'repository.write', 'repository.admin') | |||
|
42 | @view_config( | |||
|
43 | route_name='repo_artifacts_list', request_method='GET', | |||
|
44 | renderer='rhodecode:templates/artifacts/artifact_list.mako') | |||
|
45 | def repo_artifacts(self): | |||
|
46 | c = self.load_default_context() | |||
|
47 | c.active = 'artifacts' | |||
|
48 | return self._get_template_context(c) |
@@ -0,0 +1,28 b'' | |||||
|
1 | ## -*- coding: utf-8 -*- | |||
|
2 | <%inherit file="/base/base.mako"/> | |||
|
3 | ||||
|
4 | <%def name="title()"> | |||
|
5 | ${_('{} Artifacts').format(c.repo_name)} | |||
|
6 | %if c.rhodecode_name: | |||
|
7 | · ${h.branding(c.rhodecode_name)} | |||
|
8 | %endif | |||
|
9 | </%def> | |||
|
10 | ||||
|
11 | <%def name="breadcrumbs_links()"></%def> | |||
|
12 | ||||
|
13 | <%def name="menu_bar_nav()"> | |||
|
14 | ${self.menu_items(active='repositories')} | |||
|
15 | </%def> | |||
|
16 | ||||
|
17 | <%def name="menu_bar_subnav()"> | |||
|
18 | ${self.repo_menu(active='artifacts')} | |||
|
19 | </%def> | |||
|
20 | ||||
|
21 | <%def name="main()"> | |||
|
22 | <div class="box"> | |||
|
23 | ||||
|
24 | <h4>${_('This feature is available in RhodeCode EE edition only. Contact {sales_email} to obtain a trial license.').format(sales_email='<a href="mailto:sales@rhodecode.com">sales@rhodecode.com</a>')|n}</h4> | |||
|
25 | <img style="width: 100%; height: 100%" src="${h.asset('images/ee_features/repo_artifacts.png')}"/> | |||
|
26 | </div> | |||
|
27 | ||||
|
28 | </%def> |
@@ -1,483 +1,488 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2016-2019 RhodeCode GmbH |
|
3 | # Copyright (C) 2016-2019 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 | from rhodecode.apps._base import add_route_with_slash |
|
20 | from rhodecode.apps._base import add_route_with_slash | |
21 |
|
21 | |||
22 |
|
22 | |||
23 | def includeme(config): |
|
23 | def includeme(config): | |
24 |
|
24 | |||
25 | # repo creating checks, special cases that aren't repo routes |
|
25 | # repo creating checks, special cases that aren't repo routes | |
26 | config.add_route( |
|
26 | config.add_route( | |
27 | name='repo_creating', |
|
27 | name='repo_creating', | |
28 | pattern='/{repo_name:.*?[^/]}/repo_creating') |
|
28 | pattern='/{repo_name:.*?[^/]}/repo_creating') | |
29 |
|
29 | |||
30 | config.add_route( |
|
30 | config.add_route( | |
31 | name='repo_creating_check', |
|
31 | name='repo_creating_check', | |
32 | pattern='/{repo_name:.*?[^/]}/repo_creating_check') |
|
32 | pattern='/{repo_name:.*?[^/]}/repo_creating_check') | |
33 |
|
33 | |||
34 | # Summary |
|
34 | # Summary | |
35 | # NOTE(marcink): one additional route is defined in very bottom, catch |
|
35 | # NOTE(marcink): one additional route is defined in very bottom, catch | |
36 | # all pattern |
|
36 | # all pattern | |
37 | config.add_route( |
|
37 | config.add_route( | |
38 | name='repo_summary_explicit', |
|
38 | name='repo_summary_explicit', | |
39 | pattern='/{repo_name:.*?[^/]}/summary', repo_route=True) |
|
39 | pattern='/{repo_name:.*?[^/]}/summary', repo_route=True) | |
40 | config.add_route( |
|
40 | config.add_route( | |
41 | name='repo_summary_commits', |
|
41 | name='repo_summary_commits', | |
42 | pattern='/{repo_name:.*?[^/]}/summary-commits', repo_route=True) |
|
42 | pattern='/{repo_name:.*?[^/]}/summary-commits', repo_route=True) | |
43 |
|
43 | |||
44 | # Commits |
|
44 | # Commits | |
45 | config.add_route( |
|
45 | config.add_route( | |
46 | name='repo_commit', |
|
46 | name='repo_commit', | |
47 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}', repo_route=True) |
|
47 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}', repo_route=True) | |
48 |
|
48 | |||
49 | config.add_route( |
|
49 | config.add_route( | |
50 | name='repo_commit_children', |
|
50 | name='repo_commit_children', | |
51 | pattern='/{repo_name:.*?[^/]}/changeset_children/{commit_id}', repo_route=True) |
|
51 | pattern='/{repo_name:.*?[^/]}/changeset_children/{commit_id}', repo_route=True) | |
52 |
|
52 | |||
53 | config.add_route( |
|
53 | config.add_route( | |
54 | name='repo_commit_parents', |
|
54 | name='repo_commit_parents', | |
55 | pattern='/{repo_name:.*?[^/]}/changeset_parents/{commit_id}', repo_route=True) |
|
55 | pattern='/{repo_name:.*?[^/]}/changeset_parents/{commit_id}', repo_route=True) | |
56 |
|
56 | |||
57 | config.add_route( |
|
57 | config.add_route( | |
58 | name='repo_commit_raw', |
|
58 | name='repo_commit_raw', | |
59 | pattern='/{repo_name:.*?[^/]}/changeset-diff/{commit_id}', repo_route=True) |
|
59 | pattern='/{repo_name:.*?[^/]}/changeset-diff/{commit_id}', repo_route=True) | |
60 |
|
60 | |||
61 | config.add_route( |
|
61 | config.add_route( | |
62 | name='repo_commit_patch', |
|
62 | name='repo_commit_patch', | |
63 | pattern='/{repo_name:.*?[^/]}/changeset-patch/{commit_id}', repo_route=True) |
|
63 | pattern='/{repo_name:.*?[^/]}/changeset-patch/{commit_id}', repo_route=True) | |
64 |
|
64 | |||
65 | config.add_route( |
|
65 | config.add_route( | |
66 | name='repo_commit_download', |
|
66 | name='repo_commit_download', | |
67 | pattern='/{repo_name:.*?[^/]}/changeset-download/{commit_id}', repo_route=True) |
|
67 | pattern='/{repo_name:.*?[^/]}/changeset-download/{commit_id}', repo_route=True) | |
68 |
|
68 | |||
69 | config.add_route( |
|
69 | config.add_route( | |
70 | name='repo_commit_data', |
|
70 | name='repo_commit_data', | |
71 | pattern='/{repo_name:.*?[^/]}/changeset-data/{commit_id}', repo_route=True) |
|
71 | pattern='/{repo_name:.*?[^/]}/changeset-data/{commit_id}', repo_route=True) | |
72 |
|
72 | |||
73 | config.add_route( |
|
73 | config.add_route( | |
74 | name='repo_commit_comment_create', |
|
74 | name='repo_commit_comment_create', | |
75 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/create', repo_route=True) |
|
75 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/create', repo_route=True) | |
76 |
|
76 | |||
77 | config.add_route( |
|
77 | config.add_route( | |
78 | name='repo_commit_comment_preview', |
|
78 | name='repo_commit_comment_preview', | |
79 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/preview', repo_route=True) |
|
79 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/preview', repo_route=True) | |
80 |
|
80 | |||
81 | config.add_route( |
|
81 | config.add_route( | |
82 | name='repo_commit_comment_delete', |
|
82 | name='repo_commit_comment_delete', | |
83 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/delete', repo_route=True) |
|
83 | pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/delete', repo_route=True) | |
84 |
|
84 | |||
85 | # still working url for backward compat. |
|
85 | # still working url for backward compat. | |
86 | config.add_route( |
|
86 | config.add_route( | |
87 | name='repo_commit_raw_deprecated', |
|
87 | name='repo_commit_raw_deprecated', | |
88 | pattern='/{repo_name:.*?[^/]}/raw-changeset/{commit_id}', repo_route=True) |
|
88 | pattern='/{repo_name:.*?[^/]}/raw-changeset/{commit_id}', repo_route=True) | |
89 |
|
89 | |||
90 | # Files |
|
90 | # Files | |
91 | config.add_route( |
|
91 | config.add_route( | |
92 | name='repo_archivefile', |
|
92 | name='repo_archivefile', | |
93 | pattern='/{repo_name:.*?[^/]}/archive/{fname}', repo_route=True) |
|
93 | pattern='/{repo_name:.*?[^/]}/archive/{fname}', repo_route=True) | |
94 |
|
94 | |||
95 | config.add_route( |
|
95 | config.add_route( | |
96 | name='repo_files_diff', |
|
96 | name='repo_files_diff', | |
97 | pattern='/{repo_name:.*?[^/]}/diff/{f_path:.*}', repo_route=True) |
|
97 | pattern='/{repo_name:.*?[^/]}/diff/{f_path:.*}', repo_route=True) | |
98 | config.add_route( # legacy route to make old links work |
|
98 | config.add_route( # legacy route to make old links work | |
99 | name='repo_files_diff_2way_redirect', |
|
99 | name='repo_files_diff_2way_redirect', | |
100 | pattern='/{repo_name:.*?[^/]}/diff-2way/{f_path:.*}', repo_route=True) |
|
100 | pattern='/{repo_name:.*?[^/]}/diff-2way/{f_path:.*}', repo_route=True) | |
101 |
|
101 | |||
102 | config.add_route( |
|
102 | config.add_route( | |
103 | name='repo_files', |
|
103 | name='repo_files', | |
104 | pattern='/{repo_name:.*?[^/]}/files/{commit_id}/{f_path:.*}', repo_route=True) |
|
104 | pattern='/{repo_name:.*?[^/]}/files/{commit_id}/{f_path:.*}', repo_route=True) | |
105 | config.add_route( |
|
105 | config.add_route( | |
106 | name='repo_files:default_path', |
|
106 | name='repo_files:default_path', | |
107 | pattern='/{repo_name:.*?[^/]}/files/{commit_id}/', repo_route=True) |
|
107 | pattern='/{repo_name:.*?[^/]}/files/{commit_id}/', repo_route=True) | |
108 | config.add_route( |
|
108 | config.add_route( | |
109 | name='repo_files:default_commit', |
|
109 | name='repo_files:default_commit', | |
110 | pattern='/{repo_name:.*?[^/]}/files', repo_route=True) |
|
110 | pattern='/{repo_name:.*?[^/]}/files', repo_route=True) | |
111 |
|
111 | |||
112 | config.add_route( |
|
112 | config.add_route( | |
113 | name='repo_files:rendered', |
|
113 | name='repo_files:rendered', | |
114 | pattern='/{repo_name:.*?[^/]}/render/{commit_id}/{f_path:.*}', repo_route=True) |
|
114 | pattern='/{repo_name:.*?[^/]}/render/{commit_id}/{f_path:.*}', repo_route=True) | |
115 |
|
115 | |||
116 | config.add_route( |
|
116 | config.add_route( | |
117 | name='repo_files:annotated', |
|
117 | name='repo_files:annotated', | |
118 | pattern='/{repo_name:.*?[^/]}/annotate/{commit_id}/{f_path:.*}', repo_route=True) |
|
118 | pattern='/{repo_name:.*?[^/]}/annotate/{commit_id}/{f_path:.*}', repo_route=True) | |
119 | config.add_route( |
|
119 | config.add_route( | |
120 | name='repo_files:annotated_previous', |
|
120 | name='repo_files:annotated_previous', | |
121 | pattern='/{repo_name:.*?[^/]}/annotate-previous/{commit_id}/{f_path:.*}', repo_route=True) |
|
121 | pattern='/{repo_name:.*?[^/]}/annotate-previous/{commit_id}/{f_path:.*}', repo_route=True) | |
122 |
|
122 | |||
123 | config.add_route( |
|
123 | config.add_route( | |
124 | name='repo_nodetree_full', |
|
124 | name='repo_nodetree_full', | |
125 | pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/{f_path:.*}', repo_route=True) |
|
125 | pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/{f_path:.*}', repo_route=True) | |
126 | config.add_route( |
|
126 | config.add_route( | |
127 | name='repo_nodetree_full:default_path', |
|
127 | name='repo_nodetree_full:default_path', | |
128 | pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/', repo_route=True) |
|
128 | pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/', repo_route=True) | |
129 |
|
129 | |||
130 | config.add_route( |
|
130 | config.add_route( | |
131 | name='repo_files_nodelist', |
|
131 | name='repo_files_nodelist', | |
132 | pattern='/{repo_name:.*?[^/]}/nodelist/{commit_id}/{f_path:.*}', repo_route=True) |
|
132 | pattern='/{repo_name:.*?[^/]}/nodelist/{commit_id}/{f_path:.*}', repo_route=True) | |
133 |
|
133 | |||
134 | config.add_route( |
|
134 | config.add_route( | |
135 | name='repo_file_raw', |
|
135 | name='repo_file_raw', | |
136 | pattern='/{repo_name:.*?[^/]}/raw/{commit_id}/{f_path:.*}', repo_route=True) |
|
136 | pattern='/{repo_name:.*?[^/]}/raw/{commit_id}/{f_path:.*}', repo_route=True) | |
137 |
|
137 | |||
138 | config.add_route( |
|
138 | config.add_route( | |
139 | name='repo_file_download', |
|
139 | name='repo_file_download', | |
140 | pattern='/{repo_name:.*?[^/]}/download/{commit_id}/{f_path:.*}', repo_route=True) |
|
140 | pattern='/{repo_name:.*?[^/]}/download/{commit_id}/{f_path:.*}', repo_route=True) | |
141 | config.add_route( # backward compat to keep old links working |
|
141 | config.add_route( # backward compat to keep old links working | |
142 | name='repo_file_download:legacy', |
|
142 | name='repo_file_download:legacy', | |
143 | pattern='/{repo_name:.*?[^/]}/rawfile/{commit_id}/{f_path:.*}', |
|
143 | pattern='/{repo_name:.*?[^/]}/rawfile/{commit_id}/{f_path:.*}', | |
144 | repo_route=True) |
|
144 | repo_route=True) | |
145 |
|
145 | |||
146 | config.add_route( |
|
146 | config.add_route( | |
147 | name='repo_file_history', |
|
147 | name='repo_file_history', | |
148 | pattern='/{repo_name:.*?[^/]}/history/{commit_id}/{f_path:.*}', repo_route=True) |
|
148 | pattern='/{repo_name:.*?[^/]}/history/{commit_id}/{f_path:.*}', repo_route=True) | |
149 |
|
149 | |||
150 | config.add_route( |
|
150 | config.add_route( | |
151 | name='repo_file_authors', |
|
151 | name='repo_file_authors', | |
152 | pattern='/{repo_name:.*?[^/]}/authors/{commit_id}/{f_path:.*}', repo_route=True) |
|
152 | pattern='/{repo_name:.*?[^/]}/authors/{commit_id}/{f_path:.*}', repo_route=True) | |
153 |
|
153 | |||
154 | config.add_route( |
|
154 | config.add_route( | |
155 | name='repo_files_remove_file', |
|
155 | name='repo_files_remove_file', | |
156 | pattern='/{repo_name:.*?[^/]}/remove_file/{commit_id}/{f_path:.*}', |
|
156 | pattern='/{repo_name:.*?[^/]}/remove_file/{commit_id}/{f_path:.*}', | |
157 | repo_route=True) |
|
157 | repo_route=True) | |
158 | config.add_route( |
|
158 | config.add_route( | |
159 | name='repo_files_delete_file', |
|
159 | name='repo_files_delete_file', | |
160 | pattern='/{repo_name:.*?[^/]}/delete_file/{commit_id}/{f_path:.*}', |
|
160 | pattern='/{repo_name:.*?[^/]}/delete_file/{commit_id}/{f_path:.*}', | |
161 | repo_route=True) |
|
161 | repo_route=True) | |
162 | config.add_route( |
|
162 | config.add_route( | |
163 | name='repo_files_edit_file', |
|
163 | name='repo_files_edit_file', | |
164 | pattern='/{repo_name:.*?[^/]}/edit_file/{commit_id}/{f_path:.*}', |
|
164 | pattern='/{repo_name:.*?[^/]}/edit_file/{commit_id}/{f_path:.*}', | |
165 | repo_route=True) |
|
165 | repo_route=True) | |
166 | config.add_route( |
|
166 | config.add_route( | |
167 | name='repo_files_update_file', |
|
167 | name='repo_files_update_file', | |
168 | pattern='/{repo_name:.*?[^/]}/update_file/{commit_id}/{f_path:.*}', |
|
168 | pattern='/{repo_name:.*?[^/]}/update_file/{commit_id}/{f_path:.*}', | |
169 | repo_route=True) |
|
169 | repo_route=True) | |
170 | config.add_route( |
|
170 | config.add_route( | |
171 | name='repo_files_add_file', |
|
171 | name='repo_files_add_file', | |
172 | pattern='/{repo_name:.*?[^/]}/add_file/{commit_id}/{f_path:.*}', |
|
172 | pattern='/{repo_name:.*?[^/]}/add_file/{commit_id}/{f_path:.*}', | |
173 | repo_route=True) |
|
173 | repo_route=True) | |
174 | config.add_route( |
|
174 | config.add_route( | |
175 | name='repo_files_create_file', |
|
175 | name='repo_files_create_file', | |
176 | pattern='/{repo_name:.*?[^/]}/create_file/{commit_id}/{f_path:.*}', |
|
176 | pattern='/{repo_name:.*?[^/]}/create_file/{commit_id}/{f_path:.*}', | |
177 | repo_route=True) |
|
177 | repo_route=True) | |
178 |
|
178 | |||
179 | # Refs data |
|
179 | # Refs data | |
180 | config.add_route( |
|
180 | config.add_route( | |
181 | name='repo_refs_data', |
|
181 | name='repo_refs_data', | |
182 | pattern='/{repo_name:.*?[^/]}/refs-data', repo_route=True) |
|
182 | pattern='/{repo_name:.*?[^/]}/refs-data', repo_route=True) | |
183 |
|
183 | |||
184 | config.add_route( |
|
184 | config.add_route( | |
185 | name='repo_refs_changelog_data', |
|
185 | name='repo_refs_changelog_data', | |
186 | pattern='/{repo_name:.*?[^/]}/refs-data-changelog', repo_route=True) |
|
186 | pattern='/{repo_name:.*?[^/]}/refs-data-changelog', repo_route=True) | |
187 |
|
187 | |||
188 | config.add_route( |
|
188 | config.add_route( | |
189 | name='repo_stats', |
|
189 | name='repo_stats', | |
190 | pattern='/{repo_name:.*?[^/]}/repo_stats/{commit_id}', repo_route=True) |
|
190 | pattern='/{repo_name:.*?[^/]}/repo_stats/{commit_id}', repo_route=True) | |
191 |
|
191 | |||
192 | # Changelog |
|
192 | # Changelog | |
193 | config.add_route( |
|
193 | config.add_route( | |
194 | name='repo_changelog', |
|
194 | name='repo_changelog', | |
195 | pattern='/{repo_name:.*?[^/]}/changelog', repo_route=True) |
|
195 | pattern='/{repo_name:.*?[^/]}/changelog', repo_route=True) | |
196 | config.add_route( |
|
196 | config.add_route( | |
197 | name='repo_changelog_file', |
|
197 | name='repo_changelog_file', | |
198 | pattern='/{repo_name:.*?[^/]}/changelog/{commit_id}/{f_path:.*}', repo_route=True) |
|
198 | pattern='/{repo_name:.*?[^/]}/changelog/{commit_id}/{f_path:.*}', repo_route=True) | |
199 | config.add_route( |
|
199 | config.add_route( | |
200 | name='repo_changelog_elements', |
|
200 | name='repo_changelog_elements', | |
201 | pattern='/{repo_name:.*?[^/]}/changelog_elements', repo_route=True) |
|
201 | pattern='/{repo_name:.*?[^/]}/changelog_elements', repo_route=True) | |
202 | config.add_route( |
|
202 | config.add_route( | |
203 | name='repo_changelog_elements_file', |
|
203 | name='repo_changelog_elements_file', | |
204 | pattern='/{repo_name:.*?[^/]}/changelog_elements/{commit_id}/{f_path:.*}', repo_route=True) |
|
204 | pattern='/{repo_name:.*?[^/]}/changelog_elements/{commit_id}/{f_path:.*}', repo_route=True) | |
205 |
|
205 | |||
206 | # Compare |
|
206 | # Compare | |
207 | config.add_route( |
|
207 | config.add_route( | |
208 | name='repo_compare_select', |
|
208 | name='repo_compare_select', | |
209 | pattern='/{repo_name:.*?[^/]}/compare', repo_route=True) |
|
209 | pattern='/{repo_name:.*?[^/]}/compare', repo_route=True) | |
210 |
|
210 | |||
211 | config.add_route( |
|
211 | config.add_route( | |
212 | name='repo_compare', |
|
212 | name='repo_compare', | |
213 | pattern='/{repo_name:.*?[^/]}/compare/{source_ref_type}@{source_ref:.*?}...{target_ref_type}@{target_ref:.*?}', repo_route=True) |
|
213 | pattern='/{repo_name:.*?[^/]}/compare/{source_ref_type}@{source_ref:.*?}...{target_ref_type}@{target_ref:.*?}', repo_route=True) | |
214 |
|
214 | |||
215 | # Tags |
|
215 | # Tags | |
216 | config.add_route( |
|
216 | config.add_route( | |
217 | name='tags_home', |
|
217 | name='tags_home', | |
218 | pattern='/{repo_name:.*?[^/]}/tags', repo_route=True) |
|
218 | pattern='/{repo_name:.*?[^/]}/tags', repo_route=True) | |
219 |
|
219 | |||
220 | # Branches |
|
220 | # Branches | |
221 | config.add_route( |
|
221 | config.add_route( | |
222 | name='branches_home', |
|
222 | name='branches_home', | |
223 | pattern='/{repo_name:.*?[^/]}/branches', repo_route=True) |
|
223 | pattern='/{repo_name:.*?[^/]}/branches', repo_route=True) | |
224 |
|
224 | |||
225 | # Bookmarks |
|
225 | # Bookmarks | |
226 | config.add_route( |
|
226 | config.add_route( | |
227 | name='bookmarks_home', |
|
227 | name='bookmarks_home', | |
228 | pattern='/{repo_name:.*?[^/]}/bookmarks', repo_route=True) |
|
228 | pattern='/{repo_name:.*?[^/]}/bookmarks', repo_route=True) | |
229 |
|
229 | |||
230 | # Forks |
|
230 | # Forks | |
231 | config.add_route( |
|
231 | config.add_route( | |
232 | name='repo_fork_new', |
|
232 | name='repo_fork_new', | |
233 | pattern='/{repo_name:.*?[^/]}/fork', repo_route=True, |
|
233 | pattern='/{repo_name:.*?[^/]}/fork', repo_route=True, | |
234 | repo_forbid_when_archived=True, |
|
234 | repo_forbid_when_archived=True, | |
235 | repo_accepted_types=['hg', 'git']) |
|
235 | repo_accepted_types=['hg', 'git']) | |
236 |
|
236 | |||
237 | config.add_route( |
|
237 | config.add_route( | |
238 | name='repo_fork_create', |
|
238 | name='repo_fork_create', | |
239 | pattern='/{repo_name:.*?[^/]}/fork/create', repo_route=True, |
|
239 | pattern='/{repo_name:.*?[^/]}/fork/create', repo_route=True, | |
240 | repo_forbid_when_archived=True, |
|
240 | repo_forbid_when_archived=True, | |
241 | repo_accepted_types=['hg', 'git']) |
|
241 | repo_accepted_types=['hg', 'git']) | |
242 |
|
242 | |||
243 | config.add_route( |
|
243 | config.add_route( | |
244 | name='repo_forks_show_all', |
|
244 | name='repo_forks_show_all', | |
245 | pattern='/{repo_name:.*?[^/]}/forks', repo_route=True, |
|
245 | pattern='/{repo_name:.*?[^/]}/forks', repo_route=True, | |
246 | repo_accepted_types=['hg', 'git']) |
|
246 | repo_accepted_types=['hg', 'git']) | |
247 | config.add_route( |
|
247 | config.add_route( | |
248 | name='repo_forks_data', |
|
248 | name='repo_forks_data', | |
249 | pattern='/{repo_name:.*?[^/]}/forks/data', repo_route=True, |
|
249 | pattern='/{repo_name:.*?[^/]}/forks/data', repo_route=True, | |
250 | repo_accepted_types=['hg', 'git']) |
|
250 | repo_accepted_types=['hg', 'git']) | |
251 |
|
251 | |||
252 | # Pull Requests |
|
252 | # Pull Requests | |
253 | config.add_route( |
|
253 | config.add_route( | |
254 | name='pullrequest_show', |
|
254 | name='pullrequest_show', | |
255 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}', |
|
255 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}', | |
256 | repo_route=True) |
|
256 | repo_route=True) | |
257 |
|
257 | |||
258 | config.add_route( |
|
258 | config.add_route( | |
259 | name='pullrequest_show_all', |
|
259 | name='pullrequest_show_all', | |
260 | pattern='/{repo_name:.*?[^/]}/pull-request', |
|
260 | pattern='/{repo_name:.*?[^/]}/pull-request', | |
261 | repo_route=True, repo_accepted_types=['hg', 'git']) |
|
261 | repo_route=True, repo_accepted_types=['hg', 'git']) | |
262 |
|
262 | |||
263 | config.add_route( |
|
263 | config.add_route( | |
264 | name='pullrequest_show_all_data', |
|
264 | name='pullrequest_show_all_data', | |
265 | pattern='/{repo_name:.*?[^/]}/pull-request-data', |
|
265 | pattern='/{repo_name:.*?[^/]}/pull-request-data', | |
266 | repo_route=True, repo_accepted_types=['hg', 'git']) |
|
266 | repo_route=True, repo_accepted_types=['hg', 'git']) | |
267 |
|
267 | |||
268 | config.add_route( |
|
268 | config.add_route( | |
269 | name='pullrequest_repo_refs', |
|
269 | name='pullrequest_repo_refs', | |
270 | pattern='/{repo_name:.*?[^/]}/pull-request/refs/{target_repo_name:.*?[^/]}', |
|
270 | pattern='/{repo_name:.*?[^/]}/pull-request/refs/{target_repo_name:.*?[^/]}', | |
271 | repo_route=True) |
|
271 | repo_route=True) | |
272 |
|
272 | |||
273 | config.add_route( |
|
273 | config.add_route( | |
274 | name='pullrequest_repo_targets', |
|
274 | name='pullrequest_repo_targets', | |
275 | pattern='/{repo_name:.*?[^/]}/pull-request/repo-targets', |
|
275 | pattern='/{repo_name:.*?[^/]}/pull-request/repo-targets', | |
276 | repo_route=True) |
|
276 | repo_route=True) | |
277 |
|
277 | |||
278 | config.add_route( |
|
278 | config.add_route( | |
279 | name='pullrequest_new', |
|
279 | name='pullrequest_new', | |
280 | pattern='/{repo_name:.*?[^/]}/pull-request/new', |
|
280 | pattern='/{repo_name:.*?[^/]}/pull-request/new', | |
281 | repo_route=True, repo_accepted_types=['hg', 'git'], |
|
281 | repo_route=True, repo_accepted_types=['hg', 'git'], | |
282 | repo_forbid_when_archived=True) |
|
282 | repo_forbid_when_archived=True) | |
283 |
|
283 | |||
284 | config.add_route( |
|
284 | config.add_route( | |
285 | name='pullrequest_create', |
|
285 | name='pullrequest_create', | |
286 | pattern='/{repo_name:.*?[^/]}/pull-request/create', |
|
286 | pattern='/{repo_name:.*?[^/]}/pull-request/create', | |
287 | repo_route=True, repo_accepted_types=['hg', 'git'], |
|
287 | repo_route=True, repo_accepted_types=['hg', 'git'], | |
288 | repo_forbid_when_archived=True) |
|
288 | repo_forbid_when_archived=True) | |
289 |
|
289 | |||
290 | config.add_route( |
|
290 | config.add_route( | |
291 | name='pullrequest_update', |
|
291 | name='pullrequest_update', | |
292 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/update', |
|
292 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/update', | |
293 | repo_route=True, repo_forbid_when_archived=True) |
|
293 | repo_route=True, repo_forbid_when_archived=True) | |
294 |
|
294 | |||
295 | config.add_route( |
|
295 | config.add_route( | |
296 | name='pullrequest_merge', |
|
296 | name='pullrequest_merge', | |
297 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/merge', |
|
297 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/merge', | |
298 | repo_route=True, repo_forbid_when_archived=True) |
|
298 | repo_route=True, repo_forbid_when_archived=True) | |
299 |
|
299 | |||
300 | config.add_route( |
|
300 | config.add_route( | |
301 | name='pullrequest_delete', |
|
301 | name='pullrequest_delete', | |
302 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/delete', |
|
302 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/delete', | |
303 | repo_route=True, repo_forbid_when_archived=True) |
|
303 | repo_route=True, repo_forbid_when_archived=True) | |
304 |
|
304 | |||
305 | config.add_route( |
|
305 | config.add_route( | |
306 | name='pullrequest_comment_create', |
|
306 | name='pullrequest_comment_create', | |
307 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment', |
|
307 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment', | |
308 | repo_route=True) |
|
308 | repo_route=True) | |
309 |
|
309 | |||
310 | config.add_route( |
|
310 | config.add_route( | |
311 | name='pullrequest_comment_delete', |
|
311 | name='pullrequest_comment_delete', | |
312 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/delete', |
|
312 | pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/delete', | |
313 | repo_route=True, repo_accepted_types=['hg', 'git']) |
|
313 | repo_route=True, repo_accepted_types=['hg', 'git']) | |
314 |
|
314 | |||
|
315 | # Artifacts, (EE feature) | |||
|
316 | config.add_route( | |||
|
317 | name='repo_artifacts_list', | |||
|
318 | pattern='/{repo_name:.*?[^/]}/artifacts', repo_route=True) | |||
|
319 | ||||
315 | # Settings |
|
320 | # Settings | |
316 | config.add_route( |
|
321 | config.add_route( | |
317 | name='edit_repo', |
|
322 | name='edit_repo', | |
318 | pattern='/{repo_name:.*?[^/]}/settings', repo_route=True) |
|
323 | pattern='/{repo_name:.*?[^/]}/settings', repo_route=True) | |
319 | # update is POST on edit_repo |
|
324 | # update is POST on edit_repo | |
320 |
|
325 | |||
321 | # Settings advanced |
|
326 | # Settings advanced | |
322 | config.add_route( |
|
327 | config.add_route( | |
323 | name='edit_repo_advanced', |
|
328 | name='edit_repo_advanced', | |
324 | pattern='/{repo_name:.*?[^/]}/settings/advanced', repo_route=True) |
|
329 | pattern='/{repo_name:.*?[^/]}/settings/advanced', repo_route=True) | |
325 | config.add_route( |
|
330 | config.add_route( | |
326 | name='edit_repo_advanced_archive', |
|
331 | name='edit_repo_advanced_archive', | |
327 | pattern='/{repo_name:.*?[^/]}/settings/advanced/archive', repo_route=True) |
|
332 | pattern='/{repo_name:.*?[^/]}/settings/advanced/archive', repo_route=True) | |
328 | config.add_route( |
|
333 | config.add_route( | |
329 | name='edit_repo_advanced_delete', |
|
334 | name='edit_repo_advanced_delete', | |
330 | pattern='/{repo_name:.*?[^/]}/settings/advanced/delete', repo_route=True) |
|
335 | pattern='/{repo_name:.*?[^/]}/settings/advanced/delete', repo_route=True) | |
331 | config.add_route( |
|
336 | config.add_route( | |
332 | name='edit_repo_advanced_locking', |
|
337 | name='edit_repo_advanced_locking', | |
333 | pattern='/{repo_name:.*?[^/]}/settings/advanced/locking', repo_route=True) |
|
338 | pattern='/{repo_name:.*?[^/]}/settings/advanced/locking', repo_route=True) | |
334 | config.add_route( |
|
339 | config.add_route( | |
335 | name='edit_repo_advanced_journal', |
|
340 | name='edit_repo_advanced_journal', | |
336 | pattern='/{repo_name:.*?[^/]}/settings/advanced/journal', repo_route=True) |
|
341 | pattern='/{repo_name:.*?[^/]}/settings/advanced/journal', repo_route=True) | |
337 | config.add_route( |
|
342 | config.add_route( | |
338 | name='edit_repo_advanced_fork', |
|
343 | name='edit_repo_advanced_fork', | |
339 | pattern='/{repo_name:.*?[^/]}/settings/advanced/fork', repo_route=True) |
|
344 | pattern='/{repo_name:.*?[^/]}/settings/advanced/fork', repo_route=True) | |
340 |
|
345 | |||
341 | config.add_route( |
|
346 | config.add_route( | |
342 | name='edit_repo_advanced_hooks', |
|
347 | name='edit_repo_advanced_hooks', | |
343 | pattern='/{repo_name:.*?[^/]}/settings/advanced/hooks', repo_route=True) |
|
348 | pattern='/{repo_name:.*?[^/]}/settings/advanced/hooks', repo_route=True) | |
344 |
|
349 | |||
345 | # Caches |
|
350 | # Caches | |
346 | config.add_route( |
|
351 | config.add_route( | |
347 | name='edit_repo_caches', |
|
352 | name='edit_repo_caches', | |
348 | pattern='/{repo_name:.*?[^/]}/settings/caches', repo_route=True) |
|
353 | pattern='/{repo_name:.*?[^/]}/settings/caches', repo_route=True) | |
349 |
|
354 | |||
350 | # Permissions |
|
355 | # Permissions | |
351 | config.add_route( |
|
356 | config.add_route( | |
352 | name='edit_repo_perms', |
|
357 | name='edit_repo_perms', | |
353 | pattern='/{repo_name:.*?[^/]}/settings/permissions', repo_route=True) |
|
358 | pattern='/{repo_name:.*?[^/]}/settings/permissions', repo_route=True) | |
354 |
|
359 | |||
355 | # Permissions Branch (EE feature) |
|
360 | # Permissions Branch (EE feature) | |
356 | config.add_route( |
|
361 | config.add_route( | |
357 | name='edit_repo_perms_branch', |
|
362 | name='edit_repo_perms_branch', | |
358 | pattern='/{repo_name:.*?[^/]}/settings/branch_permissions', repo_route=True) |
|
363 | pattern='/{repo_name:.*?[^/]}/settings/branch_permissions', repo_route=True) | |
359 | config.add_route( |
|
364 | config.add_route( | |
360 | name='edit_repo_perms_branch_delete', |
|
365 | name='edit_repo_perms_branch_delete', | |
361 | pattern='/{repo_name:.*?[^/]}/settings/branch_permissions/{rule_id}/delete', |
|
366 | pattern='/{repo_name:.*?[^/]}/settings/branch_permissions/{rule_id}/delete', | |
362 | repo_route=True) |
|
367 | repo_route=True) | |
363 |
|
368 | |||
364 | # Maintenance |
|
369 | # Maintenance | |
365 | config.add_route( |
|
370 | config.add_route( | |
366 | name='edit_repo_maintenance', |
|
371 | name='edit_repo_maintenance', | |
367 | pattern='/{repo_name:.*?[^/]}/settings/maintenance', repo_route=True) |
|
372 | pattern='/{repo_name:.*?[^/]}/settings/maintenance', repo_route=True) | |
368 |
|
373 | |||
369 | config.add_route( |
|
374 | config.add_route( | |
370 | name='edit_repo_maintenance_execute', |
|
375 | name='edit_repo_maintenance_execute', | |
371 | pattern='/{repo_name:.*?[^/]}/settings/maintenance/execute', repo_route=True) |
|
376 | pattern='/{repo_name:.*?[^/]}/settings/maintenance/execute', repo_route=True) | |
372 |
|
377 | |||
373 | # Fields |
|
378 | # Fields | |
374 | config.add_route( |
|
379 | config.add_route( | |
375 | name='edit_repo_fields', |
|
380 | name='edit_repo_fields', | |
376 | pattern='/{repo_name:.*?[^/]}/settings/fields', repo_route=True) |
|
381 | pattern='/{repo_name:.*?[^/]}/settings/fields', repo_route=True) | |
377 | config.add_route( |
|
382 | config.add_route( | |
378 | name='edit_repo_fields_create', |
|
383 | name='edit_repo_fields_create', | |
379 | pattern='/{repo_name:.*?[^/]}/settings/fields/create', repo_route=True) |
|
384 | pattern='/{repo_name:.*?[^/]}/settings/fields/create', repo_route=True) | |
380 | config.add_route( |
|
385 | config.add_route( | |
381 | name='edit_repo_fields_delete', |
|
386 | name='edit_repo_fields_delete', | |
382 | pattern='/{repo_name:.*?[^/]}/settings/fields/{field_id}/delete', repo_route=True) |
|
387 | pattern='/{repo_name:.*?[^/]}/settings/fields/{field_id}/delete', repo_route=True) | |
383 |
|
388 | |||
384 | # Locking |
|
389 | # Locking | |
385 | config.add_route( |
|
390 | config.add_route( | |
386 | name='repo_edit_toggle_locking', |
|
391 | name='repo_edit_toggle_locking', | |
387 | pattern='/{repo_name:.*?[^/]}/settings/toggle_locking', repo_route=True) |
|
392 | pattern='/{repo_name:.*?[^/]}/settings/toggle_locking', repo_route=True) | |
388 |
|
393 | |||
389 | # Remote |
|
394 | # Remote | |
390 | config.add_route( |
|
395 | config.add_route( | |
391 | name='edit_repo_remote', |
|
396 | name='edit_repo_remote', | |
392 | pattern='/{repo_name:.*?[^/]}/settings/remote', repo_route=True) |
|
397 | pattern='/{repo_name:.*?[^/]}/settings/remote', repo_route=True) | |
393 | config.add_route( |
|
398 | config.add_route( | |
394 | name='edit_repo_remote_pull', |
|
399 | name='edit_repo_remote_pull', | |
395 | pattern='/{repo_name:.*?[^/]}/settings/remote/pull', repo_route=True) |
|
400 | pattern='/{repo_name:.*?[^/]}/settings/remote/pull', repo_route=True) | |
396 | config.add_route( |
|
401 | config.add_route( | |
397 | name='edit_repo_remote_push', |
|
402 | name='edit_repo_remote_push', | |
398 | pattern='/{repo_name:.*?[^/]}/settings/remote/push', repo_route=True) |
|
403 | pattern='/{repo_name:.*?[^/]}/settings/remote/push', repo_route=True) | |
399 |
|
404 | |||
400 | # Statistics |
|
405 | # Statistics | |
401 | config.add_route( |
|
406 | config.add_route( | |
402 | name='edit_repo_statistics', |
|
407 | name='edit_repo_statistics', | |
403 | pattern='/{repo_name:.*?[^/]}/settings/statistics', repo_route=True) |
|
408 | pattern='/{repo_name:.*?[^/]}/settings/statistics', repo_route=True) | |
404 | config.add_route( |
|
409 | config.add_route( | |
405 | name='edit_repo_statistics_reset', |
|
410 | name='edit_repo_statistics_reset', | |
406 | pattern='/{repo_name:.*?[^/]}/settings/statistics/update', repo_route=True) |
|
411 | pattern='/{repo_name:.*?[^/]}/settings/statistics/update', repo_route=True) | |
407 |
|
412 | |||
408 | # Issue trackers |
|
413 | # Issue trackers | |
409 | config.add_route( |
|
414 | config.add_route( | |
410 | name='edit_repo_issuetracker', |
|
415 | name='edit_repo_issuetracker', | |
411 | pattern='/{repo_name:.*?[^/]}/settings/issue_trackers', repo_route=True) |
|
416 | pattern='/{repo_name:.*?[^/]}/settings/issue_trackers', repo_route=True) | |
412 | config.add_route( |
|
417 | config.add_route( | |
413 | name='edit_repo_issuetracker_test', |
|
418 | name='edit_repo_issuetracker_test', | |
414 | pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/test', repo_route=True) |
|
419 | pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/test', repo_route=True) | |
415 | config.add_route( |
|
420 | config.add_route( | |
416 | name='edit_repo_issuetracker_delete', |
|
421 | name='edit_repo_issuetracker_delete', | |
417 | pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/delete', repo_route=True) |
|
422 | pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/delete', repo_route=True) | |
418 | config.add_route( |
|
423 | config.add_route( | |
419 | name='edit_repo_issuetracker_update', |
|
424 | name='edit_repo_issuetracker_update', | |
420 | pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/update', repo_route=True) |
|
425 | pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/update', repo_route=True) | |
421 |
|
426 | |||
422 | # VCS Settings |
|
427 | # VCS Settings | |
423 | config.add_route( |
|
428 | config.add_route( | |
424 | name='edit_repo_vcs', |
|
429 | name='edit_repo_vcs', | |
425 | pattern='/{repo_name:.*?[^/]}/settings/vcs', repo_route=True) |
|
430 | pattern='/{repo_name:.*?[^/]}/settings/vcs', repo_route=True) | |
426 | config.add_route( |
|
431 | config.add_route( | |
427 | name='edit_repo_vcs_update', |
|
432 | name='edit_repo_vcs_update', | |
428 | pattern='/{repo_name:.*?[^/]}/settings/vcs/update', repo_route=True) |
|
433 | pattern='/{repo_name:.*?[^/]}/settings/vcs/update', repo_route=True) | |
429 |
|
434 | |||
430 | # svn pattern |
|
435 | # svn pattern | |
431 | config.add_route( |
|
436 | config.add_route( | |
432 | name='edit_repo_vcs_svn_pattern_delete', |
|
437 | name='edit_repo_vcs_svn_pattern_delete', | |
433 | pattern='/{repo_name:.*?[^/]}/settings/vcs/svn_pattern/delete', repo_route=True) |
|
438 | pattern='/{repo_name:.*?[^/]}/settings/vcs/svn_pattern/delete', repo_route=True) | |
434 |
|
439 | |||
435 | # Repo Review Rules (EE feature) |
|
440 | # Repo Review Rules (EE feature) | |
436 | config.add_route( |
|
441 | config.add_route( | |
437 | name='repo_reviewers', |
|
442 | name='repo_reviewers', | |
438 | pattern='/{repo_name:.*?[^/]}/settings/review/rules', repo_route=True) |
|
443 | pattern='/{repo_name:.*?[^/]}/settings/review/rules', repo_route=True) | |
439 |
|
444 | |||
440 | config.add_route( |
|
445 | config.add_route( | |
441 | name='repo_default_reviewers_data', |
|
446 | name='repo_default_reviewers_data', | |
442 | pattern='/{repo_name:.*?[^/]}/settings/review/default-reviewers', repo_route=True) |
|
447 | pattern='/{repo_name:.*?[^/]}/settings/review/default-reviewers', repo_route=True) | |
443 |
|
448 | |||
444 | # Repo Automation (EE feature) |
|
449 | # Repo Automation (EE feature) | |
445 | config.add_route( |
|
450 | config.add_route( | |
446 | name='repo_automation', |
|
451 | name='repo_automation', | |
447 | pattern='/{repo_name:.*?[^/]}/settings/automation', repo_route=True) |
|
452 | pattern='/{repo_name:.*?[^/]}/settings/automation', repo_route=True) | |
448 |
|
453 | |||
449 | # Strip |
|
454 | # Strip | |
450 | config.add_route( |
|
455 | config.add_route( | |
451 | name='edit_repo_strip', |
|
456 | name='edit_repo_strip', | |
452 | pattern='/{repo_name:.*?[^/]}/settings/strip', repo_route=True) |
|
457 | pattern='/{repo_name:.*?[^/]}/settings/strip', repo_route=True) | |
453 |
|
458 | |||
454 | config.add_route( |
|
459 | config.add_route( | |
455 | name='strip_check', |
|
460 | name='strip_check', | |
456 | pattern='/{repo_name:.*?[^/]}/settings/strip_check', repo_route=True) |
|
461 | pattern='/{repo_name:.*?[^/]}/settings/strip_check', repo_route=True) | |
457 |
|
462 | |||
458 | config.add_route( |
|
463 | config.add_route( | |
459 | name='strip_execute', |
|
464 | name='strip_execute', | |
460 | pattern='/{repo_name:.*?[^/]}/settings/strip_execute', repo_route=True) |
|
465 | pattern='/{repo_name:.*?[^/]}/settings/strip_execute', repo_route=True) | |
461 |
|
466 | |||
462 | # Audit logs |
|
467 | # Audit logs | |
463 | config.add_route( |
|
468 | config.add_route( | |
464 | name='edit_repo_audit_logs', |
|
469 | name='edit_repo_audit_logs', | |
465 | pattern='/{repo_name:.*?[^/]}/settings/audit_logs', repo_route=True) |
|
470 | pattern='/{repo_name:.*?[^/]}/settings/audit_logs', repo_route=True) | |
466 |
|
471 | |||
467 | # ATOM/RSS Feed |
|
472 | # ATOM/RSS Feed | |
468 | config.add_route( |
|
473 | config.add_route( | |
469 | name='rss_feed_home', |
|
474 | name='rss_feed_home', | |
470 | pattern='/{repo_name:.*?[^/]}/feed/rss', repo_route=True) |
|
475 | pattern='/{repo_name:.*?[^/]}/feed/rss', repo_route=True) | |
471 |
|
476 | |||
472 | config.add_route( |
|
477 | config.add_route( | |
473 | name='atom_feed_home', |
|
478 | name='atom_feed_home', | |
474 | pattern='/{repo_name:.*?[^/]}/feed/atom', repo_route=True) |
|
479 | pattern='/{repo_name:.*?[^/]}/feed/atom', repo_route=True) | |
475 |
|
480 | |||
476 | # NOTE(marcink): needs to be at the end for catch-all |
|
481 | # NOTE(marcink): needs to be at the end for catch-all | |
477 | add_route_with_slash( |
|
482 | add_route_with_slash( | |
478 | config, |
|
483 | config, | |
479 | name='repo_summary', |
|
484 | name='repo_summary', | |
480 | pattern='/{repo_name:.*?[^/]}', repo_route=True) |
|
485 | pattern='/{repo_name:.*?[^/]}', repo_route=True) | |
481 |
|
486 | |||
482 | # Scan module for configuration decorators. |
|
487 | # Scan module for configuration decorators. | |
483 | config.scan('.views', ignore='.tests') |
|
488 | config.scan('.views', ignore='.tests') |
@@ -1,960 +1,962 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="root.mako"/> |
|
2 | <%inherit file="root.mako"/> | |
3 |
|
3 | |||
4 | <%include file="/ejs_templates/templates.html"/> |
|
4 | <%include file="/ejs_templates/templates.html"/> | |
5 |
|
5 | |||
6 | <div class="outerwrapper"> |
|
6 | <div class="outerwrapper"> | |
7 | <!-- HEADER --> |
|
7 | <!-- HEADER --> | |
8 | <div class="header"> |
|
8 | <div class="header"> | |
9 | <div id="header-inner" class="wrapper"> |
|
9 | <div id="header-inner" class="wrapper"> | |
10 | <div id="logo"> |
|
10 | <div id="logo"> | |
11 | <div class="logo-wrapper"> |
|
11 | <div class="logo-wrapper"> | |
12 | <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a> |
|
12 | <a href="${h.route_path('home')}"><img src="${h.asset('images/rhodecode-logo-white-60x60.png')}" alt="RhodeCode"/></a> | |
13 | </div> |
|
13 | </div> | |
14 | % if c.rhodecode_name: |
|
14 | % if c.rhodecode_name: | |
15 | <div class="branding"> |
|
15 | <div class="branding"> | |
16 | <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a> |
|
16 | <a href="${h.route_path('home')}">${h.branding(c.rhodecode_name)}</a> | |
17 | </div> |
|
17 | </div> | |
18 | % endif |
|
18 | % endif | |
19 | </div> |
|
19 | </div> | |
20 | <!-- MENU BAR NAV --> |
|
20 | <!-- MENU BAR NAV --> | |
21 | ${self.menu_bar_nav()} |
|
21 | ${self.menu_bar_nav()} | |
22 | <!-- END MENU BAR NAV --> |
|
22 | <!-- END MENU BAR NAV --> | |
23 | </div> |
|
23 | </div> | |
24 | </div> |
|
24 | </div> | |
25 | ${self.menu_bar_subnav()} |
|
25 | ${self.menu_bar_subnav()} | |
26 | <!-- END HEADER --> |
|
26 | <!-- END HEADER --> | |
27 |
|
27 | |||
28 | <!-- CONTENT --> |
|
28 | <!-- CONTENT --> | |
29 | <div id="content" class="wrapper"> |
|
29 | <div id="content" class="wrapper"> | |
30 |
|
30 | |||
31 | <rhodecode-toast id="notifications"></rhodecode-toast> |
|
31 | <rhodecode-toast id="notifications"></rhodecode-toast> | |
32 |
|
32 | |||
33 | <div class="main"> |
|
33 | <div class="main"> | |
34 | ${next.main()} |
|
34 | ${next.main()} | |
35 | </div> |
|
35 | </div> | |
36 | </div> |
|
36 | </div> | |
37 | <!-- END CONTENT --> |
|
37 | <!-- END CONTENT --> | |
38 |
|
38 | |||
39 | </div> |
|
39 | </div> | |
40 | <!-- FOOTER --> |
|
40 | <!-- FOOTER --> | |
41 | <div id="footer"> |
|
41 | <div id="footer"> | |
42 | <div id="footer-inner" class="title wrapper"> |
|
42 | <div id="footer-inner" class="title wrapper"> | |
43 | <div> |
|
43 | <div> | |
44 | <p class="footer-link-right"> |
|
44 | <p class="footer-link-right"> | |
45 | % if c.visual.show_version: |
|
45 | % if c.visual.show_version: | |
46 | RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition} |
|
46 | RhodeCode Enterprise ${c.rhodecode_version} ${c.rhodecode_edition} | |
47 | % endif |
|
47 | % endif | |
48 | © 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved. |
|
48 | © 2010-${h.datetime.today().year}, <a href="${h.route_url('rhodecode_official')}" target="_blank">RhodeCode GmbH</a>. All rights reserved. | |
49 | % if c.visual.rhodecode_support_url: |
|
49 | % if c.visual.rhodecode_support_url: | |
50 | <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a> |
|
50 | <a href="${c.visual.rhodecode_support_url}" target="_blank">${_('Support')}</a> | |
51 | % endif |
|
51 | % endif | |
52 | </p> |
|
52 | </p> | |
53 | <% sid = 'block' if request.GET.get('showrcid') else 'none' %> |
|
53 | <% sid = 'block' if request.GET.get('showrcid') else 'none' %> | |
54 | <p class="server-instance" style="display:${sid}"> |
|
54 | <p class="server-instance" style="display:${sid}"> | |
55 | ## display hidden instance ID if specially defined |
|
55 | ## display hidden instance ID if specially defined | |
56 | % if c.rhodecode_instanceid: |
|
56 | % if c.rhodecode_instanceid: | |
57 | ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)} |
|
57 | ${_('RhodeCode instance id: {}').format(c.rhodecode_instanceid)} | |
58 | % endif |
|
58 | % endif | |
59 | </p> |
|
59 | </p> | |
60 | </div> |
|
60 | </div> | |
61 | </div> |
|
61 | </div> | |
62 | </div> |
|
62 | </div> | |
63 |
|
63 | |||
64 | <!-- END FOOTER --> |
|
64 | <!-- END FOOTER --> | |
65 |
|
65 | |||
66 | ### MAKO DEFS ### |
|
66 | ### MAKO DEFS ### | |
67 |
|
67 | |||
68 | <%def name="menu_bar_subnav()"> |
|
68 | <%def name="menu_bar_subnav()"> | |
69 | </%def> |
|
69 | </%def> | |
70 |
|
70 | |||
71 | <%def name="breadcrumbs(class_='breadcrumbs')"> |
|
71 | <%def name="breadcrumbs(class_='breadcrumbs')"> | |
72 | <div class="${class_}"> |
|
72 | <div class="${class_}"> | |
73 | ${self.breadcrumbs_links()} |
|
73 | ${self.breadcrumbs_links()} | |
74 | </div> |
|
74 | </div> | |
75 | </%def> |
|
75 | </%def> | |
76 |
|
76 | |||
77 | <%def name="admin_menu(active=None)"> |
|
77 | <%def name="admin_menu(active=None)"> | |
78 | <% |
|
78 | <% | |
79 | def is_active(selected): |
|
79 | def is_active(selected): | |
80 | if selected == active: |
|
80 | if selected == active: | |
81 | return "active" |
|
81 | return "active" | |
82 | %> |
|
82 | %> | |
83 |
|
83 | |||
84 | <div id="context-bar"> |
|
84 | <div id="context-bar"> | |
85 | <div class="wrapper"> |
|
85 | <div class="wrapper"> | |
86 | <div class="title"> |
|
86 | <div class="title"> | |
87 | <div class="title-content"> |
|
87 | <div class="title-content"> | |
88 | <div class="title-main"> |
|
88 | <div class="title-main"> | |
89 | % if c.is_super_admin: |
|
89 | % if c.is_super_admin: | |
90 | ${_('Super Admin Panel')} |
|
90 | ${_('Super Admin Panel')} | |
91 | % else: |
|
91 | % else: | |
92 | ${_('Delegated Admin Panel')} |
|
92 | ${_('Delegated Admin Panel')} | |
93 | % endif |
|
93 | % endif | |
94 | </div> |
|
94 | </div> | |
95 | </div> |
|
95 | </div> | |
96 | </div> |
|
96 | </div> | |
97 |
|
97 | |||
98 | <ul id="context-pages" class="navigation horizontal-list"> |
|
98 | <ul id="context-pages" class="navigation horizontal-list"> | |
99 |
|
99 | |||
100 | ## super admin case |
|
100 | ## super admin case | |
101 | % if c.is_super_admin: |
|
101 | % if c.is_super_admin: | |
102 | <li class="${is_active('audit_logs')}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li> |
|
102 | <li class="${is_active('audit_logs')}"><a href="${h.route_path('admin_audit_logs')}">${_('Admin audit logs')}</a></li> | |
103 | <li class="${is_active('repositories')}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li> |
|
103 | <li class="${is_active('repositories')}"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li> | |
104 | <li class="${is_active('repository_groups')}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li> |
|
104 | <li class="${is_active('repository_groups')}"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li> | |
105 | <li class="${is_active('users')}"><a href="${h.route_path('users')}">${_('Users')}</a></li> |
|
105 | <li class="${is_active('users')}"><a href="${h.route_path('users')}">${_('Users')}</a></li> | |
106 | <li class="${is_active('user_groups')}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li> |
|
106 | <li class="${is_active('user_groups')}"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li> | |
107 | <li class="${is_active('permissions')}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li> |
|
107 | <li class="${is_active('permissions')}"><a href="${h.route_path('admin_permissions_application')}">${_('Permissions')}</a></li> | |
108 | <li class="${is_active('authentication')}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li> |
|
108 | <li class="${is_active('authentication')}"><a href="${h.route_path('auth_home', traverse='')}">${_('Authentication')}</a></li> | |
109 | <li class="${is_active('integrations')}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li> |
|
109 | <li class="${is_active('integrations')}"><a href="${h.route_path('global_integrations_home')}">${_('Integrations')}</a></li> | |
110 | <li class="${is_active('defaults')}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li> |
|
110 | <li class="${is_active('defaults')}"><a href="${h.route_path('admin_defaults_repositories')}">${_('Defaults')}</a></li> | |
111 | <li class="${is_active('settings')}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li> |
|
111 | <li class="${is_active('settings')}"><a href="${h.route_path('admin_settings')}">${_('Settings')}</a></li> | |
112 |
|
112 | |||
113 | ## delegated admin |
|
113 | ## delegated admin | |
114 | % elif c.is_delegated_admin: |
|
114 | % elif c.is_delegated_admin: | |
115 | <% |
|
115 | <% | |
116 | repositories=c.auth_user.repositories_admin or c.can_create_repo |
|
116 | repositories=c.auth_user.repositories_admin or c.can_create_repo | |
117 | repository_groups=c.auth_user.repository_groups_admin or c.can_create_repo_group |
|
117 | repository_groups=c.auth_user.repository_groups_admin or c.can_create_repo_group | |
118 | user_groups=c.auth_user.user_groups_admin or c.can_create_user_group |
|
118 | user_groups=c.auth_user.user_groups_admin or c.can_create_user_group | |
119 | %> |
|
119 | %> | |
120 |
|
120 | |||
121 | %if repositories: |
|
121 | %if repositories: | |
122 | <li class="${is_active('repositories')} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li> |
|
122 | <li class="${is_active('repositories')} local-admin-repos"><a href="${h.route_path('repos')}">${_('Repositories')}</a></li> | |
123 | %endif |
|
123 | %endif | |
124 | %if repository_groups: |
|
124 | %if repository_groups: | |
125 | <li class="${is_active('repository_groups')} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li> |
|
125 | <li class="${is_active('repository_groups')} local-admin-repo-groups"><a href="${h.route_path('repo_groups')}">${_('Repository groups')}</a></li> | |
126 | %endif |
|
126 | %endif | |
127 | %if user_groups: |
|
127 | %if user_groups: | |
128 | <li class="${is_active('user_groups')} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li> |
|
128 | <li class="${is_active('user_groups')} local-admin-user-groups"><a href="${h.route_path('user_groups')}">${_('User groups')}</a></li> | |
129 | %endif |
|
129 | %endif | |
130 | % endif |
|
130 | % endif | |
131 | </ul> |
|
131 | </ul> | |
132 |
|
132 | |||
133 | </div> |
|
133 | </div> | |
134 | <div class="clear"></div> |
|
134 | <div class="clear"></div> | |
135 | </div> |
|
135 | </div> | |
136 | </%def> |
|
136 | </%def> | |
137 |
|
137 | |||
138 | <%def name="dt_info_panel(elements)"> |
|
138 | <%def name="dt_info_panel(elements)"> | |
139 | <dl class="dl-horizontal"> |
|
139 | <dl class="dl-horizontal"> | |
140 | %for dt, dd, title, show_items in elements: |
|
140 | %for dt, dd, title, show_items in elements: | |
141 | <dt>${dt}:</dt> |
|
141 | <dt>${dt}:</dt> | |
142 | <dd title="${h.tooltip(title)}"> |
|
142 | <dd title="${h.tooltip(title)}"> | |
143 | %if callable(dd): |
|
143 | %if callable(dd): | |
144 | ## allow lazy evaluation of elements |
|
144 | ## allow lazy evaluation of elements | |
145 | ${dd()} |
|
145 | ${dd()} | |
146 | %else: |
|
146 | %else: | |
147 | ${dd} |
|
147 | ${dd} | |
148 | %endif |
|
148 | %endif | |
149 | %if show_items: |
|
149 | %if show_items: | |
150 | <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span> |
|
150 | <span class="btn-collapse" data-toggle="item-${h.md5_safe(dt)[:6]}-details">${_('Show More')} </span> | |
151 | %endif |
|
151 | %endif | |
152 | </dd> |
|
152 | </dd> | |
153 |
|
153 | |||
154 | %if show_items: |
|
154 | %if show_items: | |
155 | <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none"> |
|
155 | <div class="collapsable-content" data-toggle="item-${h.md5_safe(dt)[:6]}-details" style="display: none"> | |
156 | %for item in show_items: |
|
156 | %for item in show_items: | |
157 | <dt></dt> |
|
157 | <dt></dt> | |
158 | <dd>${item}</dd> |
|
158 | <dd>${item}</dd> | |
159 | %endfor |
|
159 | %endfor | |
160 | </div> |
|
160 | </div> | |
161 | %endif |
|
161 | %endif | |
162 |
|
162 | |||
163 | %endfor |
|
163 | %endfor | |
164 | </dl> |
|
164 | </dl> | |
165 | </%def> |
|
165 | </%def> | |
166 |
|
166 | |||
167 | <%def name="gravatar(email, size=16)"> |
|
167 | <%def name="gravatar(email, size=16)"> | |
168 | <% |
|
168 | <% | |
169 | if (size > 16): |
|
169 | if (size > 16): | |
170 | gravatar_class = 'gravatar gravatar-large' |
|
170 | gravatar_class = 'gravatar gravatar-large' | |
171 | else: |
|
171 | else: | |
172 | gravatar_class = 'gravatar' |
|
172 | gravatar_class = 'gravatar' | |
173 | %> |
|
173 | %> | |
174 | <%doc> |
|
174 | <%doc> | |
175 | TODO: johbo: For now we serve double size images to make it smooth |
|
175 | TODO: johbo: For now we serve double size images to make it smooth | |
176 | for retina. This is how it worked until now. Should be replaced |
|
176 | for retina. This is how it worked until now. Should be replaced | |
177 | with a better solution at some point. |
|
177 | with a better solution at some point. | |
178 | </%doc> |
|
178 | </%doc> | |
179 | <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}"> |
|
179 | <img class="${gravatar_class}" src="${h.gravatar_url(email, size * 2)}" height="${size}" width="${size}"> | |
180 | </%def> |
|
180 | </%def> | |
181 |
|
181 | |||
182 |
|
182 | |||
183 | <%def name="gravatar_with_user(contact, size=16, show_disabled=False)"> |
|
183 | <%def name="gravatar_with_user(contact, size=16, show_disabled=False)"> | |
184 | <% email = h.email_or_none(contact) %> |
|
184 | <% email = h.email_or_none(contact) %> | |
185 | <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}"> |
|
185 | <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}"> | |
186 | ${self.gravatar(email, size)} |
|
186 | ${self.gravatar(email, size)} | |
187 | <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span> |
|
187 | <span class="${'user user-disabled' if show_disabled else 'user'}"> ${h.link_to_user(contact)}</span> | |
188 | </div> |
|
188 | </div> | |
189 | </%def> |
|
189 | </%def> | |
190 |
|
190 | |||
191 |
|
191 | |||
192 | <%def name="repo_page_title(repo_instance)"> |
|
192 | <%def name="repo_page_title(repo_instance)"> | |
193 | <div class="title-content repo-title"> |
|
193 | <div class="title-content repo-title"> | |
194 | <div class="title-main"> |
|
194 | <div class="title-main"> | |
195 | ## SVN/HG/GIT icons |
|
195 | ## SVN/HG/GIT icons | |
196 | %if h.is_hg(repo_instance): |
|
196 | %if h.is_hg(repo_instance): | |
197 | <i class="icon-hg"></i> |
|
197 | <i class="icon-hg"></i> | |
198 | %endif |
|
198 | %endif | |
199 | %if h.is_git(repo_instance): |
|
199 | %if h.is_git(repo_instance): | |
200 | <i class="icon-git"></i> |
|
200 | <i class="icon-git"></i> | |
201 | %endif |
|
201 | %endif | |
202 | %if h.is_svn(repo_instance): |
|
202 | %if h.is_svn(repo_instance): | |
203 | <i class="icon-svn"></i> |
|
203 | <i class="icon-svn"></i> | |
204 | %endif |
|
204 | %endif | |
205 |
|
205 | |||
206 | ## public/private |
|
206 | ## public/private | |
207 | %if repo_instance.private: |
|
207 | %if repo_instance.private: | |
208 | <i class="icon-repo-private"></i> |
|
208 | <i class="icon-repo-private"></i> | |
209 | %else: |
|
209 | %else: | |
210 | <i class="icon-repo-public"></i> |
|
210 | <i class="icon-repo-public"></i> | |
211 | %endif |
|
211 | %endif | |
212 |
|
212 | |||
213 | ## repo name with group name |
|
213 | ## repo name with group name | |
214 | ${h.breadcrumb_repo_link(repo_instance)} |
|
214 | ${h.breadcrumb_repo_link(repo_instance)} | |
215 |
|
215 | |||
216 | ## Context Actions |
|
216 | ## Context Actions | |
217 | <div class="pull-right"> |
|
217 | <div class="pull-right"> | |
218 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
218 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
219 | <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_name, _query=dict(auth_token=c.rhodecode_user.feed_token))}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a> |
|
219 | <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_name, _query=dict(auth_token=c.rhodecode_user.feed_token))}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a> | |
220 |
|
220 | |||
221 | <a href="#WatchRepo" onclick="toggleFollowingRepo(this, templateContext.repo_id); return false" title="${_('Watch this Repository and actions on it in your personalized journal')}" class="btn btn-sm ${('watching' if c.repository_is_user_following else '')}"> |
|
221 | <a href="#WatchRepo" onclick="toggleFollowingRepo(this, templateContext.repo_id); return false" title="${_('Watch this Repository and actions on it in your personalized journal')}" class="btn btn-sm ${('watching' if c.repository_is_user_following else '')}"> | |
222 | % if c.repository_is_user_following: |
|
222 | % if c.repository_is_user_following: | |
223 | Unwatch |
|
223 | Unwatch | |
224 | % else: |
|
224 | % else: | |
225 | Watch |
|
225 | Watch | |
226 | % endif |
|
226 | % endif | |
227 |
|
227 | |||
228 | </a> |
|
228 | </a> | |
229 | %else: |
|
229 | %else: | |
230 | <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_name)}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a> |
|
230 | <a href="${h.route_path('atom_feed_home', repo_name=c.rhodecode_db_repo.repo_name)}" title="${_('RSS Feed')}" class="btn btn-sm"><i class="icon-rss-sign"></i>RSS</a> | |
231 | %endif |
|
231 | %endif | |
232 | </div> |
|
232 | </div> | |
233 |
|
233 | |||
234 | </div> |
|
234 | </div> | |
235 |
|
235 | |||
236 | ## FORKED |
|
236 | ## FORKED | |
237 | %if repo_instance.fork: |
|
237 | %if repo_instance.fork: | |
238 | <p class="discreet"> |
|
238 | <p class="discreet"> | |
239 | <i class="icon-code-fork"></i> ${_('Fork of')} |
|
239 | <i class="icon-code-fork"></i> ${_('Fork of')} | |
240 | ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))} |
|
240 | ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))} | |
241 | </p> |
|
241 | </p> | |
242 | %endif |
|
242 | %endif | |
243 |
|
243 | |||
244 | ## IMPORTED FROM REMOTE |
|
244 | ## IMPORTED FROM REMOTE | |
245 | %if repo_instance.clone_uri: |
|
245 | %if repo_instance.clone_uri: | |
246 | <p class="discreet"> |
|
246 | <p class="discreet"> | |
247 | <i class="icon-code-fork"></i> ${_('Clone from')} |
|
247 | <i class="icon-code-fork"></i> ${_('Clone from')} | |
248 | <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a> |
|
248 | <a href="${h.safe_str(h.hide_credentials(repo_instance.clone_uri))}">${h.hide_credentials(repo_instance.clone_uri)}</a> | |
249 | </p> |
|
249 | </p> | |
250 | %endif |
|
250 | %endif | |
251 |
|
251 | |||
252 | ## LOCKING STATUS |
|
252 | ## LOCKING STATUS | |
253 | %if repo_instance.locked[0]: |
|
253 | %if repo_instance.locked[0]: | |
254 | <p class="locking_locked discreet"> |
|
254 | <p class="locking_locked discreet"> | |
255 | <i class="icon-repo-lock"></i> |
|
255 | <i class="icon-repo-lock"></i> | |
256 | ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}} |
|
256 | ${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}} | |
257 | </p> |
|
257 | </p> | |
258 | %elif repo_instance.enable_locking: |
|
258 | %elif repo_instance.enable_locking: | |
259 | <p class="locking_unlocked discreet"> |
|
259 | <p class="locking_unlocked discreet"> | |
260 | <i class="icon-repo-unlock"></i> |
|
260 | <i class="icon-repo-unlock"></i> | |
261 | ${_('Repository not locked. Pull repository to lock it.')} |
|
261 | ${_('Repository not locked. Pull repository to lock it.')} | |
262 | </p> |
|
262 | </p> | |
263 | %endif |
|
263 | %endif | |
264 |
|
264 | |||
265 | </div> |
|
265 | </div> | |
266 | </%def> |
|
266 | </%def> | |
267 |
|
267 | |||
268 | <%def name="repo_menu(active=None)"> |
|
268 | <%def name="repo_menu(active=None)"> | |
269 | <% |
|
269 | <% | |
270 | def is_active(selected): |
|
270 | def is_active(selected): | |
271 | if selected == active: |
|
271 | if selected == active: | |
272 | return "active" |
|
272 | return "active" | |
273 | %> |
|
273 | %> | |
274 |
|
274 | |||
275 | <!--- REPO CONTEXT BAR --> |
|
275 | <!--- REPO CONTEXT BAR --> | |
276 | <div id="context-bar"> |
|
276 | <div id="context-bar"> | |
277 | <div class="wrapper"> |
|
277 | <div class="wrapper"> | |
278 |
|
278 | |||
279 | <div class="title"> |
|
279 | <div class="title"> | |
280 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
280 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
281 | </div> |
|
281 | </div> | |
282 |
|
282 | |||
283 | <ul id="context-pages" class="navigation horizontal-list"> |
|
283 | <ul id="context-pages" class="navigation horizontal-list"> | |
284 | <li class="${is_active('summary')}"><a class="menulink" href="${h.route_path('repo_summary', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li> |
|
284 | <li class="${is_active('summary')}"><a class="menulink" href="${h.route_path('repo_summary', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li> | |
285 | <li class="${is_active('changelog')}"><a class="menulink" href="${h.route_path('repo_changelog', repo_name=c.repo_name)}"><div class="menulabel">${_('Changelog')}</div></a></li> |
|
285 | <li class="${is_active('changelog')}"><a class="menulink" href="${h.route_path('repo_changelog', repo_name=c.repo_name)}"><div class="menulabel">${_('Changelog')}</div></a></li> | |
286 | <li class="${is_active('files')}"><a class="menulink" href="${h.route_path('repo_files', repo_name=c.repo_name, commit_id=c.rhodecode_db_repo.landing_rev[1], f_path='')}"><div class="menulabel">${_('Files')}</div></a></li> |
|
286 | <li class="${is_active('files')}"><a class="menulink" href="${h.route_path('repo_files', repo_name=c.repo_name, commit_id=c.rhodecode_db_repo.landing_rev[1], f_path='')}"><div class="menulabel">${_('Files')}</div></a></li> | |
287 | <li class="${is_active('compare')}"><a class="menulink" href="${h.route_path('repo_compare_select',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a></li> |
|
287 | <li class="${is_active('compare')}"><a class="menulink" href="${h.route_path('repo_compare_select',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a></li> | |
288 |
|
288 | |||
289 | ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()" |
|
289 | ## TODO: anderson: ideally it would have a function on the scm_instance "enable_pullrequest() and enable_fork()" | |
290 | %if c.rhodecode_db_repo.repo_type in ['git','hg']: |
|
290 | %if c.rhodecode_db_repo.repo_type in ['git','hg']: | |
291 | <li class="${is_active('showpullrequest')}"> |
|
291 | <li class="${is_active('showpullrequest')}"> | |
292 | <a class="menulink" href="${h.route_path('pullrequest_show_all', repo_name=c.repo_name)}" title="${h.tooltip(_('Show Pull Requests for %s') % c.repo_name)}"> |
|
292 | <a class="menulink" href="${h.route_path('pullrequest_show_all', repo_name=c.repo_name)}" title="${h.tooltip(_('Show Pull Requests for %s') % c.repo_name)}"> | |
293 | <div class="menulabel"> |
|
293 | <div class="menulabel"> | |
294 | %if c.repository_pull_requests == 1: |
|
294 | %if c.repository_pull_requests == 1: | |
295 | ${c.repository_pull_requests} ${_('Pull Request')} |
|
295 | ${c.repository_pull_requests} ${_('Pull Request')} | |
296 | %else: |
|
296 | %else: | |
297 | ${c.repository_pull_requests} ${_('Pull Requests')} |
|
297 | ${c.repository_pull_requests} ${_('Pull Requests')} | |
298 | %endif |
|
298 | %endif | |
299 | </div> |
|
299 | </div> | |
300 | </a> |
|
300 | </a> | |
301 | </li> |
|
301 | </li> | |
302 | %endif |
|
302 | %endif | |
303 |
|
|
303 | ||
|
304 | <li class="${is_active('artifacts')}"><a class="menulink" href="${h.route_path('repo_artifacts_list',repo_name=c.repo_name)}"><div class="menulabel">${_('Artifacts')}</div></a></li> | |||
|
305 | ||||
304 | %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): |
|
306 | %if h.HasRepoPermissionAll('repository.admin')(c.repo_name): | |
305 | <li class="${is_active('settings')}"><a class="menulink" href="${h.route_path('edit_repo',repo_name=c.repo_name)}"><div class="menulabel">${_('Repository Settings')}</div></a></li> |
|
307 | <li class="${is_active('settings')}"><a class="menulink" href="${h.route_path('edit_repo',repo_name=c.repo_name)}"><div class="menulabel">${_('Repository Settings')}</div></a></li> | |
306 | %endif |
|
308 | %endif | |
307 |
|
309 | |||
308 | <li class="${is_active('options')}"> |
|
310 | <li class="${is_active('options')}"> | |
309 | <a class="menulink dropdown"> |
|
311 | <a class="menulink dropdown"> | |
310 | <div class="menulabel">${_('Options')} <div class="show_more"></div></div> |
|
312 | <div class="menulabel">${_('Options')} <div class="show_more"></div></div> | |
311 | </a> |
|
313 | </a> | |
312 | <ul class="submenu"> |
|
314 | <ul class="submenu"> | |
313 |
|
315 | |||
314 | %if c.rhodecode_db_repo.fork: |
|
316 | %if c.rhodecode_db_repo.fork: | |
315 | <li> |
|
317 | <li> | |
316 | <a title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}" |
|
318 | <a title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}" | |
317 | href="${h.route_path('repo_compare', |
|
319 | href="${h.route_path('repo_compare', | |
318 | repo_name=c.rhodecode_db_repo.fork.repo_name, |
|
320 | repo_name=c.rhodecode_db_repo.fork.repo_name, | |
319 | source_ref_type=c.rhodecode_db_repo.landing_rev[0], |
|
321 | source_ref_type=c.rhodecode_db_repo.landing_rev[0], | |
320 | source_ref=c.rhodecode_db_repo.landing_rev[1], |
|
322 | source_ref=c.rhodecode_db_repo.landing_rev[1], | |
321 | target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0], |
|
323 | target_repo=c.repo_name,target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0], | |
322 | target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], |
|
324 | target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], | |
323 | _query=dict(merge=1))}" |
|
325 | _query=dict(merge=1))}" | |
324 | > |
|
326 | > | |
325 | ${_('Compare fork')} |
|
327 | ${_('Compare fork')} | |
326 | </a> |
|
328 | </a> | |
327 | </li> |
|
329 | </li> | |
328 | %endif |
|
330 | %endif | |
329 |
|
331 | |||
330 | %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking: |
|
332 | %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking: | |
331 | %if c.rhodecode_db_repo.locked[0]: |
|
333 | %if c.rhodecode_db_repo.locked[0]: | |
332 | <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock')}</a></li> |
|
334 | <li><a class="locking_del" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Unlock')}</a></li> | |
333 | %else: |
|
335 | %else: | |
334 | <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock')}</a></li> |
|
336 | <li><a class="locking_add" href="${h.route_path('repo_edit_toggle_locking',repo_name=c.repo_name)}">${_('Lock')}</a></li> | |
335 | %endif |
|
337 | %endif | |
336 | %endif |
|
338 | %endif | |
337 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
339 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
338 | %if c.rhodecode_db_repo.repo_type in ['git','hg']: |
|
340 | %if c.rhodecode_db_repo.repo_type in ['git','hg']: | |
339 | <li><a href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}">${_('Fork')}</a></li> |
|
341 | <li><a href="${h.route_path('repo_fork_new',repo_name=c.repo_name)}">${_('Fork')}</a></li> | |
340 | <li><a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li> |
|
342 | <li><a href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}">${_('Create Pull Request')}</a></li> | |
341 | %endif |
|
343 | %endif | |
342 | %endif |
|
344 | %endif | |
343 | </ul> |
|
345 | </ul> | |
344 | </li> |
|
346 | </li> | |
345 | </ul> |
|
347 | </ul> | |
346 | </div> |
|
348 | </div> | |
347 | <div class="clear"></div> |
|
349 | <div class="clear"></div> | |
348 | </div> |
|
350 | </div> | |
349 | % if c.rhodecode_db_repo.archived: |
|
351 | % if c.rhodecode_db_repo.archived: | |
350 | <div class="alert alert-warning text-center"> |
|
352 | <div class="alert alert-warning text-center"> | |
351 | <strong>${_('This repository has been archived. It is now read-only.')}</strong> |
|
353 | <strong>${_('This repository has been archived. It is now read-only.')}</strong> | |
352 | </div> |
|
354 | </div> | |
353 | % endif |
|
355 | % endif | |
354 | <!--- REPO END CONTEXT BAR --> |
|
356 | <!--- REPO END CONTEXT BAR --> | |
355 |
|
357 | |||
356 | </%def> |
|
358 | </%def> | |
357 |
|
359 | |||
358 | <%def name="repo_group_page_title(repo_group_instance)"> |
|
360 | <%def name="repo_group_page_title(repo_group_instance)"> | |
359 | <div class="title-content"> |
|
361 | <div class="title-content"> | |
360 | <div class="title-main"> |
|
362 | <div class="title-main"> | |
361 | ## Repository Group icon |
|
363 | ## Repository Group icon | |
362 | <i class="icon-folder-close"></i> |
|
364 | <i class="icon-folder-close"></i> | |
363 |
|
365 | |||
364 | ## repo name with group name |
|
366 | ## repo name with group name | |
365 | ${h.breadcrumb_repo_group_link(repo_group_instance)} |
|
367 | ${h.breadcrumb_repo_group_link(repo_group_instance)} | |
366 | </div> |
|
368 | </div> | |
367 |
|
369 | |||
368 | <%namespace name="dt" file="/data_table/_dt_elements.mako"/> |
|
370 | <%namespace name="dt" file="/data_table/_dt_elements.mako"/> | |
369 | <div class="repo-group-desc discreet"> |
|
371 | <div class="repo-group-desc discreet"> | |
370 | ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)} |
|
372 | ${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)} | |
371 | </div> |
|
373 | </div> | |
372 |
|
374 | |||
373 | </div> |
|
375 | </div> | |
374 | </%def> |
|
376 | </%def> | |
375 |
|
377 | |||
376 | <%def name="repo_group_menu(active=None)"> |
|
378 | <%def name="repo_group_menu(active=None)"> | |
377 | <% |
|
379 | <% | |
378 | def is_active(selected): |
|
380 | def is_active(selected): | |
379 | if selected == active: |
|
381 | if selected == active: | |
380 | return "active" |
|
382 | return "active" | |
381 |
|
383 | |||
382 | gr_name = c.repo_group.group_name if c.repo_group else None |
|
384 | gr_name = c.repo_group.group_name if c.repo_group else None | |
383 | # create repositories with write permission on group is set to true |
|
385 | # create repositories with write permission on group is set to true | |
384 | create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')() |
|
386 | create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')() | |
385 | group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page') |
|
387 | group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page') | |
386 | group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page') |
|
388 | group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page') | |
387 |
|
389 | |||
388 | %> |
|
390 | %> | |
389 |
|
391 | |||
390 | <!--- REPO GROUP CONTEXT BAR --> |
|
392 | <!--- REPO GROUP CONTEXT BAR --> | |
391 | <div id="context-bar"> |
|
393 | <div id="context-bar"> | |
392 | <div class="wrapper"> |
|
394 | <div class="wrapper"> | |
393 | <div class="title"> |
|
395 | <div class="title"> | |
394 | ${self.repo_group_page_title(c.repo_group)} |
|
396 | ${self.repo_group_page_title(c.repo_group)} | |
395 | </div> |
|
397 | </div> | |
396 |
|
398 | |||
397 | <ul id="context-pages" class="navigation horizontal-list"> |
|
399 | <ul id="context-pages" class="navigation horizontal-list"> | |
398 | <li class="${is_active('home')}"><a class="menulink" href="${h.route_path('repo_group_home', repo_group_name=c.repo_group.group_name)}"><div class="menulabel">${_('Group Home')}</div></a></li> |
|
400 | <li class="${is_active('home')}"><a class="menulink" href="${h.route_path('repo_group_home', repo_group_name=c.repo_group.group_name)}"><div class="menulabel">${_('Group Home')}</div></a></li> | |
399 | % if c.is_super_admin or group_admin: |
|
401 | % if c.is_super_admin or group_admin: | |
400 | <li class="${is_active('settings')}"><a class="menulink" href="${h.route_path('edit_repo_group',repo_group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}"><div class="menulabel">${_('Group Settings')}</div></a></li> |
|
402 | <li class="${is_active('settings')}"><a class="menulink" href="${h.route_path('edit_repo_group',repo_group_name=c.repo_group.group_name)}" title="${_('You have admin right to this group, and can edit it')}"><div class="menulabel">${_('Group Settings')}</div></a></li> | |
401 | % endif |
|
403 | % endif | |
402 |
|
404 | |||
403 | <li class="${is_active('options')}"> |
|
405 | <li class="${is_active('options')}"> | |
404 | <a class="menulink dropdown"> |
|
406 | <a class="menulink dropdown"> | |
405 | <div class="menulabel">${_('Options')} <div class="show_more"></div></div> |
|
407 | <div class="menulabel">${_('Options')} <div class="show_more"></div></div> | |
406 | </a> |
|
408 | </a> | |
407 | <ul class="submenu"> |
|
409 | <ul class="submenu"> | |
408 | %if c.is_super_admin or group_admin or (group_write and create_on_write): |
|
410 | %if c.is_super_admin or group_admin or (group_write and create_on_write): | |
409 | <li><a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('Add Repository')}</a></li> |
|
411 | <li><a href="${h.route_path('repo_new',_query=dict(parent_group=c.repo_group.group_id))}">${_('Add Repository')}</a></li> | |
410 | %endif |
|
412 | %endif | |
411 | %if c.is_super_admin or group_admin: |
|
413 | %if c.is_super_admin or group_admin: | |
412 | <li><a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'Add Parent Group')}</a></li> |
|
414 | <li><a href="${h.route_path('repo_group_new',_query=dict(parent_group=c.repo_group.group_id))}">${_(u'Add Parent Group')}</a></li> | |
413 | %endif |
|
415 | %endif | |
414 | </ul> |
|
416 | </ul> | |
415 | </li> |
|
417 | </li> | |
416 | </ul> |
|
418 | </ul> | |
417 | </div> |
|
419 | </div> | |
418 | <div class="clear"></div> |
|
420 | <div class="clear"></div> | |
419 | </div> |
|
421 | </div> | |
420 |
|
422 | |||
421 | <!--- REPO GROUP CONTEXT BAR --> |
|
423 | <!--- REPO GROUP CONTEXT BAR --> | |
422 |
|
424 | |||
423 | </%def> |
|
425 | </%def> | |
424 |
|
426 | |||
425 |
|
427 | |||
426 | <%def name="usermenu(active=False)"> |
|
428 | <%def name="usermenu(active=False)"> | |
427 | ## USER MENU |
|
429 | ## USER MENU | |
428 | <li id="quick_login_li" class="${'active' if active else ''}"> |
|
430 | <li id="quick_login_li" class="${'active' if active else ''}"> | |
429 | % if c.rhodecode_user.username == h.DEFAULT_USER: |
|
431 | % if c.rhodecode_user.username == h.DEFAULT_USER: | |
430 | <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}"> |
|
432 | <a id="quick_login_link" class="menulink childs" href="${h.route_path('login', _query={'came_from': h.current_route_path(request)})}"> | |
431 | ${gravatar(c.rhodecode_user.email, 20)} |
|
433 | ${gravatar(c.rhodecode_user.email, 20)} | |
432 | <span class="user"> |
|
434 | <span class="user"> | |
433 | <span>${_('Sign in')}</span> |
|
435 | <span>${_('Sign in')}</span> | |
434 | </span> |
|
436 | </span> | |
435 | </a> |
|
437 | </a> | |
436 | % else: |
|
438 | % else: | |
437 | ## logged in user |
|
439 | ## logged in user | |
438 | <a id="quick_login_link" class="menulink childs"> |
|
440 | <a id="quick_login_link" class="menulink childs"> | |
439 | ${gravatar(c.rhodecode_user.email, 20)} |
|
441 | ${gravatar(c.rhodecode_user.email, 20)} | |
440 | <span class="user"> |
|
442 | <span class="user"> | |
441 | <span class="menu_link_user">${c.rhodecode_user.username}</span> |
|
443 | <span class="menu_link_user">${c.rhodecode_user.username}</span> | |
442 | <div class="show_more"></div> |
|
444 | <div class="show_more"></div> | |
443 | </span> |
|
445 | </span> | |
444 | </a> |
|
446 | </a> | |
445 | ## subnav with menu for logged in user |
|
447 | ## subnav with menu for logged in user | |
446 | <div class="user-menu submenu"> |
|
448 | <div class="user-menu submenu"> | |
447 | <div id="quick_login"> |
|
449 | <div id="quick_login"> | |
448 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
450 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
449 | <div class=""> |
|
451 | <div class=""> | |
450 | <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div> |
|
452 | <div class="big_gravatar">${gravatar(c.rhodecode_user.email, 48)}</div> | |
451 | <div class="full_name">${c.rhodecode_user.full_name_or_username}</div> |
|
453 | <div class="full_name">${c.rhodecode_user.full_name_or_username}</div> | |
452 | <div class="email">${c.rhodecode_user.email}</div> |
|
454 | <div class="email">${c.rhodecode_user.email}</div> | |
453 | </div> |
|
455 | </div> | |
454 | <div class=""> |
|
456 | <div class=""> | |
455 | <ol class="links"> |
|
457 | <ol class="links"> | |
456 | <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li> |
|
458 | <li>${h.link_to(_(u'My account'),h.route_path('my_account_profile'))}</li> | |
457 | % if c.rhodecode_user.personal_repo_group: |
|
459 | % if c.rhodecode_user.personal_repo_group: | |
458 | <li>${h.link_to(_(u'My personal group'), h.route_path('repo_group_home', repo_group_name=c.rhodecode_user.personal_repo_group.group_name))}</li> |
|
460 | <li>${h.link_to(_(u'My personal group'), h.route_path('repo_group_home', repo_group_name=c.rhodecode_user.personal_repo_group.group_name))}</li> | |
459 | % endif |
|
461 | % endif | |
460 | <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li> |
|
462 | <li>${h.link_to(_(u'Pull Requests'), h.route_path('my_account_pullrequests'))}</li> | |
461 | ## bookmark-items |
|
463 | ## bookmark-items | |
462 | <li class="bookmark-items"> |
|
464 | <li class="bookmark-items"> | |
463 | ${_('Bookmarks')} |
|
465 | ${_('Bookmarks')} | |
464 | <div class="pull-right"> |
|
466 | <div class="pull-right"> | |
465 | <a href="${h.route_path('my_account_bookmarks')}">${_('Manage')}</a> |
|
467 | <a href="${h.route_path('my_account_bookmarks')}">${_('Manage')}</a> | |
466 | </div> |
|
468 | </div> | |
467 | </li> |
|
469 | </li> | |
468 | % if not c.bookmark_items: |
|
470 | % if not c.bookmark_items: | |
469 | <li> |
|
471 | <li> | |
470 | <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a> |
|
472 | <a href="${h.route_path('my_account_bookmarks')}">${_('No Bookmarks yet.')}</a> | |
471 | </li> |
|
473 | </li> | |
472 | % endif |
|
474 | % endif | |
473 | % for item in c.bookmark_items: |
|
475 | % for item in c.bookmark_items: | |
474 | <li> |
|
476 | <li> | |
475 | % if item.repository: |
|
477 | % if item.repository: | |
476 | <div> |
|
478 | <div> | |
477 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> |
|
479 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> | |
478 | <code>${item.position}</code> |
|
480 | <code>${item.position}</code> | |
479 | % if item.repository.repo_type == 'hg': |
|
481 | % if item.repository.repo_type == 'hg': | |
480 | <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i> |
|
482 | <i class="icon-hg" title="${_('Repository')}" style="font-size: 16px"></i> | |
481 | % elif item.repository.repo_type == 'git': |
|
483 | % elif item.repository.repo_type == 'git': | |
482 | <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i> |
|
484 | <i class="icon-git" title="${_('Repository')}" style="font-size: 16px"></i> | |
483 | % elif item.repository.repo_type == 'svn': |
|
485 | % elif item.repository.repo_type == 'svn': | |
484 | <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i> |
|
486 | <i class="icon-svn" title="${_('Repository')}" style="font-size: 16px"></i> | |
485 | % endif |
|
487 | % endif | |
486 | ${(item.title or h.shorter(item.repository.repo_name, 30))} |
|
488 | ${(item.title or h.shorter(item.repository.repo_name, 30))} | |
487 | </a> |
|
489 | </a> | |
488 | </div> |
|
490 | </div> | |
489 | % elif item.repository_group: |
|
491 | % elif item.repository_group: | |
490 | <div> |
|
492 | <div> | |
491 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> |
|
493 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> | |
492 | <code>${item.position}</code> |
|
494 | <code>${item.position}</code> | |
493 | <i class="icon-folder-close" title="${_('Repository group')}" style="font-size: 16px"></i> |
|
495 | <i class="icon-folder-close" title="${_('Repository group')}" style="font-size: 16px"></i> | |
494 | ${(item.title or h.shorter(item.repository_group.group_name, 30))} |
|
496 | ${(item.title or h.shorter(item.repository_group.group_name, 30))} | |
495 | </a> |
|
497 | </a> | |
496 | </div> |
|
498 | </div> | |
497 | % else: |
|
499 | % else: | |
498 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> |
|
500 | <a class="bookmark-item" href="${h.route_path('my_account_goto_bookmark', bookmark_id=item.position)}"> | |
499 | <code>${item.position}</code> |
|
501 | <code>${item.position}</code> | |
500 | ${item.title} |
|
502 | ${item.title} | |
501 | </a> |
|
503 | </a> | |
502 | % endif |
|
504 | % endif | |
503 | </li> |
|
505 | </li> | |
504 | % endfor |
|
506 | % endfor | |
505 |
|
507 | |||
506 | <li class="logout"> |
|
508 | <li class="logout"> | |
507 | ${h.secure_form(h.route_path('logout'), request=request)} |
|
509 | ${h.secure_form(h.route_path('logout'), request=request)} | |
508 | ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")} |
|
510 | ${h.submit('log_out', _(u'Sign Out'),class_="btn btn-primary")} | |
509 | ${h.end_form()} |
|
511 | ${h.end_form()} | |
510 | </li> |
|
512 | </li> | |
511 | </ol> |
|
513 | </ol> | |
512 | </div> |
|
514 | </div> | |
513 | %endif |
|
515 | %endif | |
514 | </div> |
|
516 | </div> | |
515 | </div> |
|
517 | </div> | |
516 | ## unread counter |
|
518 | ## unread counter | |
517 | <div class="pill_container"> |
|
519 | <div class="pill_container"> | |
518 | <a class="menu_link_notifications ${'empty' if c.unread_notifications == 0 else ''}" href="${h.route_path('notifications_show_all')}">${c.unread_notifications}</a> |
|
520 | <a class="menu_link_notifications ${'empty' if c.unread_notifications == 0 else ''}" href="${h.route_path('notifications_show_all')}">${c.unread_notifications}</a> | |
519 | </div> |
|
521 | </div> | |
520 | % endif |
|
522 | % endif | |
521 | </li> |
|
523 | </li> | |
522 | </%def> |
|
524 | </%def> | |
523 |
|
525 | |||
524 | <%def name="menu_items(active=None)"> |
|
526 | <%def name="menu_items(active=None)"> | |
525 | <% |
|
527 | <% | |
526 | def is_active(selected): |
|
528 | def is_active(selected): | |
527 | if selected == active: |
|
529 | if selected == active: | |
528 | return "active" |
|
530 | return "active" | |
529 | return "" |
|
531 | return "" | |
530 | %> |
|
532 | %> | |
531 |
|
533 | |||
532 | <ul id="quick" class="main_nav navigation horizontal-list"> |
|
534 | <ul id="quick" class="main_nav navigation horizontal-list"> | |
533 | ## notice box for important system messages |
|
535 | ## notice box for important system messages | |
534 | <li style="display: none"> |
|
536 | <li style="display: none"> | |
535 | <a class="notice-box" href="#openNotice" onclick="showNoticeBox(); return false"> |
|
537 | <a class="notice-box" href="#openNotice" onclick="showNoticeBox(); return false"> | |
536 | <div class="menulabel-notice" > |
|
538 | <div class="menulabel-notice" > | |
537 | 0 |
|
539 | 0 | |
538 | </div> |
|
540 | </div> | |
539 | </a> |
|
541 | </a> | |
540 | </li> |
|
542 | </li> | |
541 |
|
543 | |||
542 | ## Main filter |
|
544 | ## Main filter | |
543 | <li> |
|
545 | <li> | |
544 | <div class="menulabel main_filter_box"> |
|
546 | <div class="menulabel main_filter_box"> | |
545 | <div class="main_filter_input_box"> |
|
547 | <div class="main_filter_input_box"> | |
546 | <ul class="searchItems"> |
|
548 | <ul class="searchItems"> | |
547 |
|
549 | |||
548 | % if c.template_context['search_context']['repo_id']: |
|
550 | % if c.template_context['search_context']['repo_id']: | |
549 | <li class="searchTag searchTagFilter searchTagHidable" > |
|
551 | <li class="searchTag searchTagFilter searchTagHidable" > | |
550 | ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}"> |
|
552 | ##<a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}"> | |
551 | <span class="tag"> |
|
553 | <span class="tag"> | |
552 | This repo |
|
554 | This repo | |
553 | <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a> |
|
555 | <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a> | |
554 | </span> |
|
556 | </span> | |
555 | ##</a> |
|
557 | ##</a> | |
556 | </li> |
|
558 | </li> | |
557 | % elif c.template_context['search_context']['repo_group_id']: |
|
559 | % elif c.template_context['search_context']['repo_group_id']: | |
558 | <li class="searchTag searchTagFilter searchTagHidable"> |
|
560 | <li class="searchTag searchTagFilter searchTagHidable"> | |
559 | ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}"> |
|
561 | ##<a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}"> | |
560 | <span class="tag"> |
|
562 | <span class="tag"> | |
561 | This group |
|
563 | This group | |
562 | <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a> |
|
564 | <a href="#removeGoToFilter" onclick="removeGoToFilter(); return false"><i class="icon-delete"></i></a> | |
563 | </span> |
|
565 | </span> | |
564 | ##</a> |
|
566 | ##</a> | |
565 | </li> |
|
567 | </li> | |
566 | % endif |
|
568 | % endif | |
567 |
|
569 | |||
568 | <li class="searchTagInput"> |
|
570 | <li class="searchTagInput"> | |
569 | <input class="main_filter_input" id="main_filter" size="15" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" /> |
|
571 | <input class="main_filter_input" id="main_filter" size="15" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" /> | |
570 | </li> |
|
572 | </li> | |
571 | <li class="searchTag searchTagHelp"> |
|
573 | <li class="searchTag searchTagHelp"> | |
572 | <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a> |
|
574 | <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a> | |
573 | </li> |
|
575 | </li> | |
574 | </ul> |
|
576 | </ul> | |
575 | </div> |
|
577 | </div> | |
576 | </div> |
|
578 | </div> | |
577 |
|
579 | |||
578 | <div id="main_filter_help" style="display: none"> |
|
580 | <div id="main_filter_help" style="display: none"> | |
579 | - Use '/' key to quickly access this field. |
|
581 | - Use '/' key to quickly access this field. | |
580 |
|
582 | |||
581 | - Enter a name of repository, or repository group for quick search. |
|
583 | - Enter a name of repository, or repository group for quick search. | |
582 |
|
584 | |||
583 | - Prefix query to allow special search: |
|
585 | - Prefix query to allow special search: | |
584 |
|
586 | |||
585 | user:admin, to search for usernames, always global |
|
587 | user:admin, to search for usernames, always global | |
586 |
|
588 | |||
587 | user_group:devops, to search for user groups, always global |
|
589 | user_group:devops, to search for user groups, always global | |
588 |
|
590 | |||
589 | commit:efced4, to search for commits, scoped to repositories or groups |
|
591 | commit:efced4, to search for commits, scoped to repositories or groups | |
590 |
|
592 | |||
591 | file:models.py, to search for file paths, scoped to repositories or groups |
|
593 | file:models.py, to search for file paths, scoped to repositories or groups | |
592 |
|
594 | |||
593 | % if c.template_context['search_context']['repo_id']: |
|
595 | % if c.template_context['search_context']['repo_id']: | |
594 | For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a> |
|
596 | For advanced full text search visit: <a href="${h.route_path('search_repo',repo_name=c.template_context['search_context']['repo_name'])}">repository search</a> | |
595 | % elif c.template_context['search_context']['repo_group_id']: |
|
597 | % elif c.template_context['search_context']['repo_group_id']: | |
596 | For advanced full text search visit: <a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">repository group search</a> |
|
598 | For advanced full text search visit: <a href="${h.route_path('search_repo_group',repo_group_name=c.template_context['search_context']['repo_group_name'])}">repository group search</a> | |
597 | % else: |
|
599 | % else: | |
598 | For advanced full text search visit: <a href="${h.route_path('search')}">global search</a> |
|
600 | For advanced full text search visit: <a href="${h.route_path('search')}">global search</a> | |
599 | % endif |
|
601 | % endif | |
600 | </div> |
|
602 | </div> | |
601 | </li> |
|
603 | </li> | |
602 |
|
604 | |||
603 | ## ROOT MENU |
|
605 | ## ROOT MENU | |
604 | <li class="${is_active('home')}"> |
|
606 | <li class="${is_active('home')}"> | |
605 | <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}"> |
|
607 | <a class="menulink" title="${_('Home')}" href="${h.route_path('home')}"> | |
606 | <div class="menulabel">${_('Home')}</div> |
|
608 | <div class="menulabel">${_('Home')}</div> | |
607 | </a> |
|
609 | </a> | |
608 | </li> |
|
610 | </li> | |
609 |
|
611 | |||
610 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
612 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
611 | <li class="${is_active('journal')}"> |
|
613 | <li class="${is_active('journal')}"> | |
612 | <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}"> |
|
614 | <a class="menulink" title="${_('Show activity journal')}" href="${h.route_path('journal')}"> | |
613 | <div class="menulabel">${_('Journal')}</div> |
|
615 | <div class="menulabel">${_('Journal')}</div> | |
614 | </a> |
|
616 | </a> | |
615 | </li> |
|
617 | </li> | |
616 | %else: |
|
618 | %else: | |
617 | <li class="${is_active('journal')}"> |
|
619 | <li class="${is_active('journal')}"> | |
618 | <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}"> |
|
620 | <a class="menulink" title="${_('Show Public activity journal')}" href="${h.route_path('journal_public')}"> | |
619 | <div class="menulabel">${_('Public journal')}</div> |
|
621 | <div class="menulabel">${_('Public journal')}</div> | |
620 | </a> |
|
622 | </a> | |
621 | </li> |
|
623 | </li> | |
622 | %endif |
|
624 | %endif | |
623 |
|
625 | |||
624 | <li class="${is_active('gists')}"> |
|
626 | <li class="${is_active('gists')}"> | |
625 | <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}"> |
|
627 | <a class="menulink childs" title="${_('Show Gists')}" href="${h.route_path('gists_show')}"> | |
626 | <div class="menulabel">${_('Gists')}</div> |
|
628 | <div class="menulabel">${_('Gists')}</div> | |
627 | </a> |
|
629 | </a> | |
628 | </li> |
|
630 | </li> | |
629 |
|
631 | |||
630 | % if c.is_super_admin or c.is_delegated_admin: |
|
632 | % if c.is_super_admin or c.is_delegated_admin: | |
631 | <li class="${is_active('admin')}"> |
|
633 | <li class="${is_active('admin')}"> | |
632 | <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}"> |
|
634 | <a class="menulink childs" title="${_('Admin settings')}" href="${h.route_path('admin_home')}"> | |
633 | <div class="menulabel">${_('Admin')} </div> |
|
635 | <div class="menulabel">${_('Admin')} </div> | |
634 | </a> |
|
636 | </a> | |
635 | </li> |
|
637 | </li> | |
636 | % endif |
|
638 | % endif | |
637 |
|
639 | |||
638 | ## render extra user menu |
|
640 | ## render extra user menu | |
639 | ${usermenu(active=(active=='my_account'))} |
|
641 | ${usermenu(active=(active=='my_account'))} | |
640 |
|
642 | |||
641 | % if c.debug_style: |
|
643 | % if c.debug_style: | |
642 | <li> |
|
644 | <li> | |
643 | <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}"> |
|
645 | <a class="menulink" title="${_('Style')}" href="${h.route_path('debug_style_home')}"> | |
644 | <div class="menulabel">${_('[Style]')}</div> |
|
646 | <div class="menulabel">${_('[Style]')}</div> | |
645 | </a> |
|
647 | </a> | |
646 | </li> |
|
648 | </li> | |
647 | % endif |
|
649 | % endif | |
648 | </ul> |
|
650 | </ul> | |
649 |
|
651 | |||
650 | <script type="text/javascript"> |
|
652 | <script type="text/javascript"> | |
651 | var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True"; |
|
653 | var visualShowPublicIcon = "${c.visual.show_public_icon}" == "True"; | |
652 |
|
654 | |||
653 | var formatRepoResult = function(result, container, query, escapeMarkup) { |
|
655 | var formatRepoResult = function(result, container, query, escapeMarkup) { | |
654 | return function(data, escapeMarkup) { |
|
656 | return function(data, escapeMarkup) { | |
655 | if (!data.repo_id){ |
|
657 | if (!data.repo_id){ | |
656 | return data.text; // optgroup text Repositories |
|
658 | return data.text; // optgroup text Repositories | |
657 | } |
|
659 | } | |
658 |
|
660 | |||
659 | var tmpl = ''; |
|
661 | var tmpl = ''; | |
660 | var repoType = data['repo_type']; |
|
662 | var repoType = data['repo_type']; | |
661 | var repoName = data['text']; |
|
663 | var repoName = data['text']; | |
662 |
|
664 | |||
663 | if(data && data.type == 'repo'){ |
|
665 | if(data && data.type == 'repo'){ | |
664 | if(repoType === 'hg'){ |
|
666 | if(repoType === 'hg'){ | |
665 | tmpl += '<i class="icon-hg"></i> '; |
|
667 | tmpl += '<i class="icon-hg"></i> '; | |
666 | } |
|
668 | } | |
667 | else if(repoType === 'git'){ |
|
669 | else if(repoType === 'git'){ | |
668 | tmpl += '<i class="icon-git"></i> '; |
|
670 | tmpl += '<i class="icon-git"></i> '; | |
669 | } |
|
671 | } | |
670 | else if(repoType === 'svn'){ |
|
672 | else if(repoType === 'svn'){ | |
671 | tmpl += '<i class="icon-svn"></i> '; |
|
673 | tmpl += '<i class="icon-svn"></i> '; | |
672 | } |
|
674 | } | |
673 | if(data['private']){ |
|
675 | if(data['private']){ | |
674 | tmpl += '<i class="icon-lock" ></i> '; |
|
676 | tmpl += '<i class="icon-lock" ></i> '; | |
675 | } |
|
677 | } | |
676 | else if(visualShowPublicIcon){ |
|
678 | else if(visualShowPublicIcon){ | |
677 | tmpl += '<i class="icon-unlock-alt"></i> '; |
|
679 | tmpl += '<i class="icon-unlock-alt"></i> '; | |
678 | } |
|
680 | } | |
679 | } |
|
681 | } | |
680 | tmpl += escapeMarkup(repoName); |
|
682 | tmpl += escapeMarkup(repoName); | |
681 | return tmpl; |
|
683 | return tmpl; | |
682 |
|
684 | |||
683 | }(result, escapeMarkup); |
|
685 | }(result, escapeMarkup); | |
684 | }; |
|
686 | }; | |
685 |
|
687 | |||
686 | var formatRepoGroupResult = function(result, container, query, escapeMarkup) { |
|
688 | var formatRepoGroupResult = function(result, container, query, escapeMarkup) { | |
687 | return function(data, escapeMarkup) { |
|
689 | return function(data, escapeMarkup) { | |
688 | if (!data.repo_group_id){ |
|
690 | if (!data.repo_group_id){ | |
689 | return data.text; // optgroup text Repositories |
|
691 | return data.text; // optgroup text Repositories | |
690 | } |
|
692 | } | |
691 |
|
693 | |||
692 | var tmpl = ''; |
|
694 | var tmpl = ''; | |
693 | var repoGroupName = data['text']; |
|
695 | var repoGroupName = data['text']; | |
694 |
|
696 | |||
695 | if(data){ |
|
697 | if(data){ | |
696 |
|
698 | |||
697 | tmpl += '<i class="icon-folder-close"></i> '; |
|
699 | tmpl += '<i class="icon-folder-close"></i> '; | |
698 |
|
700 | |||
699 | } |
|
701 | } | |
700 | tmpl += escapeMarkup(repoGroupName); |
|
702 | tmpl += escapeMarkup(repoGroupName); | |
701 | return tmpl; |
|
703 | return tmpl; | |
702 |
|
704 | |||
703 | }(result, escapeMarkup); |
|
705 | }(result, escapeMarkup); | |
704 | }; |
|
706 | }; | |
705 |
|
707 | |||
706 | var escapeRegExChars = function (value) { |
|
708 | var escapeRegExChars = function (value) { | |
707 | return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); |
|
709 | return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); | |
708 | }; |
|
710 | }; | |
709 |
|
711 | |||
710 | var getRepoIcon = function(repo_type) { |
|
712 | var getRepoIcon = function(repo_type) { | |
711 | if (repo_type === 'hg') { |
|
713 | if (repo_type === 'hg') { | |
712 | return '<i class="icon-hg"></i> '; |
|
714 | return '<i class="icon-hg"></i> '; | |
713 | } |
|
715 | } | |
714 | else if (repo_type === 'git') { |
|
716 | else if (repo_type === 'git') { | |
715 | return '<i class="icon-git"></i> '; |
|
717 | return '<i class="icon-git"></i> '; | |
716 | } |
|
718 | } | |
717 | else if (repo_type === 'svn') { |
|
719 | else if (repo_type === 'svn') { | |
718 | return '<i class="icon-svn"></i> '; |
|
720 | return '<i class="icon-svn"></i> '; | |
719 | } |
|
721 | } | |
720 | return '' |
|
722 | return '' | |
721 | }; |
|
723 | }; | |
722 |
|
724 | |||
723 | var autocompleteMainFilterFormatResult = function (data, value, org_formatter) { |
|
725 | var autocompleteMainFilterFormatResult = function (data, value, org_formatter) { | |
724 |
|
726 | |||
725 | if (value.split(':').length === 2) { |
|
727 | if (value.split(':').length === 2) { | |
726 | value = value.split(':')[1] |
|
728 | value = value.split(':')[1] | |
727 | } |
|
729 | } | |
728 |
|
730 | |||
729 | var searchType = data['type']; |
|
731 | var searchType = data['type']; | |
730 | var valueDisplay = data['value_display']; |
|
732 | var valueDisplay = data['value_display']; | |
731 |
|
733 | |||
732 | var pattern = '(' + escapeRegExChars(value) + ')'; |
|
734 | var pattern = '(' + escapeRegExChars(value) + ')'; | |
733 |
|
735 | |||
734 | valueDisplay = Select2.util.escapeMarkup(valueDisplay); |
|
736 | valueDisplay = Select2.util.escapeMarkup(valueDisplay); | |
735 |
|
737 | |||
736 | // highlight match |
|
738 | // highlight match | |
737 | if (searchType != 'text') { |
|
739 | if (searchType != 'text') { | |
738 | valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>'); |
|
740 | valueDisplay = valueDisplay.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>'); | |
739 | } |
|
741 | } | |
740 |
|
742 | |||
741 | var icon = ''; |
|
743 | var icon = ''; | |
742 |
|
744 | |||
743 | if (searchType === 'hint') { |
|
745 | if (searchType === 'hint') { | |
744 | icon += '<i class="icon-folder-close"></i> '; |
|
746 | icon += '<i class="icon-folder-close"></i> '; | |
745 | } |
|
747 | } | |
746 | // full text search |
|
748 | // full text search | |
747 | else if (searchType === 'search') { |
|
749 | else if (searchType === 'search') { | |
748 | icon += '<i class="icon-more"></i> '; |
|
750 | icon += '<i class="icon-more"></i> '; | |
749 | } |
|
751 | } | |
750 | // repository |
|
752 | // repository | |
751 | else if (searchType === 'repo') { |
|
753 | else if (searchType === 'repo') { | |
752 |
|
754 | |||
753 | var repoIcon = getRepoIcon(data['repo_type']); |
|
755 | var repoIcon = getRepoIcon(data['repo_type']); | |
754 | icon += repoIcon; |
|
756 | icon += repoIcon; | |
755 |
|
757 | |||
756 | if (data['private']) { |
|
758 | if (data['private']) { | |
757 | icon += '<i class="icon-lock" ></i> '; |
|
759 | icon += '<i class="icon-lock" ></i> '; | |
758 | } |
|
760 | } | |
759 | else if (visualShowPublicIcon) { |
|
761 | else if (visualShowPublicIcon) { | |
760 | icon += '<i class="icon-unlock-alt"></i> '; |
|
762 | icon += '<i class="icon-unlock-alt"></i> '; | |
761 | } |
|
763 | } | |
762 | } |
|
764 | } | |
763 | // repository groups |
|
765 | // repository groups | |
764 | else if (searchType === 'repo_group') { |
|
766 | else if (searchType === 'repo_group') { | |
765 | icon += '<i class="icon-folder-close"></i> '; |
|
767 | icon += '<i class="icon-folder-close"></i> '; | |
766 | } |
|
768 | } | |
767 | // user group |
|
769 | // user group | |
768 | else if (searchType === 'user_group') { |
|
770 | else if (searchType === 'user_group') { | |
769 | icon += '<i class="icon-group"></i> '; |
|
771 | icon += '<i class="icon-group"></i> '; | |
770 | } |
|
772 | } | |
771 | // user |
|
773 | // user | |
772 | else if (searchType === 'user') { |
|
774 | else if (searchType === 'user') { | |
773 | icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']); |
|
775 | icon += '<img class="gravatar" src="{0}"/>'.format(data['icon_link']); | |
774 | } |
|
776 | } | |
775 | // commit |
|
777 | // commit | |
776 | else if (searchType === 'commit') { |
|
778 | else if (searchType === 'commit') { | |
777 | var repo_data = data['repo_data']; |
|
779 | var repo_data = data['repo_data']; | |
778 | var repoIcon = getRepoIcon(repo_data['repository_type']); |
|
780 | var repoIcon = getRepoIcon(repo_data['repository_type']); | |
779 | if (repoIcon) { |
|
781 | if (repoIcon) { | |
780 | icon += repoIcon; |
|
782 | icon += repoIcon; | |
781 | } else { |
|
783 | } else { | |
782 | icon += '<i class="icon-tag"></i>'; |
|
784 | icon += '<i class="icon-tag"></i>'; | |
783 | } |
|
785 | } | |
784 | } |
|
786 | } | |
785 | // file |
|
787 | // file | |
786 | else if (searchType === 'file') { |
|
788 | else if (searchType === 'file') { | |
787 | var repo_data = data['repo_data']; |
|
789 | var repo_data = data['repo_data']; | |
788 | var repoIcon = getRepoIcon(repo_data['repository_type']); |
|
790 | var repoIcon = getRepoIcon(repo_data['repository_type']); | |
789 | if (repoIcon) { |
|
791 | if (repoIcon) { | |
790 | icon += repoIcon; |
|
792 | icon += repoIcon; | |
791 | } else { |
|
793 | } else { | |
792 | icon += '<i class="icon-tag"></i>'; |
|
794 | icon += '<i class="icon-tag"></i>'; | |
793 | } |
|
795 | } | |
794 | } |
|
796 | } | |
795 | // generic text |
|
797 | // generic text | |
796 | else if (searchType === 'text') { |
|
798 | else if (searchType === 'text') { | |
797 | icon = ''; |
|
799 | icon = ''; | |
798 | } |
|
800 | } | |
799 |
|
801 | |||
800 | var tmpl = '<div class="ac-container-wrap">{0}{1}</div>'; |
|
802 | var tmpl = '<div class="ac-container-wrap">{0}{1}</div>'; | |
801 | return tmpl.format(icon, valueDisplay); |
|
803 | return tmpl.format(icon, valueDisplay); | |
802 | }; |
|
804 | }; | |
803 |
|
805 | |||
804 | var handleSelect = function(element, suggestion) { |
|
806 | var handleSelect = function(element, suggestion) { | |
805 | if (suggestion.type === "hint") { |
|
807 | if (suggestion.type === "hint") { | |
806 | // we skip action |
|
808 | // we skip action | |
807 | $('#main_filter').focus(); |
|
809 | $('#main_filter').focus(); | |
808 | } |
|
810 | } | |
809 | else if (suggestion.type === "text") { |
|
811 | else if (suggestion.type === "text") { | |
810 | // we skip action |
|
812 | // we skip action | |
811 | $('#main_filter').focus(); |
|
813 | $('#main_filter').focus(); | |
812 |
|
814 | |||
813 | } else { |
|
815 | } else { | |
814 | window.location = suggestion['url']; |
|
816 | window.location = suggestion['url']; | |
815 | } |
|
817 | } | |
816 | }; |
|
818 | }; | |
817 |
|
819 | |||
818 | var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) { |
|
820 | var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) { | |
819 | if (queryLowerCase.split(':').length === 2) { |
|
821 | if (queryLowerCase.split(':').length === 2) { | |
820 | queryLowerCase = queryLowerCase.split(':')[1] |
|
822 | queryLowerCase = queryLowerCase.split(':')[1] | |
821 | } |
|
823 | } | |
822 | if (suggestion.type === "text") { |
|
824 | if (suggestion.type === "text") { | |
823 | // special case we don't want to "skip" display for |
|
825 | // special case we don't want to "skip" display for | |
824 | return true |
|
826 | return true | |
825 | } |
|
827 | } | |
826 | return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1; |
|
828 | return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1; | |
827 | }; |
|
829 | }; | |
828 |
|
830 | |||
829 | var cleanContext = { |
|
831 | var cleanContext = { | |
830 | repo_view_type: null, |
|
832 | repo_view_type: null, | |
831 |
|
833 | |||
832 | repo_id: null, |
|
834 | repo_id: null, | |
833 | repo_name: "", |
|
835 | repo_name: "", | |
834 |
|
836 | |||
835 | repo_group_id: null, |
|
837 | repo_group_id: null, | |
836 | repo_group_name: null |
|
838 | repo_group_name: null | |
837 | }; |
|
839 | }; | |
838 | var removeGoToFilter = function () { |
|
840 | var removeGoToFilter = function () { | |
839 | $('.searchTagHidable').hide(); |
|
841 | $('.searchTagHidable').hide(); | |
840 | $('#main_filter').autocomplete( |
|
842 | $('#main_filter').autocomplete( | |
841 | 'setOptions', {params:{search_context: cleanContext}}); |
|
843 | 'setOptions', {params:{search_context: cleanContext}}); | |
842 | }; |
|
844 | }; | |
843 |
|
845 | |||
844 | $('#main_filter').autocomplete({ |
|
846 | $('#main_filter').autocomplete({ | |
845 | serviceUrl: pyroutes.url('goto_switcher_data'), |
|
847 | serviceUrl: pyroutes.url('goto_switcher_data'), | |
846 | params: { |
|
848 | params: { | |
847 | "search_context": templateContext.search_context |
|
849 | "search_context": templateContext.search_context | |
848 | }, |
|
850 | }, | |
849 | minChars:2, |
|
851 | minChars:2, | |
850 | maxHeight:400, |
|
852 | maxHeight:400, | |
851 | deferRequestBy: 300, //miliseconds |
|
853 | deferRequestBy: 300, //miliseconds | |
852 | tabDisabled: true, |
|
854 | tabDisabled: true, | |
853 | autoSelectFirst: false, |
|
855 | autoSelectFirst: false, | |
854 | formatResult: autocompleteMainFilterFormatResult, |
|
856 | formatResult: autocompleteMainFilterFormatResult, | |
855 | lookupFilter: autocompleteMainFilterResult, |
|
857 | lookupFilter: autocompleteMainFilterResult, | |
856 | onSelect: function (element, suggestion) { |
|
858 | onSelect: function (element, suggestion) { | |
857 | handleSelect(element, suggestion); |
|
859 | handleSelect(element, suggestion); | |
858 | return false; |
|
860 | return false; | |
859 | }, |
|
861 | }, | |
860 | onSearchError: function (element, query, jqXHR, textStatus, errorThrown) { |
|
862 | onSearchError: function (element, query, jqXHR, textStatus, errorThrown) { | |
861 | if (jqXHR !== 'abort') { |
|
863 | if (jqXHR !== 'abort') { | |
862 | alert("Error during search.\nError code: {0}".format(textStatus)); |
|
864 | alert("Error during search.\nError code: {0}".format(textStatus)); | |
863 | window.location = ''; |
|
865 | window.location = ''; | |
864 | } |
|
866 | } | |
865 | } |
|
867 | } | |
866 | }); |
|
868 | }); | |
867 |
|
869 | |||
868 | showMainFilterBox = function () { |
|
870 | showMainFilterBox = function () { | |
869 | $('#main_filter_help').toggle(); |
|
871 | $('#main_filter_help').toggle(); | |
870 | }; |
|
872 | }; | |
871 |
|
873 | |||
872 | $('#main_filter').on('keydown.autocomplete', function (e) { |
|
874 | $('#main_filter').on('keydown.autocomplete', function (e) { | |
873 |
|
875 | |||
874 | var BACKSPACE = 8; |
|
876 | var BACKSPACE = 8; | |
875 | var el = $(e.currentTarget); |
|
877 | var el = $(e.currentTarget); | |
876 | if(e.which === BACKSPACE){ |
|
878 | if(e.which === BACKSPACE){ | |
877 | var inputVal = el.val(); |
|
879 | var inputVal = el.val(); | |
878 | if (inputVal === ""){ |
|
880 | if (inputVal === ""){ | |
879 | removeGoToFilter() |
|
881 | removeGoToFilter() | |
880 | } |
|
882 | } | |
881 | } |
|
883 | } | |
882 | }); |
|
884 | }); | |
883 |
|
885 | |||
884 | </script> |
|
886 | </script> | |
885 | <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script> |
|
887 | <script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script> | |
886 | </%def> |
|
888 | </%def> | |
887 |
|
889 | |||
888 | <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> |
|
890 | <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
889 | <div class="modal-dialog"> |
|
891 | <div class="modal-dialog"> | |
890 | <div class="modal-content"> |
|
892 | <div class="modal-content"> | |
891 | <div class="modal-header"> |
|
893 | <div class="modal-header"> | |
892 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
|
894 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
893 | <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4> |
|
895 | <h4 class="modal-title" id="myModalLabel">${_('Keyboard shortcuts')}</h4> | |
894 | </div> |
|
896 | </div> | |
895 | <div class="modal-body"> |
|
897 | <div class="modal-body"> | |
896 | <div class="block-left"> |
|
898 | <div class="block-left"> | |
897 | <table class="keyboard-mappings"> |
|
899 | <table class="keyboard-mappings"> | |
898 | <tbody> |
|
900 | <tbody> | |
899 | <tr> |
|
901 | <tr> | |
900 | <th></th> |
|
902 | <th></th> | |
901 | <th>${_('Site-wide shortcuts')}</th> |
|
903 | <th>${_('Site-wide shortcuts')}</th> | |
902 | </tr> |
|
904 | </tr> | |
903 | <% |
|
905 | <% | |
904 | elems = [ |
|
906 | elems = [ | |
905 | ('/', 'Use quick search box'), |
|
907 | ('/', 'Use quick search box'), | |
906 | ('g h', 'Goto home page'), |
|
908 | ('g h', 'Goto home page'), | |
907 | ('g g', 'Goto my private gists page'), |
|
909 | ('g g', 'Goto my private gists page'), | |
908 | ('g G', 'Goto my public gists page'), |
|
910 | ('g G', 'Goto my public gists page'), | |
909 | ('g 0-9', 'Goto bookmarked items from 0-9'), |
|
911 | ('g 0-9', 'Goto bookmarked items from 0-9'), | |
910 | ('n r', 'New repository page'), |
|
912 | ('n r', 'New repository page'), | |
911 | ('n g', 'New gist page'), |
|
913 | ('n g', 'New gist page'), | |
912 | ] |
|
914 | ] | |
913 | %> |
|
915 | %> | |
914 | %for key, desc in elems: |
|
916 | %for key, desc in elems: | |
915 | <tr> |
|
917 | <tr> | |
916 | <td class="keys"> |
|
918 | <td class="keys"> | |
917 | <span class="key tag">${key}</span> |
|
919 | <span class="key tag">${key}</span> | |
918 | </td> |
|
920 | </td> | |
919 | <td>${desc}</td> |
|
921 | <td>${desc}</td> | |
920 | </tr> |
|
922 | </tr> | |
921 | %endfor |
|
923 | %endfor | |
922 | </tbody> |
|
924 | </tbody> | |
923 | </table> |
|
925 | </table> | |
924 | </div> |
|
926 | </div> | |
925 | <div class="block-left"> |
|
927 | <div class="block-left"> | |
926 | <table class="keyboard-mappings"> |
|
928 | <table class="keyboard-mappings"> | |
927 | <tbody> |
|
929 | <tbody> | |
928 | <tr> |
|
930 | <tr> | |
929 | <th></th> |
|
931 | <th></th> | |
930 | <th>${_('Repositories')}</th> |
|
932 | <th>${_('Repositories')}</th> | |
931 | </tr> |
|
933 | </tr> | |
932 | <% |
|
934 | <% | |
933 | elems = [ |
|
935 | elems = [ | |
934 | ('g s', 'Goto summary page'), |
|
936 | ('g s', 'Goto summary page'), | |
935 | ('g c', 'Goto changelog page'), |
|
937 | ('g c', 'Goto changelog page'), | |
936 | ('g f', 'Goto files page'), |
|
938 | ('g f', 'Goto files page'), | |
937 | ('g F', 'Goto files page with file search activated'), |
|
939 | ('g F', 'Goto files page with file search activated'), | |
938 | ('g p', 'Goto pull requests page'), |
|
940 | ('g p', 'Goto pull requests page'), | |
939 | ('g o', 'Goto repository settings'), |
|
941 | ('g o', 'Goto repository settings'), | |
940 | ('g O', 'Goto repository permissions settings'), |
|
942 | ('g O', 'Goto repository permissions settings'), | |
941 | ] |
|
943 | ] | |
942 | %> |
|
944 | %> | |
943 | %for key, desc in elems: |
|
945 | %for key, desc in elems: | |
944 | <tr> |
|
946 | <tr> | |
945 | <td class="keys"> |
|
947 | <td class="keys"> | |
946 | <span class="key tag">${key}</span> |
|
948 | <span class="key tag">${key}</span> | |
947 | </td> |
|
949 | </td> | |
948 | <td>${desc}</td> |
|
950 | <td>${desc}</td> | |
949 | </tr> |
|
951 | </tr> | |
950 | %endfor |
|
952 | %endfor | |
951 | </tbody> |
|
953 | </tbody> | |
952 | </table> |
|
954 | </table> | |
953 | </div> |
|
955 | </div> | |
954 | </div> |
|
956 | </div> | |
955 | <div class="modal-footer"> |
|
957 | <div class="modal-footer"> | |
956 | </div> |
|
958 | </div> | |
957 | </div><!-- /.modal-content --> |
|
959 | </div><!-- /.modal-content --> | |
958 | </div><!-- /.modal-dialog --> |
|
960 | </div><!-- /.modal-dialog --> | |
959 | </div><!-- /.modal --> |
|
961 | </div><!-- /.modal --> | |
960 |
|
962 |
General Comments 0
You need to be logged in to leave comments.
Login now