IdentityPython/pyFF

View on GitHub
src/pyff/templates/ds.html

Summary

Maintainability
Test Coverage
{% extends "common.html" %}

{% block title %}{{ gettext('Please login...') }}{% endblock %}

{% block header %}
    <div class="row discovery">
        <div class="col-md-12">
            <div class="media">
                <div class="media-body">
                    <h1 class="mt-0 mb-1">{% if entity.title %}{{entity.title}}{% else %}{{ entity.entity_id }}{% endif %}</h1>
                    {% if entity.descr and entity.descr != entity.title %}
                    <span class="small">{{ entity.descr }}</span>
                    {% endif %}
                    {% if entity.psu %}
                    <span class="small">
                        <a title="Privacy Statement" href="{{ entity.psu }}">Privacy Statement</a>
                    </span>
                    {% endif %}
                </div>
                <div class="d-flex ml-3 sp-icon">
                    {% if entity.entity_icon %}
                    <img class="img-thumbnail fallback" src="{{entity.entity_icon}}"/>
                    {% endif %}
                </div>

            </div>
        </div>
    </div>
{% endblock %}

{% block content %}
        <div class="row discovery">
            <div class="col-md-12">
                <p class="text-info">
                    {{ gettext('This service requests that you login. Select your preferred method below...') }}
                </p>
                <div id="ds-saved-choices" class="list-group"></div>
                <br/>
                <div id="dsclient"
                     data-href="{{ entity['entity_id'] }}"
                     data-mdq="/metadata/"
                     data-store="{{storage}}"
                     data-search="{{search}}"
                     data-list="{{list}}"
                     data-related="{{ entity['domains'] }}"
                     data-inputfieldselector="#searchinput">
                    <form id="dsform">
                        <div class="form-group">
                            <input id="searchinput"
                                   placeholder="{{ gettext('Start typing to search for your login provider or home organization ...') }}"
                                   class="form-control"
                                   type="search"/>
                        </div>
                    </form>
                    <div id="ds-search-list" class="list-group"></div>
                </div>
            </div>
        </div>
{% endblock %}

{% block endscripts %}
        <script type="text/javascript" src="/static/js/jquery-ui.min.js"></script>
        <!-- un-minified -->
        <script type="text/javascript" src="/static/js/sha1.js"></script>
        <script type="text/javascript" src="/static/js/client.min.js"></script>
        <script type="text/javascript" src="/static/js/ds-client.js"></script>
        <script type="text/javascript" src="/static/js/jquery-ds-widget.js"></script>
        <!-- eof -->
        <!-- script type="text/javascript" src="/static/js/ds-widget.min.js"></script -->
        <script type="text/javascript" src="/static/js/bootstrap-list-filter.src.js"></script>
        <script type="text/javascript" src="/static/js/imgload.js"></script>
{% endblock %}

{% block final %}
        <script type="text/javascript">
            $(document).ready(function() {
                $("#dsclient").discovery_client();
            });
            $('img.fallback').bind('error', function () {
                   $(this).unbind('error');
                   $(this).attr('src', "/static/icons/1x1t.png").removeClass('img-thumbnail');
            }).imgLoad(function() {
                $(this).fadeIn(300);
            });
        </script>
{% endblock %}
</body>
</html>