From d030e97a4c94333c1113157668bfc4f507de7389 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Sun, 1 Apr 2018 17:42:53 -0400 Subject: [PATCH] [#83] Login: add feature to hide the login button from the menu --- src/web/__main__.py | 2 ++ src/web/base_handler.py | 1 + src/web/partials/_base.html | 2 +- src/web/web.py | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/web/__main__.py b/src/web/__main__.py index 0863fa73..594a1380 100644 --- a/src/web/__main__.py +++ b/src/web/__main__.py @@ -77,6 +77,8 @@ def parse_args(): help='Active to disable admin module.') group.add_argument('--disable_custom_css', default=False, action='store_true', help='Active to disable custom css module.') + group.add_argument('--hide_menu_login', default=False, action='store_true', + help='Active to hide login module from menu.') _parser = parser.parse_args() _parser.db_demo_path = DB_DEMO_PATH diff --git a/src/web/base_handler.py b/src/web/base_handler.py index 5ff5ec2f..14205ceb 100644 --- a/src/web/base_handler.py +++ b/src/web/base_handler.py @@ -32,6 +32,7 @@ def initialize(self, **kwargs): "disable_user_character": kwargs.get("disable_user_character"), "disable_admin": kwargs.get("disable_admin"), "disable_login": kwargs.get("disable_login"), + "hide_menu_login": kwargs.get("hide_menu_login"), "disable_custom_css": kwargs.get("disable_custom_css"), "url": kwargs.get("url"), "port": kwargs.get("port"), diff --git a/src/web/partials/_base.html b/src/web/partials/_base.html index 83d204d8..c1d9373f 100644 --- a/src/web/partials/_base.html +++ b/src/web/partials/_base.html @@ -81,7 +81,7 @@
  • Admin
  • {% end %} - {% if not disable_login %} + {% if not disable_login and not hide_menu_login %} {% if current_user %}
  • {{current_user.get("username")}}
  • Déconnexion
  • diff --git a/src/web/web.py b/src/web/web.py index 9c1daba3..69e78196 100644 --- a/src/web/web.py +++ b/src/web/web.py @@ -82,6 +82,7 @@ def main(parse_arg): "disable_user_character": parse_arg.disable_user_character, "disable_admin": parse_arg.disable_admin, "disable_login": parse_arg.disable_login, + "hide_menu_login": parse_arg.hide_menu_login, "disable_custom_css": parse_arg.disable_custom_css, "url": url, "port": port,