phpci/PHPCI/View/Settings/index.phtml
2013-11-18 22:47:44 +01:00

69 lines
2.5 KiB
PHTML

<?php if (isset($_GET['saved']) && $_GET['saved'] == 1): ?>
<p class="alert alert-success" style="margin-bottom: 20px;">
Your settings have been saved.
</p>
<?php endif; ?>
<?php if (isset($_GET['saved']) && $_GET['saved'] == 2): ?>
<p class="alert alert-danger" style="margin-bottom: 20px;">
Your settings could not be saved, maybe check the permissions of config.yml?
</p>
<?php endif; ?>
<?php if (isset($_GET['linked']) && $_GET['linked'] == 1): ?>
<p class="alert alert-success" style="margin-bottom: 20px;">
Your Github account has been linked.
</p>
<?php endif; ?>
<?php if (isset($_GET['linked']) && $_GET['linked'] == 2): ?>
<p class="alert alert-danger" style="margin-bottom: 20px;">
Your Github account could not be linked.
</p>
<?php endif; ?>
<div class="box">
<div class="row">
<div class="col-lg-12">
<h3 class="title">Github Application</h3>
<?php
$id = $settings['phpci']['github']['id'];
$returnTo = PHPCI_URL . 'settings/github-callback';
$githubUri = 'https://github.com/login/oauth/authorize?client_id='.$id.'&scope=repo&redirect_uri=' . $returnTo;
?>
<?php if (!empty($id) && empty($settings['phpci']['github']['token'])): ?>
<p class="alert alert-warning clearfix">
Before you can start using Github, you need to <a href="<?= $githubUri; ?>">sign in</a> and grant PHPCI access to your account.
</p>
<?php endif; ?>
<?php if (!empty($id) && !empty($settings['phpci']['github']['token'])): ?>
<p class="alert alert-success">
PHPCI is successfully linked to Github account
<strong>
<a href="<?= $githubUser['html_url']; ?>"><?= $githubUser['name']; ?></a>
</strong>
</p>
<?php endif; ?>
</div>
<div class="col-lg-8">
<?php print $github; ?>
</div>
<div class="col-lg-4">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Where to find these...</h3>
</div>
<div class="panel-body">
<p>If you own the application you would like to use, you can find this information within your
<a href="https://github.com/settings/applications">applications</a> settings area.</p>
</div>
</div>
</div>
</div>
</div>