Show More
@@ -0,0 +1,49 b'' | |||
|
1 | ## -*- coding: utf-8 -*- | |
|
2 | <%inherit file="/base/base.mako"/> | |
|
3 | ||
|
4 | <%def name="title()"> | |
|
5 | ${_('Settings administration')} | |
|
6 | %if c.rhodecode_name: | |
|
7 | · ${h.branding(c.rhodecode_name)} | |
|
8 | %endif | |
|
9 | </%def> | |
|
10 | ||
|
11 | <%def name="breadcrumbs_links()"> | |
|
12 | ${h.link_to(_('Admin'),h.route_path('admin_home'))} | |
|
13 | » | |
|
14 | ${_('Settings')} | |
|
15 | </%def> | |
|
16 | ||
|
17 | <%def name="menu_bar_nav()"> | |
|
18 | ${self.menu_items(active='admin')} | |
|
19 | </%def> | |
|
20 | ||
|
21 | <%def name="side_bar_nav()"> | |
|
22 | ||
|
23 | </%def> | |
|
24 | ||
|
25 | <%def name="main_content()"> | |
|
26 | Hello Admin | |
|
27 | </%def> | |
|
28 | ||
|
29 | <%def name="main()"> | |
|
30 | <div class="box"> | |
|
31 | <div class="title"> | |
|
32 | ${self.breadcrumbs()} | |
|
33 | </div> | |
|
34 | ||
|
35 | ##main | |
|
36 | <div class='sidebar-col-wrapper'> | |
|
37 | <div class="sidebar"> | |
|
38 | <ul class="nav nav-pills nav-stacked"> | |
|
39 | ${self.side_bar_nav()} | |
|
40 | </ul> | |
|
41 | </div> | |
|
42 | ||
|
43 | <div class="main-content-auto-width"> | |
|
44 | ${self.main_content()} | |
|
45 | </div> | |
|
46 | </div> | |
|
47 | </div> | |
|
48 | ||
|
49 | </%def> No newline at end of file |
@@ -1,64 +1,69 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | |
|
3 | 3 | # Copyright (C) 2016-2019 RhodeCode GmbH |
|
4 | 4 | # |
|
5 | 5 | # This program is free software: you can redistribute it and/or modify |
|
6 | 6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
7 | 7 | # (only), as published by the Free Software Foundation. |
|
8 | 8 | # |
|
9 | 9 | # This program is distributed in the hope that it will be useful, |
|
10 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | 12 | # GNU General Public License for more details. |
|
13 | 13 | # |
|
14 | 14 | # You should have received a copy of the GNU Affero General Public License |
|
15 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
16 | 16 | # |
|
17 | 17 | # This program is dual-licensed. If you wish to learn more about the |
|
18 | 18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
19 | 19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
20 | 20 | |
|
21 | 21 | import logging |
|
22 | 22 | |
|
23 | 23 | from pyramid.httpexceptions import HTTPFound |
|
24 | 24 | from pyramid.view import view_config |
|
25 | 25 | |
|
26 | 26 | from rhodecode.apps._base import BaseAppView |
|
27 | 27 | from rhodecode.lib import helpers as h |
|
28 | 28 | from rhodecode.lib.auth import (LoginRequired, HasPermissionAllDecorator) |
|
29 | 29 | from rhodecode.model.db import PullRequest |
|
30 | 30 | |
|
31 | 31 | |
|
32 | 32 | log = logging.getLogger(__name__) |
|
33 | 33 | |
|
34 | 34 | |
|
35 | 35 | class AdminMainView(BaseAppView): |
|
36 | def load_default_context(self): | |
|
37 | c = self._get_local_tmpl_context() | |
|
38 | return c | |
|
36 | 39 | |
|
37 | 40 | @LoginRequired() |
|
38 | 41 | @HasPermissionAllDecorator('hg.admin') |
|
39 | 42 | @view_config( |
|
40 |
route_name='admin_home', request_method='GET' |
|
|
43 | route_name='admin_home', request_method='GET', | |
|
44 | renderer='rhodecode:templates/admin/main.mako') | |
|
41 | 45 | def admin_main(self): |
|
42 | # redirect _admin to audit logs... | |
|
43 | raise HTTPFound(h.route_path('admin_audit_logs')) | |
|
46 | c = self.load_default_context() | |
|
47 | c.active = 'admin' | |
|
48 | return self._get_template_context(c) | |
|
44 | 49 | |
|
45 | 50 | @LoginRequired() |
|
46 | 51 | @view_config(route_name='pull_requests_global_0', request_method='GET') |
|
47 | 52 | @view_config(route_name='pull_requests_global_1', request_method='GET') |
|
48 | 53 | @view_config(route_name='pull_requests_global', request_method='GET') |
|
49 | 54 | def pull_requests(self): |
|
50 | 55 | """ |
|
51 | 56 | Global redirect for Pull Requests |
|
52 | 57 | |
|
53 | 58 | :param pull_request_id: id of pull requests in the system |
|
54 | 59 | """ |
|
55 | 60 | |
|
56 | 61 | pull_request = PullRequest.get_or_404( |
|
57 | 62 | self.request.matchdict['pull_request_id']) |
|
58 | 63 | pull_request_id = pull_request.pull_request_id |
|
59 | 64 | |
|
60 | 65 | repo_name = pull_request.target_repo.repo_name |
|
61 | 66 | |
|
62 | 67 | raise HTTPFound( |
|
63 | 68 | h.route_path('pullrequest_show', repo_name=repo_name, |
|
64 | 69 | pull_request_id=pull_request_id)) |
General Comments 0
You need to be logged in to leave comments.
Login now