You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by he...@apache.org on 2015/10/15 21:01:21 UTC
[34/42] allura git commit: [#7919] Fix endpoint to show installable
tools for a given project
[#7919] Fix endpoint to show installable tools for a given project
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/967324b6
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/967324b6
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/967324b6
Branch: refs/heads/hs/7919
Commit: 967324b6f9c60ad64cc9634b487db3a91f3d5721
Parents: 3bb27f6
Author: Heith Seewald <hs...@hsmb.local>
Authored: Mon Oct 12 13:43:12 2015 -0400
Committer: Heith Seewald <hs...@hsmb.local>
Committed: Thu Oct 15 15:00:18 2015 -0400
----------------------------------------------------------------------
Allura/allura/ext/admin/admin_main.py | 32 ++++++++++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/967324b6/Allura/allura/ext/admin/admin_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/admin_main.py b/Allura/allura/ext/admin/admin_main.py
index e5d819e..84e698c 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -797,7 +797,7 @@ class ProjectAdminRestController(BaseController):
@expose('json:')
def installable_tools(self, **kw):
- """ List of installable tools
+ """ List of installable tools and their default options.
"""
response.content_type = 'application/json'
tools = []
@@ -809,7 +809,8 @@ class ProjectAdminRestController(BaseController):
'defaults': {
'default_options': tool['app'].default_options(),
'default_mount_label': tool['app'].default_mount_label,
- 'default_mount_point': tool['app'].default_mount_point,
+ 'default_mount_point': tool['app'].admin_menu_delete_button,
+ 'modal': tool['app'].admin_modal,
}
})
@@ -860,6 +861,32 @@ class ProjectAdminRestController(BaseController):
}
@expose('json:')
+ @require_post()
+ def mount_point(self, mount_point=None, **kw):
+ """
+ Returns a tool from a given mount point
+ """
+ response.content_type = 'application/json'
+
+ tool = c.project.app_instance(mount_point)
+
+ if tool is None:
+ return {
+ 'exists': False,
+ 'info': 'Mount point does not exists.',
+ }
+
+ try:
+ info = json.dumps(tool)
+ except TypeError:
+ info = "Could not serialize tool."
+
+ return {
+ 'exist': True,
+ 'info': info
+ }
+
+ @expose('json:')
def export_status(self, **kw):
"""
Check the status of a bulk export.
@@ -900,6 +927,7 @@ class ProjectAdminRestController(BaseController):
"""
controller = ProjectAdminController()
+ ordinal = 0
if not tool or not mount_point or not mount_label:
return {