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

Main page footer can be overridden #1471

Closed
wants to merge 2 commits into from
Closed
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
11 changes: 11 additions & 0 deletions binderhub/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,16 @@ def _log_level(self):
config=True,
)

about_summary_message = Unicode(
"",
help="""
An optional summary that appears on all pages apart from the about page.

The value will be inserted "as is". Raw HTML is supported.
""",
config=True,
)

extra_footer_scripts = Dict(
{},
help="""
Expand Down Expand Up @@ -822,6 +832,7 @@ def initialize(self, *args, **kwargs):
"google_analytics_domain": self.google_analytics_domain,
"about_message": self.about_message,
"banner_message": self.banner_message,
"about_summary_message": self.about_summary_message,
"extra_footer_scripts": self.extra_footer_scripts,
"jinja2_env": jinja_env,
"build_memory_limit": self.build_memory_limit,
Expand Down
2 changes: 2 additions & 0 deletions binderhub/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def get(self):
submit=False,
google_analytics_code=self.settings["google_analytics_code"],
google_analytics_domain=self.settings["google_analytics_domain"],
about_summary_message=self.settings["about_summary_message"],
extra_footer_scripts=self.settings["extra_footer_scripts"],
repo_providers=self.settings["repo_providers"],
)
Expand Down Expand Up @@ -122,6 +123,7 @@ async def get(self, provider_prefix, _unescaped_spec):
submit=True,
google_analytics_code=self.settings["google_analytics_code"],
google_analytics_domain=self.settings["google_analytics_domain"],
about_summary_message=self.settings["about_summary_message"],
extra_footer_scripts=self.settings["extra_footer_scripts"],
)

Expand Down
8 changes: 8 additions & 0 deletions binderhub/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
{% block main %}
{% endblock main %}

{% block about_summary %}
{% if about_summary_message %}
<div class="container">
{{ about_summary_message | safe }}
</div>
{% endif %}
{% endblock about_summary %}

{% block footer %}
<div class="container">
<div class="row text-center">
Expand Down
1 change: 1 addition & 0 deletions testing/local-binder-local-hub/binderhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
c.BinderHub.banner_message = (
'See <a href="https://github.com/jupyterhub/binderhub">BinderHub on GitHub</a>'
)
c.BinderHub.about_summary_message = '<div class="row text-center" style="transform:rotate(10deg);padding-top:3em;"><h3>This is a summary of the about message.</h3></div>'

c.BinderHub.hub_url_local = "http://localhost:8000"

Expand Down