Skip to content

Commit

Permalink
注册用户按钮按照配置控制是否显示
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyo committed Aug 12, 2019
1 parent 7f900a9 commit 465463c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions common/templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
<div class="form-group">
<button class="btn btn-primary btn-block" id="btnLogin" type="button"><i class="fa-lock"></i>登录</button>
</div>
<div class="form-group">
<a href="#" data-toggle="modal" data-target="#sign-up">注册用户</a>
</div>
{% if sign_up_enabled %}
<div class="form-group">
<a href="#" data-toggle="modal" data-target="#sign-up">注册用户</a>
</div>
{% endif %}
</form>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions common/utils/global_info.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: UTF-8 -*-
from sql.utils.workflow_audit import Audit
from common.config import SysConfig


def global_info(request):
Expand All @@ -16,4 +17,5 @@ def global_info(request):

return {
'todo': todo,
'sign_up_enabled': SysConfig().get('sign_up_enabled')
}

2 comments on commit 465463c

@LeoQuote
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个要不放在 login view 里单独传进去吧, 这个选项也就 login页用到了吧

@hhyo
Copy link
Owner Author

@hhyo hhyo commented on 465463c Aug 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,忘记可以这样传,就放全局了

Please sign in to comment.