Use the REST API in the web interface for editing projects

This commit is contained in:
Eelco Dolstra
2013-10-03 17:23:41 +02:00
parent 8355dc57ee
commit ae13dd3e67
4 changed files with 84 additions and 55 deletions

View File

@ -9,7 +9,8 @@
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
[% INCLUDE menuItem uri = c.uri_for('/project' project.name 'edit') title="Edit configuration" %]
<li><a href="[% c.uri_for('/project' project.name 'edit') %]"><i class="icon-edit icon-black"></i> Edit configuration</a></li>
<li><a href="javascript:deleteProject()"><i class="icon-trash icon-black"></i> Delete this project</a></li>
[% INCLUDE menuItem uri = c.uri_for(c.controller('Project').action_for('create_jobset'), [project.name]) title = "Create jobset" %]
[% INCLUDE menuItem uri = c.uri_for('/project' project.name 'create-release') title = "Create release" %]
</ul>
@ -94,7 +95,6 @@
</div>
<div id="tabs-configuration" class="tab-pane">
<a class="btn pull-right" href="[% c.uri_for('/project' project.name "edit") %]"><i class="icon-edit"></i> Edit</a>
<table class="info-table">
<tr>
<th>Display name:</th>
@ -186,4 +186,18 @@
</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 %]