Use redirectJSON
This commit is contained in:
parent
c4e39d4769
commit
854d419b2c
|
@ -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;
|
||||||
});
|
});
|
||||||
|
|
|
@ -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;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue