Skip to content
Snippets Groups Projects
Commit 7c0a0114 authored by Maria Petrova-El Sayed's avatar Maria Petrova-El Sayed
Browse files

Add a second login button for workshops

parent 991aede0
Branches
No related tags found
No related merge requests found
...@@ -34,12 +34,19 @@ function carouselNormalization() { ...@@ -34,12 +34,19 @@ function carouselNormalization() {
}); });
} }
function toggleWorkshopLogin(){
const urlParams = new URLSearchParams(window.location.search);
const nextParam = urlParams.get('next');
if (nextParam && nextParam.startsWith('/hub/workshop')) {
$('#btn-login').hide();
} else {
$('#btn-login').show();
}
}
$(document).ready(function () { $(document).ready(function () {
carouselNormalization(); carouselNormalization();
toggleWorkshopLogin();
// Start cycling of carousel
// var carousel = new bootstrap.Carousel($('#login-carousel'), {
// interval: 5000,
// })
// carousel.cycle();
}); });
\ No newline at end of file
...@@ -33,6 +33,12 @@ ...@@ -33,6 +33,12 @@
</li> </li>
{%- endmacro -%} {%- endmacro -%}
{%- if custom_config.get("workshop", {}).get("login", {}).get("enabled", True) %}
{%- set login_text = "Regular sign in" -%}
{%- else %}
{%- set login_text = "Sign in" -%}
{%- endif -%}
{%- block main -%} {%- block main -%}
<div class="row g-0 h-100 justify-content-center"> <div class="row g-0 h-100 justify-content-center">
<div id="login-background" class="col-12 flex-column d-flex justify-content-center align-items-center h-100"> <div id="login-background" class="col-12 flex-column d-flex justify-content-center align-items-center h-100">
...@@ -43,15 +49,6 @@ ...@@ -43,15 +49,6 @@
<div class="row g-0 w-100 d-flex justify-content-center align-items-center"> <div class="row g-0 w-100 d-flex justify-content-center align-items-center">
<p class="fs-5 text-dark ps-3"> <p class="fs-5 text-dark ps-3">
Sign in using one of the following accounts Sign in using one of the following accounts
<!--
For more information click
<a href="https://docs.{{hostname}}/github/FZJ-JSC/jupyter-jsc-notebooks/blob/documentation/01-Introduction/03-Login-to-Jupyter-JSC.ipynb" target="_blank">
here.
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-question-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.496 6.033h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286a.237.237 0 0 0 .241.247zm2.325 6.443c.61 0 1.029-.394 1.029-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94 0 .533.425.927 1.01.927z"/>
</svg>
</a>
-->
<!-- Logos --> <!-- Logos -->
<ul class="list-group list-group-flush my-2"> <ul class="list-group list-group-flush my-2">
{{list_item("jsc-login", "images/pages/login/Logo_FZ_Juelich_jsc.png", alt="JSC-Account")}} {{list_item("jsc-login", "images/pages/login/Logo_FZ_Juelich_jsc.png", alt="JSC-Account")}}
...@@ -69,10 +66,18 @@ ...@@ -69,10 +66,18 @@
<div class="d-flex justify-content-center align-items-center pt-5"> <div class="d-flex justify-content-center align-items-center pt-5">
<a id="btn-login" class="btn btn-primary shadow btn-lg p-4" role="button"> <a id="btn-login" class="btn btn-primary shadow btn-lg p-4" role="button">
<!-- <img src='{{static_url("images/pages/login/User.svg", include_version=False) }}'/> --> <!-- <img src='{{static_url("images/pages/login/User.svg", include_version=False) }}'/> -->
Sign In {{login_text}}
</a> </a>
</div> </div>
<p class="fs-6 fw-light text-dark align-self-end text-center">No account yet? {%- if custom_config.get("workshop", {}).get("login", {}).get("enabled", True) %}
<div class="d-flex justify-content-center align-items-center pt-2">
<a id="btn-login-workshop" class="btn btn-primary shadow btn-lg p-4" role="button">
<!-- <img src='{{static_url("images/pages/login/User.svg", include_version=False) }}'/> -->
Workshop sign in
</a>
</div>
{%- endif -%}
<p class="fs-6 fw-light text-dark align-self-end text-center pt-2">No account yet?
<a href="https://docs.{{hostname}}/github/FZJ-JSC/jupyter-jsc-notebooks/blob/documentation/01-Introduction/03-Login-to-Jupyter-JSC.ipynb" target="_blank"> <a href="https://docs.{{hostname}}/github/FZJ-JSC/jupyter-jsc-notebooks/blob/documentation/01-Introduction/03-Login-to-Jupyter-JSC.ipynb" target="_blank">
Help Help
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-question-circle-fill" viewBox="0 0 16 16"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-question-circle-fill" viewBox="0 0 16 16">
...@@ -99,5 +104,10 @@ $("#btn-login").click(function () { ...@@ -99,5 +104,10 @@ $("#btn-login").click(function () {
var url = window.location.search; var url = window.location.search;
window.location.href = "{{ base_url }}oauth_login" + url; window.location.href = "{{ base_url }}oauth_login" + url;
}); });
$("#btn-login-workshop").click(function () {
var url = window.location.search;
window.location.href = "{{ base_url }}oauth_login" + url;
});
</script> </script>
{%- endblock -%} {%- endblock -%}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment