{% extends "base/base.html" %}
{% load static %}

{% block css %}
<link rel="stylesheet" href="{% static "css/social-auth.css"%}">
{% if 'ldap_auth' in PLUGINS_ENABLED %}
    <link rel="stylesheet" href="{% static "css/ldap_auth.css"%}">
{% endif %}
{% if 'globus' in PLUGINS_ENABLED %}
    <link rel="stylesheet" href="{% static "css/globus_auth.css"%}">
{% endif %}
{% if 'saml_auth' in PLUGINS_ENABLED %}
    <link rel="stylesheet" href="{% static "css/saml_auth.css"%}">
{% endif %}

{% endblock %}

{% block content %}
<div id="fh5co-portfolio">

    {% include 'messages/message.html' %}
    {% if user and not user.is_anonymous %}
    <h3>Hello, {{ user.get_full_name }}!</h3>
    <br>
    <div>

       <!-- If all credentials provided, give user full access -->
       <a href="{% url 'my_collections' %}"><button class="btn btn-default btn-sm">My Container Collections</button></a>
       <a href="{% url 'profile' %}"><button class="btn btn-default btn-sm">Profile</button></a>
       <a href="{% url 'logout' %}"><button class="btn btn-default btn-sm">Logout</button></a>

    {% else %}

    <!-- User isn't logged in yet! -->
    <div class="login-box">

        {% if ENABLE_TWITTER_AUTH %}
        <a class="social-button" id="twitter-connect" href="{% url 'social:begin' 'twitter' %}?next={{ domain }}{{ request.path }}">Login with Twitter</a>
        {% endif %}
        <!--<a class="social-button" id="box-connect" href="{% url 'social:begin' 'box' %}?next={{ request.path }}">Login with Box</a>-->

        {% if ENABLE_GITHUB_AUTH %}
        <a class="social-button" id="github-connect" href="{% url 'social:begin' 'github' %}?next={{ domain }}{{ request.path }}">Login with Github</a>
        {% endif %}

        {% if ENABLE_GITLAB_AUTH %}
        <a class="social-button" id="gitlab-connect" href="{% url 'social:begin' 'gitlab' %}?next={{ domain }}{{ request.path }}">Login with Gitlab</a>
        {% endif %}

        {% if ENABLE_BITBUCKET_AUTH %}
        <a class="social-button" id="bitbucket-connect" href="{% url 'social:begin' 'bitbucket' %}?next={{ domain }}{{ request.path }}">Login with Bitbucket</a>
        {% endif %}

        {% if ENABLE_GOOGLE_AUTH %}
        <a class="social-button" id="google-connect" href="{% url 'social:begin' 'google-oauth2' %}?next={{ domain }}{{ request.path }}">Login with Google</a>
        {% endif %}

        {% if 'saml_auth' in PLUGINS_ENABLED %}
        <a class="social-button" id="saml-connect" href="{% url 'social:begin' 'saml' %}?next={{ request.path }};idp={{ AUTH_SAML_IDP }}">{{ AUTH_SAML_INSTITUTION }} Login</a>
        {% endif %}

        {% if 'ldap_auth' in PLUGINS_ENABLED %}
        <a class="social-button" id="ldap-login" href="{% url 'ldap_auth-login' %}?next={{ domain }}{{ request.path }}">Login with LDAP</a>
        {% endif %}

        {% if 'pam_auth' in PLUGINS_ENABLED %}
        <a class="social-button" id="saml-connect" href="{% url 'pam_auth-login' %}?next={{ domain }}{{ request.path }}">Login with Username (PAM)</a>
        {% endif %}

    {% endif %}
    </div>


</div>
{% endblock %}
{% block footer %}
{% include 'main/footer.html' %}
{% endblock %}
