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

Add a banner and log to information about the migration to Notebook 7 plan #6742

Merged
merged 2 commits into from
Feb 20, 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
14 changes: 14 additions & 0 deletions notebook/notebookapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,20 @@ def __init__(self, jupyter_app, kernel_manager, contents_manager,
if settings['autoreload']:
log.info('Autoreload enabled: the webapp will restart when any Python src file changes.')

print("""
_ _ _ _
| | | |_ __ __| |__ _| |_ ___
| |_| | '_ \/ _` / _` | _/ -_)
\___/| .__/\__,_\__,_|\__\___|
|_|

Read the migration plan to Notebook 7 to learn about the new features and the actions to take if you are using extensions.

https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html

Please note that updating to Notebook 7 might break some of your extensions.
""")

super().__init__(handlers, **settings)

def init_settings(self, jupyter_app, kernel_manager, contents_manager,
Expand Down
29 changes: 29 additions & 0 deletions notebook/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,25 @@
</noscript>

<div id="header" role="navigation" aria-label="{% trans %}Top Menu{% endtrans %}">
<div id="newsId" style="display: none">
<div class="alert alert-info" role="alert">
<div style="display: flex">
<div>
<span class="label label-warning">UPDATE</span>
Read <a href="https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html" style="text-decoration: underline;" target="_blank">the migration plan</a> to Notebook 7 to learn about the new features and the actions to take if you are using extensions
-
Please note that updating to Notebook 7 might break some of your extensions.
</div>
<div style="margin-left: auto;">
<a href="" onclick="alert('This message will not be shown anymore.'); return false;">
<button type="button" class="btn btn-default btn-xs" id="dontShowId">
Don't show anymore
</button>
</a>
</div>
</div>
</div>
</div>
<div id="header-container" class="container">
<div id="ipython_notebook" class="nav navbar-brand"><a href="{{default_url}}
{%- if logged_in and token -%}?token={{token}}{%- endif -%}" title='{% trans %}dashboard{% endtrans %}'>
Expand Down Expand Up @@ -203,6 +222,16 @@
}
_remove_token_from_url();
sys_info = {{sys_info|safe}};
document.addEventListener('DOMContentLoaded', function () {
const newsId = document.querySelector('#newsId');
const dontShowId = document.querySelector('#dontShowId');
const showNotebookNews = localStorage.getItem('showNotebookNews');
dontShowId.addEventListener('click', () => {
localStorage.setItem('showNotebookNews', false);
newsId.style.display = 'none';
});
if (!showNotebookNews) newsId.style.display = 'inline';
});
</script>
</body>

Expand Down