{% extends '::base.html.twig' %}

{% block stylesheets %}
    {{ parent() }}

    {% stylesheets filter='?uglifycss'
    '@JotunheimrAdminBundle/Resources/public/js/vendor/bootstrap/css/bootstrap.min.css'
    '@MineSeekerBundle/Resources/public/css/style.homepage.css'
    '@JotunheimrUserBundle/Resources/public/css/layout.css' %}
    <link rel="stylesheet" media="screen" href="{{ asset_url }}"/>
    {% endstylesheets %}

    <link href="https://fonts.googleapis.com/css?family=Rajdhani:300,400,500,600,700&amp;subset=latin-ext"
          rel="stylesheet">
{% endblock %}

{% block bodyTop %}
    {% if app.request.hasPreviousSession %}
        {% for type, messages in app.session.flashbag.all() %}
            {% for message in messages %}
                <div class="flash-{{ type }}">
                    {{ message }}
                </div>
            {% endfor %}
        {% endfor %}
    {% endif %}
{% endblock %}

{% block header %}
    {% block fos_user_content %}{% endblock fos_user_content %}
{% endblock %}

{% block javascripts %}
    {{ parent() }}

    <script src="https://cdnjs.cloudflare.com/ajax/libs/JQuery-Snowfall/1.7.4/snowfall.jquery.min.js"
            type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $(document).snowfall({deviceorientation: true, round: true, minSize: 5, maxSize: 8});

            $('#fbLogin').length && $('#fbLogin').on('click', function () {
                FB.getLoginStatus(function (response) {
                    if (response.status === 'connected') {
                        document.location = "{{ url("hwi_oauth_service_redirect", {service: "facebook"}) }}";
                    } else {
                        FB.login(function (response) {
                            if (response.authResponse) {
                                document.location = "{{ url("hwi_oauth_service_redirect", {service: "facebook"}) }}";
                            }
                        }, {scope: '{{ facebook_scope }}'});
                    }
                });
            });
        });
    </script>
{% endblock %}
