Skip to content

Commit

Permalink
feat: option to hide banner "This website runs on Solara" (#836)
Browse files Browse the repository at this point in the history
See:
#673

Use the environiment variable:
SOLARA_THEME_SHOW_BANNER=False

To hide it.

For popout windows we automatically hide it.
  • Loading branch information
maartenbreddels authored Oct 25, 2024
1 parent 7427daf commit 5aadae5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions solara/server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ThemeVariant(str, Enum):
class ThemeSettings(BaseSettings):
variant: ThemeVariant = ThemeVariant.light
loader: str = "solara"
show_banner: bool = True

class Config:
env_prefix = "solara_theme_"
Expand Down
2 changes: 1 addition & 1 deletion solara/server/templates/loader-solara.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h1>{{ loading_text }}</h1>
<jupyter-widget-mount-point mount-id="solara-main">
A widget with mount-id="solara-main" should go here
</jupyter-widget-mount-point>
<div style="position: absolute; right: 0px; bottom: 0px; padding: 10px;">
<div v-if="showBanner" style="position: absolute; right: 0px; bottom: 0px; padding: 10px;">
<b>This website runs on <a href="https://solara.dev">Solara</a></b>
</div>
</div>
Expand Down
5 changes: 5 additions & 0 deletions solara/server/templates/solara.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@
this.forceUpdateTrigger += 1;
original_$forceUpdate();
});
// in case we are showing a popop (e.g. using ipypopout), hide the banner
if(searchParams.has('modelid')) {
this.showBanner = false;
}
},
mounted() {
document.querySelector('#app').removeAttribute("style");
Expand Down Expand Up @@ -413,6 +417,7 @@
loadingPage: false,
_lastBusyTimer: null,
kernelBusyLong: false,
showBanner: theme.show_banner,
// outputMessages: [{ name: 'stderr', text: 'lala' }],
}
}
Expand Down

0 comments on commit 5aadae5

Please sign in to comment.