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

[v5] Re-add support for setting default theme #739

Merged
merged 1 commit into from
Jul 24, 2023
Merged
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
5 changes: 2 additions & 3 deletions src/WebAppDIRAC/Lib/Conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,12 @@ def getAuthSectionForHandler(route):
return f"{BASECS}/Access/{route}"


@deprecated("This funtion is deprecated, use 'tabs' instead.")
def getTheme():
"""Get theme
"""Get theme from config or return default

:return: str
"""
return "tabs"
return getCSValue("Theme", "crisp")


def getIcon():
Expand Down
5 changes: 4 additions & 1 deletion src/WebAppDIRAC/WebApp/handler/RootHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def web_loginComplete(self, code: str, state: str, **kwargs):
)
return resp

def web_index(self, *, url_state="", theme="crisp", open_app="", **kwargs):
def web_index(self, *, url_state="", theme="", open_app="", **kwargs):
"""Index method

:param str url_state: url state
Expand All @@ -179,6 +179,9 @@ def web_index(self, *, url_state="", theme="crisp", open_app="", **kwargs):
except Exception:
gLogger.warn(f"Welcome page not found here: {welcomeFile}")

if not theme:
theme = Conf.getTheme()

# pylint: disable=no-member
return TornadoResponse().render(
"root.tpl",
Expand Down
Loading