Use the REST API in the web interface for editing jobsets

This commit is contained in:
Eelco Dolstra
2013-10-03 18:49:37 +02:00
parent 63062f7bba
commit 232f46c750
5 changed files with 93 additions and 158 deletions

View File

@ -57,23 +57,6 @@
<button id="submit-project" type="submit" class="btn btn-primary">
<i class="icon-ok icon-white"></i>
[%IF create %]Create[% ELSE %]Apply changes[% END %]
<script type="text/javascript">
$("#submit-project").click(function() {
requestJSON({
[% IF create %]
url: "[% c.uri_for('/project' '.new') %]",
[% ELSE %]
url: "[% c.uri_for('/project' project.name) %]",
[% END %]
data: $(this).parents("form").serialize(),
type: 'PUT',
success: function(data) {
window.location = data.redirect;
},
});
return false;
});
</script>
</button>
</div>
@ -81,4 +64,23 @@
</form>
<script type="text/javascript">
$("#submit-project").click(function() {
requestJSON({
[% IF create %]
url: "[% c.uri_for('/project' '.new') %]",
[% ELSE %]
url: "[% c.uri_for('/project' project.name) %]",
[% END %]
data: $(this).parents("form").serialize(),
type: 'PUT',
success: function(data) {
window.location = data.redirect;
},
});
return false;
});
</script>
[% END %]