def get_display(my): sobject = my.get_current_sobject() name = my.get_name() top = DivWdg() if sobject.is_insert(): top.add_style("opacity: 0.3") else: # this gives the swap it's behaviors, so will be disabled # on insert top.add_class("spt_hidden_row_%s" % name) label = my.get_option("label") if label: label = Search.eval(label, sobject) else: label = None icon = my.get_option("icon") swap = SwapDisplayWdg(title=label, icon=icon, show_border=True) swap.set_behavior_top(my.layout) top.add(swap) return top
def get_display(my): sobject = my.get_current_sobject() sobj_name = sobject.get_name() search_type = sobject.get_search_type_obj() stype_title = search_type.get_title() from pyasm.biz import Schema schema = Schema.get() related_types = schema.get_related_search_types(search_type.get_base_key()) related_types = ",".join(related_types) name = my.get_name() top = DivWdg() top.add_attr("spt_related_types", related_types) top.add_style("min-width: 250px") if sobject.is_insert(): top.add_style("opacity: 0.3") else: # this gives the swap it's behaviors, so will be disabled # on insert top.add_class("spt_hidden_row_%s" % name) my.set_option("label", "{}%s" % (sobj_name)) label = my.get_option("label") if label: label = Search.eval(label, sobject) else: label = None if not label: label = sobject.get_code() icon = my.get_option("icon") icon = "DETAILS" #from pyasm.widget import ThumbWdg #thumb_div = DivWdg() #thumb = ThumbWdg() #thumb_div.add(thumb) #thumb.set_sobject(search_type) #thumb.set_option("icon_size", "16") #thumb_div.add_style("float: left") #thumb_div.add_style("width: 22px") title = DivWdg() #title.add(thumb_div) title.add(label) stype_div = SpanWdg(" (%s)" % stype_title) title.add(stype_div) stype_div.add_style("opacity: 0.3") stype_div.add_style("font-syle: italic") stype_div.add_style("font-size: 9px") #swap = SwapDisplayWdg(title=label, icon=icon) swap = SwapDisplayWdg(title=title, icon=icon) swap.set_behavior_top(my.layout) swap.add_style("float: left") swap.add_class("spt_level_listen") top.add(swap) return top
def get_display(my): sobject = my.get_current_sobject() sobj_name = sobject.get_name() search_type = sobject.get_search_type_obj() stype_title = search_type.get_title() from pyasm.biz import Schema schema = Schema.get() related_types = schema.get_related_search_types( search_type.get_base_key()) related_types = ",".join(related_types) name = my.get_name() top = DivWdg() top.add_attr("spt_related_types", related_types) top.add_style("min-width: 250px") if sobject.is_insert(): top.add_style("opacity: 0.3") else: # this gives the swap it's behaviors, so will be disabled # on insert top.add_class("spt_hidden_row_%s" % name) my.set_option("label", "{}%s" % (sobj_name)) label = my.get_option("label") if label: label = Search.eval(label, sobject) else: label = None if not label: label = sobject.get_code() icon = my.get_option("icon") icon = "DETAILS" #from pyasm.widget import ThumbWdg #thumb_div = DivWdg() #thumb = ThumbWdg() #thumb_div.add(thumb) #thumb.set_sobject(search_type) #thumb.set_option("icon_size", "16") #thumb_div.add_style("float: left") #thumb_div.add_style("width: 22px") title = DivWdg() #title.add(thumb_div) title.add(label) stype_div = SpanWdg(" (%s)" % stype_title) title.add(stype_div) stype_div.add_style("opacity: 0.3") stype_div.add_style("font-syle: italic") stype_div.add_style("font-size: 9px") #swap = SwapDisplayWdg(title=label, icon=icon) swap = SwapDisplayWdg(title=title, icon=icon) swap.set_behavior_top(my.layout) swap.add_style("float: left") swap.add_class("spt_level_listen") top.add(swap) return top