forked from lix-project/hydra
145 lines
4.3 KiB
Text
145 lines
4.3 KiB
Text
[% WRAPPER layout.tt title="Project $project.name" %]
|
|
[% PROCESS common.tt %]
|
|
|
|
<ul class="nav nav-tabs">
|
|
[% IF c.user_exists %]
|
|
<li class="dropdown">
|
|
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
|
Actions
|
|
<b class="caret"></b>
|
|
</a>
|
|
<ul class="dropdown-menu">
|
|
[% INCLUDE menuItem title="Edit configuration" icon="icon-edit" uri=c.uri_for(c.controller('Project').action_for('edit'), c.req.captures) %]
|
|
[% INCLUDE menuItem title="Delete this project" icon="icon-trash" uri="javascript:deleteProject()" %]
|
|
[% UNLESS project.declfile %]
|
|
[% INCLUDE menuItem title="Create jobset" icon="icon-plus" uri=c.uri_for(c.controller('Project').action_for('create_jobset'), c.req.captures) %]
|
|
[% END %]
|
|
[% INCLUDE menuItem title="Create release" icon="icon-plus" uri=c.uri_for(c.controller('Project').action_for('create_release'), c.req.captures) %]
|
|
</ul>
|
|
</li>
|
|
[% END %]
|
|
|
|
<li class="active"><a href="#tabs-project" data-toggle="tab">Jobsets</a></li>
|
|
<li><a href="#tabs-configuration" data-toggle="tab">Configuration</a></li>
|
|
<li><a href="#tabs-releases" data-toggle="tab">Releases</a></li>
|
|
</ul>
|
|
|
|
<div class="tab-content">
|
|
|
|
<script type="text/javascript">
|
|
function showJobsets() {
|
|
var showHidden = $('#show-hidden').hasClass('active');
|
|
var showDisabled = $('#show-disabled').hasClass('active');
|
|
$('tr.jobset').map(function() {
|
|
var hide =
|
|
($(this).hasClass('hidden-jobset') && !showHidden) ||
|
|
($(this).hasClass('disabled-jobset') && !showDisabled);
|
|
if (hide) $(this).hide(); else $(this).show();
|
|
});
|
|
return false;
|
|
};
|
|
|
|
$(document).ready(function() {
|
|
$('#show-hidden, #show-disabled').on('click', function(e) {
|
|
$(this).toggleClass('active');
|
|
showJobsets();
|
|
return false;
|
|
});
|
|
|
|
showJobsets();
|
|
});
|
|
</script>
|
|
|
|
<div id="tabs-project" class="tab-pane active">
|
|
[% IF project.jobsets %]
|
|
<p>This project has the following jobsets:
|
|
<label id="show-disabled" class="btn btn-small pull-right" data-toggle="button">Show disabled jobsets</label>
|
|
[% IF isProjectOwner %]
|
|
<label id="show-hidden" class="btn btn-small pull-right" data-toggle="button">Show hidden jobsets</label>
|
|
[% END %]
|
|
</p>
|
|
[% INCLUDE renderJobsetOverview %]
|
|
[% ELSE %]
|
|
<p>No jobsets have been defined yet.</p>
|
|
[% END %]
|
|
</div>
|
|
|
|
<div id="tabs-configuration" class="tab-pane">
|
|
<table class="info-table">
|
|
<tr>
|
|
<th>Display name:</th>
|
|
<td>[% HTML.escape(project.displayname) %]</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Description:</th>
|
|
<td>[% HTML.escape(project.description) %]</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Homepage:</th>
|
|
<td>
|
|
[% IF project.homepage %]
|
|
<a [% HTML.attributes(href => project.homepage) %]>[% HTML.escape(project.homepage) %]</a>
|
|
[% ELSE %]
|
|
<em>(not specified)</em>
|
|
[% END %]
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Owner:</th>
|
|
<td><tt>[% HTML.escape(project.owner.username) %]</tt></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Enabled:</th>
|
|
<td>[% project.enabled ? "Yes" : "No" %]</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div id="tabs-releases" class="tab-pane">
|
|
|
|
[% IF releases.size == 0 %]
|
|
|
|
<p><em>This project has no releases yet.</em></p>
|
|
|
|
[% ELSE %]
|
|
|
|
<p>This project has made the following releases:</p>
|
|
|
|
<table class="table table-condensed table-striped clickable-rows">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Date</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
[% FOREACH release IN releases %]
|
|
<tr>
|
|
<td><a class="row-link" href="[% c.uri_for('/release' project.name release.name) %]"><tt>[% release.name %]</tt></a></td>
|
|
<td>[% INCLUDE renderDateTime timestamp = release.timestamp %]</td>
|
|
</tr>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
|
|
[% END %]
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
function deleteProject() {
|
|
bootbox.confirm(
|
|
'Are you sure you want to delete this project?',
|
|
function(c) {
|
|
if (!c) return;
|
|
redirectJSON({
|
|
url: "[% c.uri_for('/project' project.name) %]",
|
|
type: 'DELETE'
|
|
});
|
|
});
|
|
};
|
|
</script>
|
|
|
|
[% END %]
|