93 lines
2.7 KiB
HTML
93 lines
2.7 KiB
HTML
{% extends "base.html" %}
|
|
{% load i18n %}
|
|
{% load misc %}
|
|
|
|
{% block content %}
|
|
|
|
<div id="home">
|
|
|
|
{% if messages %}
|
|
<ul class="messages">
|
|
{% for message in messages %}
|
|
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
|
|
<div id="authbuttons">
|
|
Choisissez votre établissement :<br /><br />
|
|
{% if default_idp %}
|
|
<a class="bigbutton" id="default-idp" title="{{ default_idp.name }}" href="/sso?entity_id={{ default_idp.entity_id|urlfullencode }}">{{ default_idp.name }}</a>
|
|
<a class="bigbutton" id="other-idps" href="#" onclick="$('#popup').show().modal()">Autres établissements</a>
|
|
{% else %}
|
|
<a class="bigbutton" id="default-idp" title="" href="#" style="display: none;"></a>
|
|
<a class="bigbutton" id="other-idps" href="#" onclick="$('#popup').show().modal()">Liste des établissements</a>
|
|
{% endif %}
|
|
</div> <!-- #authbuttons -->
|
|
|
|
<div id="popup">
|
|
<div>
|
|
<a id="close" href="#" onclick="$.modal.close(); $('#popup').hide(); return false;">Fermer</a>
|
|
<h3>Liste des établissements</h3>
|
|
<ul>
|
|
{% for p in idp_providers %}
|
|
<li><a href="/sso?entity_id={{ p.entity_id|urlfullencode }}"
|
|
title="Authentification via {{ p.name }}"
|
|
class="idp-link"
|
|
data-idp="{{ p.entity_id }}"
|
|
>{{ p.name }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
</div><!-- #popup -->
|
|
|
|
<p class="disclaimer">
|
|
{% block disclaimer %}
|
|
{% endblock %}
|
|
</p>
|
|
|
|
<!-- discovery -->
|
|
<script type="text/javascript" src="{{ MEDIA_URL }}simple-disco-store/jquery.qs.js"></script>
|
|
<script type="text/javascript" src="{{ MEDIA_URL }}simple-disco-store/discoquery.js"></script>
|
|
<script type="text/javascript" src="{{ MEDIA_URL }}simple-disco-store/debug.js"></script>
|
|
<script>
|
|
|
|
function query() {
|
|
$.disco_query(
|
|
"https://{{https_hostname}}/authsaml2/metadata",
|
|
"https://{{https_hostname}}{{ MEDIA_URL }}simple-disco-store/store.html",
|
|
"https://{{https_hostname}}{{ MEDIA_URL }}simple-disco-store/response.html",
|
|
function (entity_id, auth) {
|
|
$('a#default-idp').text("entity_id : " + entity_id);
|
|
alert("query " + entity_id);
|
|
});
|
|
}
|
|
|
|
function set(idp_entity_id) {
|
|
$.disco_set(
|
|
"https://{{https_hostname}}/authsaml2/metadata",
|
|
idp_entity_id,
|
|
"https://{{https_hostname}}{{ MEDIA_URL }}simple-disco-store/store.html",
|
|
"https://{{https_hostname}}{{ MEDIA_URL }}simple-disco-store/response.html",
|
|
function (entity_id, auth) {
|
|
// alert("set " + entity_id);
|
|
});
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
query();
|
|
});
|
|
|
|
$('.idp-link').click(function () {
|
|
var a = $(this);
|
|
set(a.data('idp'));
|
|
setTimeout(function () { window.location.href = a.attr('href'); }, 3000);
|
|
return false;
|
|
});
|
|
|
|
</script>
|
|
|
|
</div><!-- #home -->
|
|
|
|
{% endblock %}
|