Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakozak2011-11-25 05:38:02 -0500
committerWinston Prakash2011-12-01 20:47:37 -0500
commitbf4f6110b1facba137021e52b379342e194a7176 (patch)
treefaf88225260125e8e17d5cf8bd7bf07d5df5575b /hudson-core/src/main/resources/hudson
parent41b1e17985ecfd3b4d68c0cce4afa8c15f14a35b (diff)
downloadorg.eclipse.hudson.core-bf4f6110b1facba137021e52b379342e194a7176.tar.gz
org.eclipse.hudson.core-bf4f6110b1facba137021e52b379342e194a7176.tar.xz
org.eclipse.hudson.core-bf4f6110b1facba137021e52b379342e194a7176.zip
Block deleting external job if it has cascading children. Introduce cascadingJobDeleteForm.jelly tag
Signed-off-by: Winston Prakash <winston.prakash@gmail.com>
Diffstat (limited to 'hudson-core/src/main/resources/hudson')
-rw-r--r--hudson-core/src/main/resources/hudson/model/AbstractProject/deleteConfirmationPanel.jelly45
-rw-r--r--hudson-core/src/main/resources/hudson/model/ExternalJob/deleteConfirmationPanel.jelly10
-rw-r--r--hudson-core/src/main/resources/hudson/model/ExternalJob/sidepanel.jelly2
3 files changed, 6 insertions, 51 deletions
diff --git a/hudson-core/src/main/resources/hudson/model/AbstractProject/deleteConfirmationPanel.jelly b/hudson-core/src/main/resources/hudson/model/AbstractProject/deleteConfirmationPanel.jelly
index 9b669c1a..7b79e51d 100644
--- a/hudson-core/src/main/resources/hudson/model/AbstractProject/deleteConfirmationPanel.jelly
+++ b/hudson-core/src/main/resources/hudson/model/AbstractProject/deleteConfirmationPanel.jelly
@@ -15,46 +15,5 @@
#************************************************************************** -->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
- <script type="text/javascript">
- function onDeleteClick() {
- jQuery.ajax({
- url: "${rootUrl}/${it.url}api/json",
- dataType: 'json',
- cache: false,
- success: function(data) {
- jQuery('#confirmDialog').show();
- jQuery('#childrenList').hide();
- var cascadingChildren = data.cascadingChildrenNames;
- if (cascadingChildren.length != 0) {
- var jobList = jQuery("#jobList");
- jobList.html("");
- cascadingChildren.sort();
- for (var i = 0; i &lt; cascadingChildren.length; i++) {
- jobList.append("<li>" + cascadingChildren[i] + "</li>");
- }
- jQuery('#confirmDialog').hide();
- jQuery('#childrenList').show();
- }
- }
- });
- onLinkClick("question");
- }
- </script>
-
- <div>
- <form method="post" action="doDelete" id="deleteForm">
- <div id="confirmDialog">
- <h4>Are you sure you want to delete the Job?.</h4>
- <input type="submit" class="yes" value="${%Yes}"/>
- <input type="button" class="no" value="${%No}"/>
- </div>
- <div id="childrenList" class="deleteJobDialog" style="display:none">
- <h4>${%You can't delete this job because it has cascading children:}</h4>
- <ul id="jobList">
- </ul>
- <input type="button" class="no" value="${%Ok}" />
- </div>
- </form>
- </div>
-
-</j:jelly>
+ <l:jobDeleteForm />
+</j:jelly> \ No newline at end of file
diff --git a/hudson-core/src/main/resources/hudson/model/ExternalJob/deleteConfirmationPanel.jelly b/hudson-core/src/main/resources/hudson/model/ExternalJob/deleteConfirmationPanel.jelly
index 2b16fc94..8bf592a1 100644
--- a/hudson-core/src/main/resources/hudson/model/ExternalJob/deleteConfirmationPanel.jelly
+++ b/hudson-core/src/main/resources/hudson/model/ExternalJob/deleteConfirmationPanel.jelly
@@ -15,10 +15,6 @@
#************************************************************************** -->
-<div>
- <form method="post" action="doDelete">
- <h4>Are you sure you want to delete the Job?.</h4>
- <input type="submit" class="yes" value="Yes" />
- <input type="button" class="no" value="No" />
- </form>
-</div>
+<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
+ <l:jobDeleteForm />
+</j:jelly>
diff --git a/hudson-core/src/main/resources/hudson/model/ExternalJob/sidepanel.jelly b/hudson-core/src/main/resources/hudson/model/ExternalJob/sidepanel.jelly
index 51d78878..589369d3 100644
--- a/hudson-core/src/main/resources/hudson/model/ExternalJob/sidepanel.jelly
+++ b/hudson-core/src/main/resources/hudson/model/ExternalJob/sidepanel.jelly
@@ -27,7 +27,7 @@
<l:task icon="images/24x24/up.png" href="${rootURL}/" title="${%Back to Dashboard}" />
<l:task icon="images/24x24/search.png" href="." title="${%Status}" />
<l:isAdmin>
- <l:taskWithDialog icon="images/24x24/edit-delete.png" dialogPanel="deleteConfirmationPanel.jelly" href="delete" title="${%Delete Job}" />
+ <l:taskWithDialog icon="images/24x24/edit-delete.gif" dialogPanel="deleteConfirmationPanel.jelly" href="delete" title="${%Delete Job}" onclick="onDeleteClick(); return false;"/>
<l:task icon="images/24x24/setting.png" href="configure" title="${%Configure}" />
</l:isAdmin>
<st:include page="actions.jelly" />

Back to the top