예제 #1
0
def html():
    i = int(request.args(0) or 0)
    root = build.stree(db, i)
    nodes = list(root.iternodes())
    for node in nodes:
        label = node.rec.label or node.label
        if node.rec.ott_node:
            label = db.ott_node[node.rec.ott_node].name
        node.label = label

    modal = PluginMModal(id="mymodal",
                         title="Edit node properties",
                         content="")
    mid = modal.id
    cid = "c" + mid

    def onclick(nid):
        u = URL(c="snode", f="update_snode.load", args=[nid])
        return "hbranch_clicked(%s, '%s', '%s', '%s');" % (nid, u, mid, cid)

    if auth.has_membership(role="contributor"): f = onclick
    else: f = ""
    div, mapping, w, h = tree.render_html(root,
                                          session,
                                          request,
                                          db,
                                          onclick=f)

    return dict(tree=div, root=root, modal=modal, w=w, h=h)
예제 #2
0
def treediv():
    i = int(request.args(0) or 0)
    root = build.stree(db, i)
    nodes = list(root.iternodes())
    for node in nodes:
        label = node.rec.label or node.label
        if node.rec.ott_node:
            label = db.ott_node[node.rec.ott_node].name
        node.label = label

    def onclick(nid):
        u = URL(c="snode", f="update_snode.load", args=[nid])
        return ("hbranch_clicked(%s, '%s', 'modal', 'modal_content');" %
                (nid, u))

    if auth.has_membership(role="contributor"): f = onclick
    else: f = ""
    wscale = float(request.vars.wscale or 0.9)
    div, mapping, w, h = tree.render_html(root,
                                          session,
                                          request,
                                          db,
                                          onclick=f,
                                          wscale=wscale)
    return div.xml()
예제 #3
0
def load_html():
    i = int(request.args(0) or 0)
    root = build.stree(db, i)
    nodes = list(root.iternodes())
    for node in nodes:
        label = node.rec.label or node.label
        if node.rec.ott_node:
            label = db.ott_node[node.rec.ott_node].name
        node.label = label
    def onclick(nid):
        u = URL(c="snode",f="update_snode.load", args=[nid])
        return ("hbranch_clicked(%s, '%s', 'modal', 'modal_content');"
                % (nid, u))
    if auth.has_membership(role="contributor"): f = onclick
    else: f = ""
    div, mapping, w, h = tree.render_html(root, session, request,
                                          db, onclick=f)
    return dict(tree=div)
예제 #4
0
def treediv():
    i = int(request.args(0) or 0)
    root = build.stree(db, i)
    nodes = list(root.iternodes())
    for node in nodes:
        label = node.rec.label or node.label
        if node.rec.taxon:
            label = db.taxon[node.rec.taxon].name
        node.label = label
    def onclick(nid):
        u = URL(c="snode",f="update_snode.load", args=[nid])
        return ("hbranch_clicked(%s, '%s', 'modal', 'modal_content');"
                % (nid, u))
    if auth.has_membership(role="contributor"): f = onclick
    else: f = ""
    wscale = float(request.vars.wscale or 0.9)
    div, mapping, w, h = tree.render_html(root, session, request,
                                          db, onclick=f,
                                          wscale=wscale)
    return div.xml()
예제 #5
0
def html():
    i = int(request.args(0) or 0)
    root = build.stree(db, i)
    nodes = list(root.iternodes())
    for node in nodes:
        label = node.rec.label or node.label
        if node.rec.ott_node:
            label = db.ott_node[node.rec.ott_node].name
        node.label = label

    modal = PluginMModal(id="mymodal", title="Edit node properties", content="")
    mid = modal.id; cid = "c"+mid
    def onclick(nid):
        u = URL(c="snode",f="update_snode.load", args=[nid])
        return "hbranch_clicked(%s, '%s', '%s', '%s');" % (nid, u, mid, cid)
    if auth.has_membership(role="contributor"): f = onclick
    else: f = ""
    div, mapping, w, h = tree.render_html(root, session, request,
                                          db, onclick=f)

    return dict(tree=div, root=root, modal=modal, w=w, h=h)