<div class="container-fluid">
    <div class="block-header">
        <h2>Settings > Social Login Settings</h2>
    </div>
    <!-- Vertical Layout -->
    <div class="row">
        <div class="col-lg-3 col-md-3">
            <div class="card">
                <div class="header">
                    <h2>Social Login Settings</h2>
                </div>
                <div class="body">
                    <div class="alert alert-success login-settings-alert"></div>
                    <form class="login-settings" method="POST">
                        <label for="fb_login">Facebook</label>
                        <div class="form-group">
                            <input type="radio" name="fb_login" id="fb_login-enabled" value="on" <?php echo ($pt->config->fb_login == 'on') ? 'checked': '';?>>
                            <label for="fb_login-enabled">Enabled</label>
                            <input type="radio" name="fb_login" id="fb_login-disabled" value="off" <?php echo ($pt->config->fb_login == 'off') ? 'checked': '';?>>
                            <label for="fb_login-disabled" class="m-l-20">Disabled</label>
                        </div>
                        <label for="tw_login">Twitter</label>
                        <div class="form-group">
                            <input type="radio" name="tw_login" id="tw_login-enabled" value="on" <?php echo ($pt->config->tw_login == 'on') ? 'checked': '';?>>
                            <label for="tw_login-enabled">Enabled</label>
                            <input type="radio" name="tw_login" id="tw_login-disabled" value="off" <?php echo ($pt->config->tw_login == 'off') ? 'checked': '';?>>
                            <label for="tw_login-disabled" class="m-l-20">Disabled</label>
                        </div>
                        <label for="plus_login">Google+</label>
                        <div class="form-group">
                            <input type="radio" name="plus_login" id="plus_login-enabled" value="on" <?php echo ($pt->config->plus_login == 'on') ? 'checked': '';?>>
                            <label for="plus_login-enabled">Enabled</label>
                            <input type="radio" name="plus_login" id="plus_login-disabled" value="off" <?php echo ($pt->config->plus_login == 'off') ? 'checked': '';?>>
                            <label for="plus_login-disabled" class="m-l-20">Disabled</label>
                        </div>
                        <label for="wowonder_login">WoWonder (Your Own Site) <a href="#" data-toggle="modal" data-target="#wowonder">?</a></label>
                        <div class="form-group">
                            <input type="radio" name="wowonder_login" id="wowonder_login-enabled" value="on" <?php echo ($pt->config->wowonder_login == 'on') ? 'checked': '';?>>
                            <label for="wowonder_login-enabled">Enabled</label>
                            <input type="radio" name="wowonder_login" id="wowonder_login-disabled" value="off" <?php echo ($pt->config->wowonder_login == 'off') ? 'checked': '';?>>
                            <label for="wowonder_login-disabled" class="m-l-20">Disabled</label>
                        </div>
                        <button type="submit" class="btn btn-primary m-t-15 waves-effect">Save</button>
                    </form>
                </div>
            </div>
        </div>
        <div class="col-lg-9 col-md-9">
            <div class="card">
                <div class="header">
                    <h2>API Keys</h2>
                </div>
                <div class="body">
                    <div class="alert alert-success api-settings-alert"></div>
                    <form class="api-settings" method="POST">
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="facebook_app_ID" name="facebook_app_ID" class="form-control" value="{{CONFIG facebook_app_ID}}">
                                <label class="form-label">Facebook API ID</label>
                            </div>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="facebook_app_key" name="facebook_app_key" class="form-control" value="{{CONFIG facebook_app_key}}">
                                <label class="form-label">Facebook API Key</label>
                            </div>
                        </div>
                        <br>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="twitter_app_ID" name="twitter_app_ID" class="form-control" value="{{CONFIG twitter_app_ID}}">
                                <label class="form-label">Twitter API ID</label>
                            </div>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="twitter_app_key" name="twitter_app_key" class="form-control" value="{{CONFIG twitter_app_key}}">
                                <label class="form-label">Twitter API Key</label>
                            </div>
                        </div>
                        <br>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="google_app_ID" name="google_app_ID" class="form-control" value="{{CONFIG google_app_ID}}">
                                <label class="form-label">Google API ID</label>
                            </div>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="google_app_key" name="google_app_key" class="form-control" value="{{CONFIG google_app_key}}">
                                <label class="form-label">Google API Key</label>
                            </div>
                        </div>
                        <br>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="wowonder_app_ID" name="wowonder_app_ID" class="form-control" value="{{CONFIG wowonder_app_ID}}">
                                <label class="form-label">WoWonder API Key</label>
                            </div>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="wowonder_app_key" name="wowonder_app_key" class="form-control" value="{{CONFIG wowonder_app_key}}">
                                <label class="form-label">WoWonder API Secret</label>
                            </div>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="wowonder_domain_uri" name="wowonder_domain_uri" class="form-control" value="{{CONFIG wowonder_domain_uri}}">
                                <label class="form-label">WoWonder Domain <small>The domain of your website that uses WoWonder Social Network</small></label>
                            </div>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input type="text" id="wowonder_img" name="wowonder_img" class="form-control" value="{{CONFIG wowonder_img}}">
                                <label class="form-label">WoWonder Icon <small>Link to your icon, example: <a href="https://demo.wowonder.com/themes/default/img/icon.png">https://demo.wowonder.com/themes/default/img/icon.png</a></small></label>
                            </div>
                        </div>
                        <button type="submit" class="btn btn-primary m-t-15 waves-effect">Save</button>
                    </form>
                </div>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
    <!-- #END# Vertical Layout -->
<div id="wowonder" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">WoWonder Integration</h4>
      </div>
      <div class="modal-body">
        <p>This feature allows you to integrate users from your own website that uses <a href="http://www.wowonder.com" target="_blank">WoWonder</a>.</p>
        <p>To get started please follow those steps:</p>
        <ul>
            <li>Go to http://yoursite.com/developers, you'll get the following <a target="_blank" href="<?php echo PT_LoadAdminLink('images/Screenshot_1.png'); ?>">Page</a></li>
            <li>Click on "Create an app", and fill the required information.</li>
            <li>On the form, make sure the info are similar as shown <a target="_blank" href="<?php echo PT_LoadAdminLink('images/Screenshot_2.png'); ?>">Here</a>.</li>
            <li>Save the form, get the <a  target="_blank" href="<?php echo PT_LoadAdminLink('images/Screenshot_4.png'); ?>">Keys</a>, and use them <a target="_blank" href="<?php echo PT_LoadAdminLink('images/Screenshot_3.png'); ?>">Here</a>.</li>
        </ul>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>

  </div>
</div>
<style>
.modal-body img {
    max-width: 100%;
}
</style>
<script>
$(function() {
    var form_login_settings = $('form.login-settings');

    form_login_settings.ajaxForm({
        url: '{{LINK aj/ap/save-settings}}',
        beforeSend: function() {
            form_login_settings.find('button').text("{{LANG please_wait}}");
        },
        success: function(data) {
            if (data.status == 200) {
            	form_login_settings.find('button').text('Save');
            	$('.login-settings-alert').html('<i class="fa fa-check"></i> Settings updated successfully');
            	setTimeout(function () {
            		$('.login-settings-alert').empty();
            	}, 2000);
            }
        }
    });

    var form_api_settings = $('form.api-settings');

    form_api_settings.ajaxForm({
        url: '{{LINK aj/ap/save-settings}}',
        beforeSend: function() {
            form_api_settings.find('button').text("{{LANG please_wait}}");
        },
        success: function(data) {
            if (data.status == 200) {
            	form_api_settings.find('button').text('Save');
            	$('.api-settings-alert').html('<i class="fa fa-check"></i> Settings updated successfully');
            	setTimeout(function () {
            		$('.api-settings-alert').empty();
            	}, 2000);
            }
        }
    });
});
</script>