diff options
author | Sean Smith <ssmith@iol.unh.edu> | 2020-08-19 11:00:50 -0400 |
---|---|---|
committer | Adam Hassick <ahassick@iol.unh.edu> | 2020-12-04 14:20:41 -0500 |
commit | 99dfb2c0e97bce2f8827a6e8eef79b4abb60297a (patch) | |
tree | 1027fd9493400f9d1f545153f94d68ed3d27fd4b /src/templates | |
parent | 2418587ae1a7ad463988c14cc9b0d9a2f9cf0e95 (diff) |
LFID login for both projects2.1.0-rc1
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Change-Id: I4a14dc75d7890a6d395b3f52177a7000ae1a2150
Diffstat (limited to 'src/templates')
-rw-r--r-- | src/templates/akraino/base.html | 20 | ||||
-rw-r--r-- | src/templates/akraino/dashboard/landing.html | 6 | ||||
-rw-r--r-- | src/templates/base/base.html | 45 | ||||
-rw-r--r-- | src/templates/base/dashboard/landing.html | 8 | ||||
-rw-r--r-- | src/templates/base/dashboard/login.html | 5 |
5 files changed, 44 insertions, 40 deletions
diff --git a/src/templates/akraino/base.html b/src/templates/akraino/base.html index b93dcd2..1368476 100644 --- a/src/templates/akraino/base.html +++ b/src/templates/akraino/base.html @@ -22,23 +22,3 @@ {% endblock logo %} {% block dropDown %} {% endblock dropDown %} - -{% block login %} - <div class="dropdown-menu dropdown-menu-right"> - {% if user.is_authenticated %} - <a href="{% url 'account:settings' %}" class="text-dark dropdown-item"> - <i class="fas fa-cog"></i> - Settings - </a> - <a href="{% url 'oidc_logout' %}" class="text-dark dropdown-item"> - <i class="fas fa-sign-out-alt"></i> - Logout - </a> - {% else %} - <a href="{% url 'oidc_authentication_init' %}" class="text-dark dropdown-item"> - <i class="fas fa-sign-in-alt"></i> - Login with LFID - </a> - {% endif %} - </div> -{% endblock login %}
\ No newline at end of file diff --git a/src/templates/akraino/dashboard/landing.html b/src/templates/akraino/dashboard/landing.html index 39eebb6..5533469 100644 --- a/src/templates/akraino/dashboard/landing.html +++ b/src/templates/akraino/dashboard/landing.html @@ -19,11 +19,5 @@ <a class="btn btnAkr btn-lg d-flex flex-column justify-content-center align-content-center border text-white p-4" href="/booking/quick/">Book a Pod</a> {% endblock btnGrp %} -{% block biglogin %} -<h4 class="text-center"> - To get started, please log in with <a href="{% url 'oidc_authentication_init' %}"> Linux Foundation ID</a> -</h4> -{% endblock biglogin %} - {% block returningUsers %} {% endblock returningUsers %} diff --git a/src/templates/base/base.html b/src/templates/base/base.html index f86cff8..3ecad1a 100644 --- a/src/templates/base/base.html +++ b/src/templates/base/base.html @@ -44,25 +44,52 @@ {% endif %} <i class="fas fa-caret-down rotate"></i> </a> - {% block login %} <div class="dropdown-menu dropdown-menu-right"> - {% if user.is_authenticated %} + {% if LFID %} + {% if user.is_authenticated %} <a href="{% url 'account:settings' %}" class="text-dark dropdown-item"> <i class="fas fa-cog"></i> - Settings + Settings </a> - <a href="{% url 'account:logout' %}?next={{ request.path }}" class="text-dark dropdown-item"> + <a id="logout_btn" href="#" method="post" class="text-dark dropdown-item"> <i class="fas fa-sign-out-alt"></i> - Logout + Logout </a> - {% else %} - <a href="{% url 'account:login' %}" class="text-dark dropdown-item"> + <form id="logout_form" action="{% url 'oidc_logout' %}" method="post" style="visibility: hidden;"> + {% csrf_token %} + <input type="submit" value="logout"> + </form> + <script> + const logout_btn = document.getElementById("logout_btn"); + + const logout_form = document.getElementById("logout_form"); + + logout_btn.onclick = function() { logout_form.submit(); }; + </script> + {% else %} + <a href="{% url 'oidc_authentication_init' %}" class="text-dark dropdown-item"> <i class="fas fa-sign-in-alt"></i> - Login with Jira + Login with LFID </a> + {% endif %} + {% else %} + {% if user.is_authenticated %} + <a href="{% url 'account:settings' %}" class="text-dark dropdown-item"> + <i class="fas fa-cog"></i> + Settings + </a> + <a href="{% url 'account:logout' %}?next={{ request.path }}" class="text-dark dropdown-item"> + <i class="fas fa-sign-out-alt"></i> + Logout + </a> + {% else %} + <a href="{% url 'account:login' %}" class="text-dark dropdown-item"> + <i class="fas fa-sign-in-alt"></i> + Login with Jira + </a> + {% endif %} {% endif %} </div> - {% endblock login %} </li> </ul> </div> diff --git a/src/templates/base/dashboard/landing.html b/src/templates/base/dashboard/landing.html index 3291606..4ed2ec1 100644 --- a/src/templates/base/dashboard/landing.html +++ b/src/templates/base/dashboard/landing.html @@ -43,11 +43,15 @@ <div class="col-12 col-lg-6 mb-4"> <h2 class="border-bottom">Get Started</h2> {% if request.user.is_anonymous %} - {% block biglogin %} + {% if LFID %} + <h4 class="text-center"> + To get started, please log in with <a href="{% url 'oidc_authentication_init' %}">Linux Foundation ID</a> + </h4> + {% else %} <h4 class="text-center"> To get started, please log in with your <a href="/accounts/login">Linux Foundation Jira account</a> </h4> - {% endblock biglogin %} + {% endif %} {% else %} {% block btnGrp %} <p>To get started, book a server below:</p> diff --git a/src/templates/base/dashboard/login.html b/src/templates/base/dashboard/login.html index d3aa4ad..5af201a 100644 --- a/src/templates/base/dashboard/login.html +++ b/src/templates/base/dashboard/login.html @@ -1,8 +1,7 @@ {% extends "base.html" %} {% block content %} -<h3>You Must Login To Do That</h3> - -<a href="/accounts/login">Login Here</a> +<h3> You Must Login To Do That<h3> +<a href="{% url 'oidc_authentication_init' %}"> Login Here </a> {% endblock %} |