<div class="box-panel margin-top">
    <div class="box-panel-title"><?= __('Social login') ?></div>
    <div class="box-panel-content">
        <?= flash_error_message() ?>

        <p class="text-center">
            <?= __('You can link service accounts and social networks to facilitate your access to %s', [config('server.name')]) ?>
        </p>

        <div class="social-connect">
            <?php foreach (['facebook', 'google'] as $provider): ?>
                <?php if (config('sn.' . $provider . '.login', false)): ?>
                    <div class="provider">
                        <div class="logo">
                            <img alt="<?= $provider ?>" src="<?= asset_to('SocialNetwork./images/' . $provider . '.png') ?>" />
                        </div>

                        <div class="actions">
                            <?php if (empty($login[$provider . '_id'])): ?>
                                <a class="btn" href="<?= url_to('/social/connect/' . $provider) ?>"><?= __('Connect') ?></a>
                            <?php else: ?>
                                <a class="btn" data-ajax-action data-confirm="<?= __('Are you sure you want to disconnect?') ?>" href="<?= url_to('/social/disconnect/' . $provider) ?>"><?= __('Disconnect') ?></a>
                            <?php endif ?>
                        </div>
                    </div>
                <?php endif ?>
            <?php endforeach ?>
        </div>
    </div>
</div>
