Skip to content

Commit

Permalink
Merge pull request #741 from DIRACGridBot/cherry-pick-2-380b2571-inte…
Browse files Browse the repository at this point in the history
…gration

[sweep:integration] Re-add support for setting default theme
  • Loading branch information
fstagni authored Jul 28, 2023
2 parents 54ffd34 + 90d20ab commit 0b4388c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
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 @@ -152,7 +152,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 @@ -172,6 +172,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

0 comments on commit 0b4388c

Please sign in to comment.