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(); ?>;
|
|
|
|
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">
|
2016-07-21 17:20:34 +02:00
|
|
|
<a class="btn btn-success" href="<?php print APP_URL . 'project/build/' . $project->getId(); ?><?php echo !empty($branch) ? '/' . urlencode($branch) : '' ?>">
|
2014-12-04 13:19:06 +01:00
|
|
|
<?php Lang::out('build_now'); ?>
|
|
|
|
</a>
|
2014-12-02 17:26:55 +01:00
|
|
|
|
|
|
|
<div class="btn-group branch-btn pull-right">
|
|
|
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
2014-12-04 13:19:06 +01:00
|
|
|
<?php print !empty($branch) ? Lang::get('branch_x', $branch) : Lang::get('branch'); ?> <span class="caret"></span>
|
2014-12-02 17:26:55 +01:00
|
|
|
</button>
|
|
|
|
|
|
|
|
<ul class="dropdown-menu" role="menu">
|
|
|
|
<?php foreach ($branches as $curbranch) : ?>
|
|
|
|
<li <?php echo ($curbranch == $branch) ? 'class="active"' : ''?>>
|
2016-07-21 17:20:34 +02:00
|
|
|
<a href="<?php echo APP_URL ?>project/view/<?php print $project->getId(); ?>?branch=<?php echo urlencode($curbranch) ?>">
|
2014-12-02 17:26:55 +01:00
|
|
|
<?php echo $curbranch ?>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
|
|
|
<li class="divider"></li>
|
2016-07-21 17:20:34 +02:00
|
|
|
<li><a href="<?php echo APP_URL ?>project/view/<?php print $project->getId(); ?>"><?php Lang::out('all_branches'); ?></a></li>
|
2014-12-02 17:26:55 +01:00
|
|
|
</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-01-06 12:39:04 +01:00
|
|
|
<table class="table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th><?php Lang::out('id'); ?></th>
|
2015-02-28 18:38:56 +01:00
|
|
|
<th><?php Lang::out('date'); ?></th>
|
2017-01-06 12:39:04 +01:00
|
|
|
<th><?php Lang::out('project'); ?></th>
|
|
|
|
<th class="hidden-md hidden-sm hidden-xs"><?php Lang::out('commit'); ?></th>
|
|
|
|
<th><?php Lang::out('branch'); ?></th>
|
|
|
|
<th><?php Lang::out('status'); ?></th>
|
2017-01-12 17:37:37 +01:00
|
|
|
<th></th>
|
2017-01-06 12:39:04 +01:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody id="latest-builds">
|
|
|
|
<?php print $builds; ?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2014-04-30 15:13:07 +02:00
|
|
|
</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
|
|
|
|
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':
|
2016-07-21 17:20:34 +02: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':
|
2016-07-21 17:20:34 +02: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':
|
2016-07-21 17:20:34 +02: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">
|
2014-12-04 13:19:06 +01:00
|
|
|
<div class="box-header"><h3 class="box-title"><a data-toggle="collapse" data-parent="#accordion" href="#publicCollapse"><?php Lang::out('public_key'); ?></a></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
|
|
|
|
2014-12-02 17:26:55 +01:00
|
|
|
<?php
|
2014-09-16 13:27:32 +02:00
|
|
|
|
2014-12-02 17:26:55 +01:00
|
|
|
print '<div><ul class="pagination">';
|
2014-09-16 13:27:32 +02:00
|
|
|
|
2016-07-21 17:20:34 +02:00
|
|
|
$project_url = APP_URL . 'project/view/' . $project->getId() . ((!empty($branch)) ? '/' . urlencode($branch) : '');
|
2014-09-16 13:27:32 +02:00
|
|
|
|
2014-12-02 17:26:55 +01:00
|
|
|
if ($page > 1) {
|
2014-12-04 13:19:06 +01:00
|
|
|
print '<li><a href="' . $project_url . '?p='.($page == 1 ? '1' : $page - 1).'">'.Lang::get('prev_link').'</a></li>';
|
2014-12-02 17:26:55 +01:00
|
|
|
}
|
2014-09-16 13:27:32 +02:00
|
|
|
|
2014-12-02 17:26:55 +01:00
|
|
|
if ($pages > 1) {
|
2014-04-30 15:13:07 +02:00
|
|
|
|
2014-12-02 17:26:55 +01:00
|
|
|
$start = $page - 3;
|
2014-04-30 15:13:07 +02:00
|
|
|
|
2014-12-02 17:26:55 +01:00
|
|
|
if ($start <= 0) {
|
|
|
|
$start = 1;
|
|
|
|
}
|
2013-05-10 13:28:43 +02:00
|
|
|
|
2014-12-02 17:26:55 +01:00
|
|
|
$end = $page + 3;
|
2014-09-16 13:27:32 +02:00
|
|
|
|
2014-12-02 17:26:55 +01:00
|
|
|
if ($end > $pages) {
|
|
|
|
$end = $pages;
|
|
|
|
}
|
2013-05-10 13:28:43 +02:00
|
|
|
|
2014-12-02 17:26:55 +01:00
|
|
|
if ($start > 1) {
|
|
|
|
print '<li><a href="' . $project_url . '">1...</a></li>';
|
|
|
|
}
|
2013-05-10 13:28:43 +02:00
|
|
|
|
2014-12-02 17:26:55 +01:00
|
|
|
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>';
|
2014-04-30 15:13:07 +02:00
|
|
|
}
|
2014-12-02 17:26:55 +01:00
|
|
|
}
|
2013-05-10 13:28:43 +02:00
|
|
|
|
2014-12-02 17:26:55 +01:00
|
|
|
if ($pages > $end) {
|
|
|
|
print '<li><a href="' . $project_url . '?p='.$pages.'">...'.$pages.'</a></li>';
|
|
|
|
}
|
|
|
|
}
|
2013-05-10 13:28:43 +02:00
|
|
|
|
2014-12-02 17:26:55 +01:00
|
|
|
if ($page < $pages - 1) {
|
2014-12-04 13:19:06 +01:00
|
|
|
print '<li><a href="' . $project_url . '?p='.($page == $pages ? $pages : $page + 1).'">'.Lang::get('next_link').'</a></li>';
|
2014-12-02 17:26:55 +01:00
|
|
|
}
|
2013-05-10 13:28:43 +02:00
|
|
|
|
2014-12-02 17:26:55 +01:00
|
|
|
print '</ul></div>';
|
|
|
|
|
2015-04-21 14:16:25 +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>
|