# HG changeset patch # User Marcin Kuzminski # Date 2019-03-22 21:19:05 # Node ID a4c028c73f92a995f0faf00675d192a3b9cb9fc2 # Parent c88d4ad694b71919af43dade360ffe72e1b54fd7 admin: added basic admin page diff --git a/rhodecode/apps/admin/views/main_views.py b/rhodecode/apps/admin/views/main_views.py --- a/rhodecode/apps/admin/views/main_views.py +++ b/rhodecode/apps/admin/views/main_views.py @@ -33,14 +33,19 @@ log = logging.getLogger(__name__) class AdminMainView(BaseAppView): + def load_default_context(self): + c = self._get_local_tmpl_context() + return c @LoginRequired() @HasPermissionAllDecorator('hg.admin') @view_config( - route_name='admin_home', request_method='GET') + route_name='admin_home', request_method='GET', + renderer='rhodecode:templates/admin/main.mako') def admin_main(self): - # redirect _admin to audit logs... - raise HTTPFound(h.route_path('admin_audit_logs')) + c = self.load_default_context() + c.active = 'admin' + return self._get_template_context(c) @LoginRequired() @view_config(route_name='pull_requests_global_0', request_method='GET') diff --git a/rhodecode/templates/admin/main.mako b/rhodecode/templates/admin/main.mako new file mode 100644 --- /dev/null +++ b/rhodecode/templates/admin/main.mako @@ -0,0 +1,49 @@ +## -*- coding: utf-8 -*- +<%inherit file="/base/base.mako"/> + +<%def name="title()"> + ${_('Settings administration')} + %if c.rhodecode_name: + · ${h.branding(c.rhodecode_name)} + %endif + + +<%def name="breadcrumbs_links()"> + ${h.link_to(_('Admin'),h.route_path('admin_home'))} + » + ${_('Settings')} + + +<%def name="menu_bar_nav()"> + ${self.menu_items(active='admin')} + + +<%def name="side_bar_nav()"> + + + +<%def name="main_content()"> + Hello Admin + + +<%def name="main()"> +
+
+ ${self.breadcrumbs()} +
+ + ##main + +
+ + \ No newline at end of file