Use redirectJSON

This commit is contained in:
Eelco Dolstra 2013-10-14 17:35:14 +02:00
parent c4e39d4769
commit 854d419b2c
2 changed files with 4 additions and 10 deletions

View file

@ -174,17 +174,14 @@
}); });
$("#submit-jobset").click(function() { $("#submit-jobset").click(function() {
requestJSON({ redirectJSON({
[% IF create || clone %] [% IF create || clone %]
url: "[% c.uri_for('/jobset' project.name '.new') %]", url: "[% c.uri_for('/jobset' project.name '.new') %]",
[% ELSE %] [% ELSE %]
url: "[% c.uri_for('/jobset' project.name jobset.name) %]", url: "[% c.uri_for('/jobset' project.name jobset.name) %]",
[% END %] [% END %]
data: $(this).parents("form").serialize(), data: $(this).parents("form").serialize(),
type: 'PUT', type: 'PUT'
success: function(data) {
window.location = data.redirect;
},
}); });
return false; return false;
}); });

View file

@ -66,17 +66,14 @@
<script type="text/javascript"> <script type="text/javascript">
$("#submit-project").click(function() { $("#submit-project").click(function() {
requestJSON({ redirectJSON({
[% IF create %] [% IF create %]
url: "[% c.uri_for('/project' '.new') %]", url: "[% c.uri_for('/project' '.new') %]",
[% ELSE %] [% ELSE %]
url: "[% c.uri_for('/project' project.name) %]", url: "[% c.uri_for('/project' project.name) %]",
[% END %] [% END %]
data: $(this).parents("form").serialize(), data: $(this).parents("form").serialize(),
type: 'PUT', type: 'PUT'
success: function(data) {
window.location = data.redirect;
},
}); });
return false; return false;
}); });