allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [04/14] allura git commit: [#7922] ticket:826 Fix subproject delete
Date Mon, 17 Aug 2015 19:38:12 GMT
[#7922] ticket:826 Fix subproject delete


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/e5b3959d
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/e5b3959d
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/e5b3959d

Branch: refs/heads/master
Commit: e5b3959dfd45be16b76127dd8787d570049a0ed7
Parents: 46a4f68
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Jul 31 12:28:21 2015 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Aug 17 17:54:12 2015 +0000

----------------------------------------------------------------------
 Allura/allura/ext/admin/templates/project_tools.html        | 4 +++-
 .../lib/widgets/resources/js/admin_tool_delete_modal.js     | 9 ++++++++-
 .../allura/templates/widgets/admin_tool_delete_modal.html   | 4 ++--
 3 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/e5b3959d/Allura/allura/ext/admin/templates/project_tools.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/project_tools.html b/Allura/allura/ext/admin/templates/project_tools.html
index c9eab4a..90c03d4 100644
--- a/Allura/allura/ext/admin/templates/project_tools.html
+++ b/Allura/allura/ext/admin/templates/project_tools.html
@@ -105,7 +105,9 @@
                         <img src="{{ g.theme.app_icon_url('subproject', 48) }}" alt="">
                     </li>
                     <li>
-                      <a href="#" data-mount-point="{{ mount['sub'].shortname }}" class="admin_tool_delete_modal">
+                      <a href="#" data-mount-point="{{ mount['sub'].shortname }}"
+                                  data-subproject="true"
+                                  class="admin_tool_delete_modal">
                         <span>Delete</span>
                       </a>
                     </li>

http://git-wip-us.apache.org/repos/asf/allura/blob/e5b3959d/Allura/allura/lib/widgets/resources/js/admin_tool_delete_modal.js
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/resources/js/admin_tool_delete_modal.js b/Allura/allura/lib/widgets/resources/js/admin_tool_delete_modal.js
index 3d41261..211f5ed 100644
--- a/Allura/allura/lib/widgets/resources/js/admin_tool_delete_modal.js
+++ b/Allura/allura/lib/widgets/resources/js/admin_tool_delete_modal.js
@@ -20,7 +20,14 @@ $(function() {
   var $form = $('#admin-tool-delete-modal-form');
   $('a.admin_tool_delete_modal').click(function() {
     var mount_point = $(this).data('mount-point');
-    $form.find('.mount_point').val(mount_point);
+    var is_sub = $(this).data('subproject');
+    var prefix = is_sub ? 'subproject-0' : 'tool-0';
+    var mount_point_name = prefix + (is_sub ? '.shortname' : '.mount_point');
+    var delete_name = prefix + '.delete';
+    $form.find('.mount_point')
+         .attr('name', mount_point_name)
+         .val(mount_point);
+    $form.find('.delete-input').attr('name', delete_name);
     var tool_label = 'this';
     if (mount_point) {
       tool_label = 'the "' + mount_point + '"';

http://git-wip-us.apache.org/repos/asf/allura/blob/e5b3959d/Allura/allura/templates/widgets/admin_tool_delete_modal.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/admin_tool_delete_modal.html b/Allura/allura/templates/widgets/admin_tool_delete_modal.html
index dd8aab4..692c582 100644
--- a/Allura/allura/templates/widgets/admin_tool_delete_modal.html
+++ b/Allura/allura/templates/widgets/admin_tool_delete_modal.html
@@ -28,7 +28,7 @@
   <input type="button" value="Delete" class="delete-tool">
   <input type="button" value="Cancel" class="close">
 </p>
-<input type="hidden" class="mount_point" name="tool-0.mount_point"/>
-<input name="tool-0.delete" type="hidden" value="Delete"/>
+<input type="hidden" class="mount_point">
+<input type="hidden" value="Delete" class="delete-input">
 {{lib.csrf_token()}}
 </form>


Mime
View raw message