hydra/src/root/project.tt
Eelco Dolstra affec8881d Remove support for views
They're replaced by aggregates, which are declarative, faster, and
have a better interface.
2014-04-23 23:22:44 +02:00

116 lines
3.3 KiB
Plaintext

[% 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()" %]
[% INCLUDE menuItem title="Create jobset" icon="icon-plus" uri=c.uri_for(c.controller('Project').action_for('create_jobset'), c.req.captures) %]
[% 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">
<div id="tabs-project" class="tab-pane active">
[% IF project.jobsets %]
<p>This project has the following jobsets:</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 %]