Skip to content

Commit

Permalink
[AdminTL#83] Login: add feature to hide the login button from the menu
Browse files Browse the repository at this point in the history
  • Loading branch information
mathben committed Apr 1, 2018
1 parent 126c7cb commit d030e97
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/web/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/web/base_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion src/web/partials/_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<li ng-class="{ active: isActive('/admin') }"><a href="admin" style="color:red;"><span class="glyphicon glyphicon-king"></span> Admin</a></li>
{% end %}

{% if not disable_login %}
{% if not disable_login and not hide_menu_login %}
{% if current_user %}
<li><a href="/profile/"><span class="glyphicon glyphicon-user"></span> {{current_user.get("username")}}</a></li>
<li><a href="/logout"><span class="glyphicon glyphicon-log-out"></span> Déconnexion</a></li>
Expand Down
1 change: 1 addition & 0 deletions src/web/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d030e97

Please sign in to comment.