Skip to content

Commit

Permalink
Merge pull request #739 from sfayer/readd_theme
Browse files Browse the repository at this point in the history
[v5] Re-add support for setting default theme
  • Loading branch information
fstagni authored Jul 24, 2023
2 parents e307589 + 3d19afc commit 380b257
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 @@ -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

0 comments on commit 380b257

Please sign in to comment.