allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [17/50] [abbrv] allura git commit: [#7919] Fix endpoint to show installable tools for a given project
Date Fri, 30 Oct 2015 20:55:36 GMT
[#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/3211f387
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/3211f387
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/3211f387

Branch: refs/heads/db/7919
Commit: 3211f38766f6988eed8518f0ef8479a52ba508db
Parents: e2d3312
Author: Heith Seewald <hseewald@hsmb.local>
Authored: Mon Oct 12 13:43:12 2015 -0400
Committer: Heith Seewald <hseewald@hsmb.local>
Committed: Thu Oct 29 20:21:33 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/3211f387/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 56536fb..013bf99 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 {


Mime
View raw message