phpci/PHPCI/View/Settings/index.phtml

124 lines
4 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 (!$isWriteable): ?>
<p class="alert alert-danger" style="margin-bottom: 20px;">
PHPCI cannot write to your config.yml file, settings may not be saved properly until this is rectified.
</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 = null;
if (isset($settings['phpci']['github']['id'])) {
$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="<?php echo $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="<?php echo $githubUser['html_url']; ?>"><?php echo $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>
<div class="box">
<div class="row">
<div class="col-lg-12">
<h3 class="title">Email Settings</h3>
<?php if (!isset($settings['phpci']['email_settings'])): ?>
<p class="alert alert-warning clearfix">
Before PHPCI can send build status emails, you need to configure your SMTP settings below.
</p>
<?php endif; ?>
</div>
<div class="col-lg-8">
<?php print $emailSettings; ?>
</div>
<div class="col-lg-4">
<!-- nothing -->
</div>
</div>
</div>
<div class="box">
<div class="row">
<div class="col-lg-12">
<h3 class="title">Authentication Settings</h3>
<p class="alert alert-warning clearfix">
Be careful: This setting disables authentication and uses your preconfigured admin account for all actions within phpci with admin rights.
</p>
</div>
<div class="col-lg-8">
<?php print $authenticationSettings; ?>
</div>
<div class="col-lg-4">
<!-- nothing -->
</div>
</div>
</div>