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 news banner and log #215

Merged
merged 11 commits into from
Feb 17, 2023
14 changes: 14 additions & 0 deletions nbclassic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
from ._version import __version__


print("""
_ _
| \ | | _____ _____
| \| |/ _ \ \ /\ / / __|
| |\ | __/\ V V /\__ \\
|_| \_|\___| \_/\_/ |___/


If you plan to upgrade to Notebook 7, read https://nbclassic.readthedocs.io/en/latest/nbclassic_to_notebook7.html

Notebook 6 / NbClassic extensions will not work on Notebook 7.
""")


# Packagers: modify this line if you store the notebook static files elsewhere
DEFAULT_STATIC_FILES_PATH = os.path.join(os.path.dirname(__file__), "static")

Expand Down
2 changes: 1 addition & 1 deletion nbclassic/static/base/js/namespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ define(function(){
// tree
jglobal('SessionList','tree/js/sessionlist');

Jupyter.version = "0.5.1";
Jupyter.version = "0.6.0.dev0";
Jupyter._target = '_blank';

return Jupyter;
Expand Down
30 changes: 30 additions & 0 deletions nbclassic/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,26 @@
</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">NEWS</span>
If you plan to upgrade to Notebook 7, read <a href="https://nbclassic.readthedocs.io/en/latest/nbclassic_to_notebook7.html" target="_top">https://nbclassic.readthedocs.io/en/latest/nbclassic_to_notebook7.html</a>
-
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
Notebook 6 / NbClassic extensions will not work on Notebook 7.
</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">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span> 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="
<div id="ipython_notebook" class="nav navbar-brand"><a href="{{default_url}}
Expand Down Expand Up @@ -205,6 +225,16 @@
}
}
_remove_token_from_url();
document.addEventListener('DOMContentLoaded', function () {
const newsId = document.querySelector('#newsId');
const dontShowId = document.querySelector('#dontShowId');
const showNbClassicNews = localStorage.getItem('showNbClassicNews');
dontShowId.addEventListener('click', () => {
localStorage.setItem('showNbClassicNews', false);
newsId.style.display = 'none';
});
if (!showNbClassicNews) newsId.style.display = 'inline';
});
</script>
</body>

Expand Down