code: function pageToJqtree(page) {
            var info = {
              label: page.title,
              slug: page.slug,
              // Available both ways for compatibility with jqtree and
              // mongodb expectations
              _id: page._id,
              id: page._id,
              // For icons
              type: page.type,
              // Also nice for icons and browser-side decisions about what's draggable where
              trash: page.trash,
              publish: (page.path === 'home/trash') || apos.permissions.can(req, 'publish-page', page),
              edit: apos.permissions.can(req, 'edit-page', page)
            };
            if (page.children && page.children.length) {
              info.children = [];
              // Sort trash after non-trash
              _.each(page.children, function(child) {
                if (!child.trash) {
                  info.children.push(pageToJqtree(child));
                }
              });
              _.each(page.children, function(child) {
                if (child.trash) {
                  info.children.push(pageToJqtree(child));
                }
              });
            }
            return info;
          }
docs: Recursively build a tree in the format jqtree expects