From d02fd13bf0ee1883c25a26f9365df9897a9b2128 Mon Sep 17 00:00:00 2001 From: scmmishra Date: Mon, 10 Dec 2018 18:35:27 +0530 Subject: [PATCH] UI Improvements: Added Custom Navbar --- erpnext/hooks.py | 4 +- .../js/education/lms/components/Navbar.vue | 84 +++++++++++++++++++ erpnext/public/js/education/lms/lmsRoot.vue | 7 +- erpnext/public/js/education/lms/routes.js | 18 ++++ erpnext/www/lms.html | 1 + 5 files changed, 110 insertions(+), 4 deletions(-) create mode 100644 erpnext/public/js/education/lms/components/Navbar.vue diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 178b732e4a..6c42c5cfcd 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -170,11 +170,9 @@ default_roles = [ ] role_home_page = { - "LMS User": "`lms`" + "LMS User": "/lms" } -# get_website_user_home_page = "erpnext.education.utils.get_home_page" - has_website_permission = { "Sales Order": "erpnext.controllers.website_list_for_contact.has_website_permission", "Quotation": "erpnext.controllers.website_list_for_contact.has_website_permission", diff --git a/erpnext/public/js/education/lms/components/Navbar.vue b/erpnext/public/js/education/lms/components/Navbar.vue new file mode 100644 index 0000000000..69445c1116 --- /dev/null +++ b/erpnext/public/js/education/lms/components/Navbar.vue @@ -0,0 +1,84 @@ + + + \ No newline at end of file diff --git a/erpnext/public/js/education/lms/lmsRoot.vue b/erpnext/public/js/education/lms/lmsRoot.vue index 3a6cb80171..a0934ef94a 100644 --- a/erpnext/public/js/education/lms/lmsRoot.vue +++ b/erpnext/public/js/education/lms/lmsRoot.vue @@ -1,10 +1,15 @@ \ No newline at end of file + diff --git a/erpnext/public/js/education/lms/routes.js b/erpnext/public/js/education/lms/routes.js index 65c7dba5da..b0ef17f433 100644 --- a/erpnext/public/js/education/lms/routes.js +++ b/erpnext/public/js/education/lms/routes.js @@ -48,6 +48,24 @@ const routes = [{ component: Home, props: true }, + { + name: 'login', + path: '/Login', + beforeEnter(to, from, next) { + window.location = window.location.origin.toString() + '/login#login' + }, + component: Home, + props: true + }, + { + name: 'logout', + path: '/Logout', + beforeEnter(to, from, next) { + window.location = window.location.origin.toString() + '/?cmd=web_logout' + }, + component: Home, + props: true + }, { name: 'profile', path: '/Profile', diff --git a/erpnext/www/lms.html b/erpnext/www/lms.html index 372e87438b..8e4988164e 100644 --- a/erpnext/www/lms.html +++ b/erpnext/www/lms.html @@ -2,6 +2,7 @@ {% block title %}{{ heading or "LMS"}}{% endblock %} +{% block navbar %}{% endblock %} {% block page_content %}