summaryrefslogtreecommitdiffstats
path: root/virtualenv/pffedportal
diff options
context:
space:
mode:
authorThomas NOEL <tnoel@entrouvert.com>2012-07-12 13:33:22 (GMT)
committerThomas NOEL <tnoel@entrouvert.com>2012-07-12 13:33:22 (GMT)
commitc332d8945b38b0394c9b281a10211b482404e719 (patch)
treed88fa3f7f9a21a4f2c7251a792806374375acb35 /virtualenv/pffedportal
parent4ef86775ec7cd854d6eb38a87e426ea633b63b5d (diff)
downloadunivnautes-old-c332d8945b38b0394c9b281a10211b482404e719.zip
univnautes-old-c332d8945b38b0394c9b281a10211b482404e719.tar.gz
univnautes-old-c332d8945b38b0394c9b281a10211b482404e719.tar.bz2
disco: add in mobile template
Diffstat (limited to 'virtualenv/pffedportal')
-rw-r--r--virtualenv/pffedportal/templates/mobile/login0.html99
1 files changed, 76 insertions, 23 deletions
diff --git a/virtualenv/pffedportal/templates/mobile/login0.html b/virtualenv/pffedportal/templates/mobile/login0.html
index 0b465dd..6f0aedb 100644
--- a/virtualenv/pffedportal/templates/mobile/login0.html
+++ b/virtualenv/pffedportal/templates/mobile/login0.html
@@ -18,41 +18,94 @@
</div>
{% endblock %}
-
-
-
{% block content %}
<nav>
+<p>
{% if default_idp %}
-<ul data-role="listview" data-inset="true">
- <li><a data-ajax="false" href="/sso?entity_id={{ default_idp.entity_id|urlfullencode }}">{{ default_idp.name }}</a></li>
- <li><a data-transition="slide" href="#liste">Autres établissements</a></li>
-</ul>
-
-</nav>
-
-</div><!-- /content -->
-</div><!-- /page -->
-<div data-role="page" id="liste" data-theme="b">
- <div data-role="header" data-position="inline">
- <a href="#home" data-icon="arrow-l" data-rel="back" data-transition="reverse">Accueil</a>
- <h1><img src="{{ MEDIA_URL }}mobile/logo_eduspot_120x86.png" class="logo-eduspot"/></h1>
- <h1>Autres établissements</h1>
- </div>
- <div data-role="content">
- <nav>
+<a id="default-idp" data-ajax="false" href="/sso?entity_id={{ default_idp.entity_id|urlfullencode }}"
+ data-role="button" data-icon="arrow-r" data-iconpos="bottom">{{ default_idp.name }}</a>
+{% else %}
+<a id="default-idp" data-ajax="false" href="#"
+ data-role="button" data-icon="arrow-r" data-iconpos="bottom"
+ style="display: none;">Default</a>
{% endif %}
+</p>
<ul data-role="listview" data-inset="true" data-filter="true" data-filter-placeholder="Recherche">
{% for p in idp_providers %}
- <li><a data-ajax="false" href="/sso?entity_id={{ p.entity_id|urlfullencode }}"
- title="Authentification via {{ p.name }}">{{ p.name }}</a></li>
-{% endfor %}
+ <li><a
+ class="idp-link" data-idp="{{ p.entity_id }}"
+ data-ajax="false"
+ href="/sso?entity_id={{ p.entity_id|urlfullencode }}"
+ title="Authentification via {{ p.name }}">{{ p.name }}</a>
+ </li>
+ {% endfor %}
</ul>
</nav>
+{% if disco_stores_read %}
+<!-- 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>
+
+ idps = {
+ {% for p in idp_providers %}
+ "{{ p.entity_id }}": {
+ name: "{{ p.name }}",
+ href: "/sso?entity_id={{ p.entity_id|urlfullencode }}",
+ },
+ {% endfor %}
+ };
+
+ function query() {
+ {% for store in disco_stores_read %}
+ $.disco_query(
+ "https://{{https_hostname}}/authsaml2/metadata",
+ "{{ store }}",
+ "https://{{https_hostname}}{{ MEDIA_URL }}simple-disco-store/response.html",
+ function (entity_id, store, auth) {
+ idp = idps[entity_id];
+ // alert("idp = " + JSON.stringify(idp));
+ $('a#default-idp span.ui-btn-text').text(idp.name);
+ $('a#default-idp').attr({
+ href: idp.href,
+ title: "Authentification via " + idp.name,
+ });
+ });
+ {% endfor %}
+ }
+
+ function set(idp_entity_id) {
+ {% for store in disco_stores_write %}
+ $.disco_set(
+ "https://{{https_hostname}}/authsaml2/metadata",
+ idp_entity_id,
+ "{{ store }}",
+ "https://{{https_hostname}}{{ MEDIA_URL }}simple-disco-store/response.html",
+ function (entity_id, store, auth) {
+ // alert("set: store " + entity_id + " on " + store);
+ });
+ {% endfor %}
+ }
+
+ $(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>
+{% endif %}{# disco_stores_read #}
+
{% endblock %}