You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2015/08/13 20:07:05 UTC
[38/50] allura git commit: [#7922] ticket:826 Fix subproject delete
[#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/1c002499
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/1c002499
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/1c002499
Branch: refs/heads/ib/7922
Commit: 1c002499f8c1ff3b59ae12710b30158ae1b1c993
Parents: ef7125c
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Jul 31 12:28:21 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Aug 13 18:14:42 2015 +0300
----------------------------------------------------------------------
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/1c002499/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/1c002499/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/1c002499/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>