2016-07-19 20:28:11 +02:00
|
|
|
<?php use PHPCensor\Helper\Lang; ?>
|
2014-12-02 17:26:55 +01:00
|
|
|
<script>
|
2016-07-21 17:20:34 +02:00
|
|
|
var PROJECT_ID = <?php print $project->getId(); ?>;
|
2017-03-23 13:53:24 +01:00
|
|
|
var PROJECT_ENVIRONMENT = '<?php print $environment; ?>';
|
2016-07-21 17:20:34 +02:00
|
|
|
var PROJECT_BRANCH = '<?php print $branch; ?>';
|
2016-12-28 15:26:22 +01:00
|
|
|
var PER_PAGE = <?php print $perPage; ?>;
|
2014-12-02 17:26:55 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="clearfix" style="margin-bottom: 20px;">
|
2016-07-21 17:20:34 +02:00
|
|
|
<a class="btn btn-default" href="<?php print APP_URL . 'project/edit/' . $project->getId(); ?>">
|
2015-10-08 17:33:01 +02:00
|
|
|
<?php Lang::out('edit_project'); ?>
|
|
|
|
</a>
|
|
|
|
|
2017-01-12 17:37:37 +01:00
|
|
|
<a class="btn btn-danger" id="delete-project">
|
2015-10-08 17:33:01 +02:00
|
|
|
<?php Lang::out('delete_project'); ?>
|
|
|
|
</a>
|
|
|
|
|
2014-12-02 17:26:55 +01:00
|
|
|
<div class="pull-right btn-group">
|
2017-01-15 16:35:42 +01:00
|
|
|
<?php if (!$project->getArchived()): ?>
|
2017-02-18 18:52:13 +01:00
|
|
|
<?php if($this->User()->getIsAdmin()): ?>
|
2017-03-23 13:53:24 +01:00
|
|
|
<div class="btn-group build-btn">
|
|
|
|
<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
|
|
|
|
<?php Lang::out('build_now_debug'); ?> <span class="caret"></span>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<ul class="dropdown-menu" role="menu">
|
|
|
|
<?php if(!empty($environments)): ?>
|
2017-04-01 06:32:39 +02:00
|
|
|
<?php foreach ($environments as $currentEnvironment) : ?>
|
|
|
|
<li <?php echo ($currentEnvironment == $environment) ? 'class="active"' : ''?>>
|
|
|
|
<a href="<?php echo APP_URL ?>project/build/<?php print $project->getId(); ?>/environment/<?php echo urlencode($currentEnvironment) ?>?debug=1">
|
|
|
|
<i class="fa fa-cog"></i><?php echo $currentEnvironment ?>
|
2017-03-23 13:53:24 +01:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<li class="divider"></li>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
2017-04-01 06:32:39 +02:00
|
|
|
<?php foreach ($branches as $currentBranch) : ?>
|
|
|
|
<li <?php echo ($currentBranch == $branch) ? 'class="active"' : ''?>>
|
|
|
|
<a href="<?php echo APP_URL ?>project/build/<?php print $project->getId(); ?>/branch/<?php echo urlencode($currentBranch) ?>?debug=1">
|
|
|
|
<i class="fa fa-code-fork"></i><?php echo $currentBranch ?>
|
2017-03-23 13:53:24 +01:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2017-02-18 18:52:13 +01:00
|
|
|
<?php endif; ?>
|
|
|
|
|
2017-03-23 13:53:24 +01:00
|
|
|
<div class="btn-group build-btn">
|
|
|
|
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown">
|
|
|
|
<?php Lang::out('build_now'); ?> <span class="caret"></span>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<ul class="dropdown-menu" role="menu">
|
|
|
|
<?php if(!empty($environments)): ?>
|
2017-04-01 06:32:39 +02:00
|
|
|
<?php foreach ($environments as $currentEnvironment) : ?>
|
|
|
|
<li <?php echo ($currentEnvironment == $environment) ? 'class="active"' : ''?>>
|
|
|
|
<a href="<?php echo APP_URL ?>project/build/<?php print $project->getId(); ?>/environment/<?php echo urlencode($currentEnvironment) ?>">
|
|
|
|
<i class="fa fa-cog"></i><?php echo $currentEnvironment ?>
|
2017-03-23 13:53:24 +01:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<li class="divider"></li>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
2017-04-01 06:32:39 +02:00
|
|
|
<?php foreach ($branches as $currentBranch) : ?>
|
|
|
|
<li <?php echo ($currentBranch == $branch) ? 'class="active"' : ''?>>
|
|
|
|
<a href="<?php echo APP_URL ?>project/build/<?php print $project->getId(); ?>/branch/<?php echo urlencode($currentBranch) ?>">
|
|
|
|
<i class="fa fa-code-fork"></i><?php echo $currentBranch ?>
|
2017-03-23 13:53:24 +01:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2017-01-15 16:35:42 +01:00
|
|
|
<?php endif; ?>
|
2014-12-02 17:26:55 +01:00
|
|
|
|
2017-03-23 13:53:24 +01:00
|
|
|
<div class="btn-group environment-btn pull-right">
|
2014-12-02 17:26:55 +01:00
|
|
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
2017-03-23 13:53:24 +01:00
|
|
|
<?php
|
|
|
|
if (!empty($environment)) {
|
|
|
|
print Lang::get('environment_x', $environment);
|
|
|
|
} elseif (!empty($branch)) {
|
|
|
|
print Lang::get('branch_x', $branch);
|
|
|
|
} else {
|
|
|
|
print Lang::get('All');
|
|
|
|
}
|
|
|
|
?> <span class="caret"></span>
|
2014-12-02 17:26:55 +01:00
|
|
|
</button>
|
|
|
|
|
|
|
|
<ul class="dropdown-menu" role="menu">
|
2017-03-23 13:53:24 +01:00
|
|
|
<li><a href="<?php echo APP_URL ?>project/view/<?php print $project->getId(); ?>"><?php Lang::out('all'); ?></a></li>
|
|
|
|
<li class="divider"></li>
|
|
|
|
|
|
|
|
<?php if(!empty($environments)): ?>
|
2017-04-01 06:32:39 +02:00
|
|
|
<?php foreach ($environments as $currentEnvironment) : ?>
|
|
|
|
<li <?php echo ($currentEnvironment == $environment) ? 'class="active"' : ''?>>
|
|
|
|
<a href="<?php echo APP_URL ?>project/view/<?php print $project->getId(); ?>?environment=<?php echo urlencode($currentEnvironment) ?>">
|
|
|
|
<i class="fa fa-cog"></i><?php echo $currentEnvironment ?>
|
2017-03-23 13:53:24 +01:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<li class="divider"></li>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
2017-04-01 06:32:39 +02:00
|
|
|
<?php foreach ($branches as $currentBranch) : ?>
|
|
|
|
<li <?php echo ($currentBranch == $branch) ? 'class="active"' : ''?>>
|
|
|
|
<a href="<?php echo APP_URL ?>project/view/<?php print $project->getId(); ?>?branch=<?php echo urlencode($currentBranch) ?>">
|
|
|
|
<i class="fa fa-code-fork"></i><?php echo $currentBranch ?>
|
2014-12-02 17:26:55 +01:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2014-09-16 13:27:32 +02:00
|
|
|
</div>
|
2014-12-02 17:26:55 +01:00
|
|
|
</div>
|
2014-04-30 15:13:07 +02:00
|
|
|
|
2013-05-10 13:28:43 +02:00
|
|
|
|
|
|
|
<div class="row">
|
2017-01-06 12:39:04 +01:00
|
|
|
<div class="col-lg-9 col-md-8 col-sm-8">
|
|
|
|
<div class="box">
|
2014-12-02 17:26:55 +01:00
|
|
|
<div class="box-header">
|
2015-02-28 18:13:02 +01:00
|
|
|
<h3 class="box-title"><?php Lang::out('builds'); ?> (<?php print $total; ?>)</h3>
|
2014-04-30 15:13:07 +02:00
|
|
|
</div>
|
2017-02-28 14:28:54 +01:00
|
|
|
<table class="table table-hover">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th><?php Lang::out('id'); ?></th>
|
|
|
|
<th><?php Lang::out('date'); ?></th>
|
|
|
|
<th class="hidden-md hidden-sm hidden-xs"><?php Lang::out('commit'); ?></th>
|
2017-03-23 13:53:24 +01:00
|
|
|
<th><?php Lang::out('environment'); ?></th>
|
2017-02-28 14:28:54 +01:00
|
|
|
<th><?php Lang::out('branch'); ?></th>
|
|
|
|
<th><?php Lang::out('status'); ?></th>
|
|
|
|
<th><?php Lang::out('duration'); ?></th>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody id="latest-builds">
|
|
|
|
<?php print $builds; ?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2014-04-30 15:13:07 +02:00
|
|
|
</div>
|
2017-02-28 14:28:54 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
print '<div><ul class="pagination">';
|
|
|
|
|
|
|
|
$project_url = APP_URL . 'project/view/' . $project->getId() . ((!empty($branch)) ? '/' . urlencode($branch) : '');
|
|
|
|
|
|
|
|
if ($page > 1) {
|
|
|
|
print '<li><a href="' . $project_url . '?p='.($page == 1 ? '1' : $page - 1).'">'.Lang::get('prev_link').'</a></li>';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($pages > 1) {
|
|
|
|
|
|
|
|
$start = $page - 3;
|
|
|
|
|
|
|
|
if ($start <= 0) {
|
|
|
|
$start = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
$end = $page + 3;
|
|
|
|
|
|
|
|
if ($end > $pages) {
|
|
|
|
$end = $pages;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($start > 1) {
|
|
|
|
print '<li><a href="' . $project_url . '">1...</a></li>';
|
|
|
|
}
|
|
|
|
|
|
|
|
for($i = $start; $i <= $end; $i++)
|
|
|
|
{
|
|
|
|
if ($pages > $end && $i == $pages) continue;
|
|
|
|
|
|
|
|
if ($i == $page) {
|
|
|
|
print '<li class="bg-blue"><span>' . $i . '</span></li>';
|
|
|
|
} else {
|
|
|
|
print '<li><a href="' . $project_url . '?p=' . $i . '">' . $i . '</a></li>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($pages > $end) {
|
|
|
|
print '<li><a href="' . $project_url . '?p='.$pages.'">...'.$pages.'</a></li>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($page < $pages - 1) {
|
|
|
|
print '<li><a href="' . $project_url . '?p='.($page == $pages ? $pages : $page + 1).'">'.Lang::get('next_link').'</a></li>';
|
|
|
|
}
|
|
|
|
|
|
|
|
print '</ul></div>';
|
|
|
|
|
|
|
|
?>
|
2017-01-06 12:39:04 +01:00
|
|
|
</div>
|
2014-12-02 17:26:55 +01:00
|
|
|
|
|
|
|
<div class="col-lg-3 col-md-4 col-sm-4">
|
2013-05-10 13:28:43 +02:00
|
|
|
|
2017-01-19 15:58:45 +01:00
|
|
|
<?php if ($project->getAllowPublicStatus() && !$project->getArchived()): ?>
|
2017-01-14 12:44:57 +01:00
|
|
|
<div class="box">
|
|
|
|
<div class="box-header">
|
|
|
|
<h4 class="box-title"><?= Lang::get('public_status_title'); ?></h4>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="box-body">
|
|
|
|
<span style="word-wrap: break-word;">
|
|
|
|
<a href="<?= APP_URL . 'build-status/view/' . $project->getId() . '?branch=master'; ?>">
|
|
|
|
<img src="<?= APP_URL . 'build-status/image/' . $project->getId() . '?branch=master&label=PHPCensor&style=flat-square'; ?>" />
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<br /><br />
|
|
|
|
<?= Lang::get('public_status_image'); ?>:<br /><strong><?= APP_URL . 'build-status/image/' . $project->getId() . '?branch=master&label=PHPCensor&style=flat-square'; ?></strong>
|
|
|
|
|
|
|
|
<br /><br />
|
|
|
|
<?= Lang::get('public_status_page'); ?>:<br /><strong><?= APP_URL . 'build-status/view/' . $project->getId() . '?branch=master'; ?></strong>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
2016-04-21 06:58:09 +02:00
|
|
|
<?php if (in_array($project->getType(), ['github', 'gitlab', 'bitbucket'])): ?>
|
2017-01-06 12:39:04 +01:00
|
|
|
<div class="box">
|
2014-12-02 17:26:55 +01:00
|
|
|
<div class="box-header">
|
2014-12-04 13:19:06 +01:00
|
|
|
<h4 class="box-title"><?php Lang::out('webhooks'); ?></h4>
|
2014-12-02 17:26:55 +01:00
|
|
|
</div>
|
2014-04-30 15:13:07 +02:00
|
|
|
|
2014-12-02 17:26:55 +01:00
|
|
|
<div class="box-body">
|
|
|
|
<?php
|
|
|
|
switch($project->getType())
|
|
|
|
{
|
|
|
|
case 'github':
|
2017-01-14 12:44:57 +01:00
|
|
|
$url = APP_URL . 'webhook/github/' . $project->getId();
|
2014-12-04 13:19:06 +01:00
|
|
|
Lang::out('webhooks_help_github', $project->getReference());
|
2014-12-02 17:26:55 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'gitlab':
|
2017-01-14 12:44:57 +01:00
|
|
|
$url = APP_URL. 'webhook/gitlab/' . $project->getId();
|
2014-12-04 13:19:06 +01:00
|
|
|
Lang::out('webhooks_help_gitlab');
|
2014-12-02 17:26:55 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'bitbucket':
|
2017-03-19 05:17:10 +01:00
|
|
|
case 'bitbuckethg':
|
2017-01-14 12:44:57 +01:00
|
|
|
$url = APP_URL . 'webhook/bitbucket/' . $project->getId();
|
2014-12-04 13:19:06 +01:00
|
|
|
Lang::out('webhooks_help_bitbucket', $project->getReference());
|
2014-12-02 17:26:55 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
?>
|
2014-12-04 13:19:06 +01:00
|
|
|
<br><br><strong style="word-wrap: break-word;"><?php print $url; ?></strong>
|
2014-12-02 17:26:55 +01:00
|
|
|
</div>
|
2014-04-30 15:13:07 +02:00
|
|
|
</div>
|
2014-05-01 19:00:46 +02:00
|
|
|
<?php endif; ?>
|
2014-04-30 15:13:07 +02:00
|
|
|
|
2014-05-14 10:27:41 +02:00
|
|
|
<?php if ($project->getSshPublicKey()): ?>
|
2017-01-06 12:39:04 +01:00
|
|
|
<div class="box">
|
2017-01-14 12:44:57 +01:00
|
|
|
<div class="box-header"><h3 class="box-title"><?php Lang::out('public_key'); ?></h3></div>
|
2014-12-13 09:42:55 +01:00
|
|
|
<div class="box-body" style="word-break: break-all;"><?php print $project->getSshPublicKey(); ?></div>
|
2014-04-30 15:13:07 +02:00
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
2014-12-02 17:26:55 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2014-09-16 13:27:32 +02:00
|
|
|
|
2017-01-12 17:37:37 +01:00
|
|
|
<script>
|
|
|
|
$(function() {
|
|
|
|
$('#delete-project').on('click', function (e) {
|
|
|
|
e.preventDefault();
|
2017-01-14 10:58:55 +01:00
|
|
|
confirmDelete("<?= APP_URL; ?>project/delete/<?= $project->getId(); ?>")
|
|
|
|
.onCloseConfirmed = function () {window.location = '/'};
|
2017-01-12 17:37:37 +01:00
|
|
|
});
|
|
|
|
})
|
|
|
|
</script>
|