code: function pageToJqtree(page) {
          var info = {
            label: page.title,
            slug: page.slug,
            id: page._id,
            // For icons
            type: page.type,
            // Also nice for icons and browser-side decisions about what's draggable where
            trash: page.trash,
            published: page.published,
            publish: (page.path === '/trash') || self.apos.permissions.can(req, 'publish-apostrophe-page', page),
            edit: self.apos.permissions.can(req, 'edit-apostrophe-page', page)
          };
          if (page._children && page._children.length) {
            info.children = [];
            // First non-trash, then .trash true,
            // then the conventional trashcan itself
            // to avoid presenting a confusing UI
            _.each(page._children, function(child) {
              if (!child.trash) {
                info.children.push(pageToJqtree(child));
              }
            });
            _.each(page._children, function(child) {
              if (child.trash && (!(child.type === 'trash'))) {
                info.children.push(pageToJqtree(child));
              }
            });
            _.each(page._children, function(child) {
              if (child.trash && (child.type === 'trash')) {
                var forJqtree = pageToJqtree(child);
                if (self.apos.docs.trashInSchema) {
                  forJqtree.label = self.apos.i18n.__('Legacy Trash');
                }
                info.children.push(forJqtree);
              }
            });
          }
          return info;
        }
docs: Recursively build a tree in the format jqtree expects