Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Make User Cloud tab hideable #9

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ EMAIL_SIGNATURE="Regards, The Development Team"
FOOTER_MANAGED_BY="DataShare Lab"
FOOTER_SUPPORTED_BY="people"
FOOTER_ACCESSIBILITY_PAGE=
HIDE_ACCOUNT_CLOUD_TAB=False

# Single Sign-On
ENABLE_SSO="False"
Expand Down
1 change: 1 addition & 0 deletions physionet-django/physionet/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
SSO_REMOTE_USER_HEADER = config('SSO_REMOTE_USER_HEADER', default='HTTP_REMOTE_USER')
SSO_LOGIN_BUTTON_TEXT = config('SSO_LOGIN_BUTTON_TEXT', default='Login')
GCS_SIGNED_URL_LIFETIME_IN_MINUTES = config('GCS_SIGNED_URL_LIFETIME_IN_MINUTES', default=1440, cast=int)
HIDE_ACCOUNT_CLOUD_TAB = config('HIDE_ACCOUNT_CLOUD_TAB', default=False, cast=bool)


# Application definition
Expand Down
3 changes: 3 additions & 0 deletions physionet-django/user/templatetags/user_templatetags.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django import template
from django.conf import settings


register = template.Library()
Expand All @@ -7,6 +8,8 @@
@register.inclusion_tag('user/settings_tabs.html')
def settings_tabs(hide_password_settings: bool):
default_tabs = ['Profile', 'Emails', 'Username', 'Cloud', 'ORCID', 'Credentialing', 'Training', 'Agreements']
if settings.HIDE_ACCOUNT_CLOUD_TAB:
default_tabs.remove('Cloud')
if not hide_password_settings:
default_tabs.insert(1, 'Password')
return {'settings_tabs': default_tabs}
Expand Down