hydra/src/root/overview.tt

73 lines
2.1 KiB
Plaintext
Raw Normal View History

2013-02-20 14:54:33 +00:00
[% WRAPPER layout.tt title="Overview" hideHeader=1 %]
[% PROCESS common.tt %]
[% IF newsItems.size != 0 %]
2013-05-07 15:04:42 +00:00
<div class="alert alert-info">
[% FOREACH i IN newsItems %]
<div class="news-item">
[% contents = String.new(i.contents) %]
<h4 class="alert-heading">[% INCLUDE renderDateTime timestamp=i.createtime %] by [% i.author.fullname %]</h4>
[% contents.replace('\n','<br />\n') %]
</div>
[% END %]
</div>
[% END %]
2013-11-06 13:11:56 +00:00
<div class="page-header">Projects</div>
2013-11-06 11:05:56 +00:00
[% IF projects.size != 0 %]
<script type="text/javascript">
function showProjects() {
var showDisabled = $('#show-disabled').hasClass('active');
$('tr.project').map(function() {
var hide =
($(this).hasClass('disabled-project') && !showDisabled);
if (hide) $(this).hide(); else $(this).show();
});
return false;
};
$(document).ready(function() {
$('#show-disabled').on('click', function(e) {
$(this).toggleClass('active');
showProjects();
return false;
});
showProjects();
});
</script>
<p>The following projects are hosted on this server:
<label id="show-disabled" class="btn btn-secondary btn-sm float-right" data-toggle="button">Show disabled projects</label>
</p>
<table class="table table-condensed table-striped clickable-rows">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
[% FOREACH p IN projects %]
<tr class="project [% IF !p.enabled %]disabled-project[% END %]">
<td><span class="[% IF !p.enabled %]disabled-project[% END %] [%+ IF p.hidden %]hidden-project[% END %]">[% INCLUDE renderProjectName project=p.name inRow=1 %]</span></td>
<td>[% HTML.escape(p.displayname) %]</td>
<td>[% WRAPPER maybeLink uri=p.homepage %][% HTML.escape(p.description) %][% END %]</td>
</tr>
[% END %]
</tbody>
</table>
2013-11-06 11:05:56 +00:00
[% ELSE %]
<div class="alert alert-warning">Hydra has no projects yet. Please
<a href="[% c.uri_for(c.controller('Project').action_for('create')) %]">create a project</a>.</div>
[% END %]
[% END %]