def embedDashboardView(self, view, i=0):
        body = ""
        url = view.url
        if (view.controllers.all().count()>0):
            body = body + 'Controller: <select id="dashselect-%d">' % i;
            body = body + '<option value="None">(select a controller)</option>';
            for j,controllerdashboard in enumerate(view.controllerdashboardviews.all()):
                body = body + '<option value="%d">%s</option>' % (j, controllerdashboard.controller.name)
            body = body + '</select><hr>'

            for j,controllerdashboard in enumerate(view.controllerdashboardviews.all()):
                body = body + '<script type="text/template" id="dashtemplate-%d-%d">\n%s\n</script>\n' % (i,j, self.embedDashboardUrl(controllerdashboard.url));

            body = body + '<div id="dashcontent-%d" class="dashcontent"></div>\n' % i

            body = body + """<script>
                             $("#dashselect-%d").change(function() {
                                 v=$("#dashselect-%d").val();
                                 if (v=="None") {
                                     $("#dashcontent-%d").html("");
                                     return;
                                 }
                                 $("#dashcontent-%d").html( $("#dashtemplate-%d-" + v).html() );
                             });
                             //$("#dashcontent-%d").html( $("#dashtemplate-%d-0").html() );
                             </script>
                          """ % (i,i,i,i,i,i,i);
        else:
            body = body + self.embedDashboardUrl(url)
        return body
dataset/ETHPy150Open open-cloud/xos/xos/core/dashboard/views/home.py/DashboardDynamicView.embedDashboardView/original