def get_display(self): div = DivWdg() search_type = "prod/asset" search_type_obj = SearchType.get(search_type) title = search_type_obj.get_title() title_wdg = DivWdg() title_wdg.add_style("font-size: 1.8em") title_wdg.add("%s" % (title)) div.add(title_wdg) div.add(HtmlElement.hr()) table = Table() div.add(table) table.set_max_width() table.add_row() from pyasm.widget import ThumbWdg, DiscussionWdg, SObjectTaskTableElement td = table.add_cell() td.add_style("width: 250px") td.add_style("vertical-align: top") td.add_style("border-right: solid 1px") title = DivWdg() title.add_class("maq_search_bar") x = DivWdg("[?] [x]") x.add_style("float: right") title.add(x) title.add("Info") td.add(title) thumb = ThumbWdg() thumb.set_sobject(sobject) td.add(thumb) from pyasm.prod.web import AssetInfoWdg info = AssetInfoWdg() info.thumb = thumb info.set_sobject(sobject) td.add(info) td = table.add_cell() td.add_style("vertical-align: top") td.add_style("padding-left: 5px") td.add_style("border-right: solid 1px") # notes title = DivWdg() title.add_class("maq_search_bar") x = DivWdg("[x]") x.add_style("float: right") title.add(x) title.add("Notes") td.add(title) discussion_wdg = DiscussionWdg() discussion_wdg.preprocess() discussion_wdg.set_sobject(sobject) td.add(discussion_wdg) td = table.add_cell() td.add_style("vertical-align: top") td.add_style("padding-left: 5px") td.add_style("border-right: solid 1px") # tasks title = DivWdg() title.add_class("maq_search_bar") x = DivWdg("[x]") x.add_style("float: right") title.add(x) title.add("Custom Properties") td.add(title) search = Search("prod/custom_property") search.add_filter("search_type", "sample3d/book") sobjects = search.get_sobjects() table = TableLayoutWdg(search_type="prod/custom_property", view='table') table.set_sobjects(sobjects) td.add(table) div.add(HtmlElement.hr()) div.add(HtmlElement.br(clear="all")) title_wdg = DivWdg() title_wdg.add_class("maq_search_bar") x = DivWdg("[x]") x.add_style("float: right") title_wdg.add(x) #title_wdg.add_style("font-size: 1.5em") title_wdg.add("Detail") div.add(title_wdg) div.add(HtmlElement.br()) # TEST getting schema search_type = sobject.get_base_search_type() schema = Schema.get_by_sobject(sobject) # add a second table table = Table() table.set_max_width() # show the snapshots for this sobject search_type = "sthpw/snapshot" search = Search(search_type) search.add_sobject_filter(sobject) search.set_limit(50) sobjects = search.get_sobjects() table.add_row() nav_td = table.add_cell() nav_td.add_style("width: 100px") nav_td.add_style("vertical-align: top") #section_wdg = self.get_section_wdg(sobject) #nav_td.add( section_wdg ) #from tactic.ui.panel import ManageViewPanelWdg #defined = ManageViewPanelWdg() from tactic.ui.panel import ManageViewWdg defined = ManageViewWdg() nav_td.add(defined) #content_wdg = TableLayoutWdg(search_type=search_type, view='table') #content_wdg.set_sobjects(sobjects) #content_td = table.add_cell() #content_td.set_id("sobject_relation") #content_td.add_style("display: table-cell") #content_td.add_style("vertical-align: top") #content_td.add(content_wdg) div.add(table) return div
def get_display(my): div = DivWdg() search_type = "prod/asset" search_type_obj = SearchType.get(search_type) title = search_type_obj.get_title() title_wdg = DivWdg() title_wdg.add_style("font-size: 1.8em") title_wdg.add("%s" % (title) ) div.add(title_wdg) div.add(HtmlElement.hr()) table = Table() div.add(table) table.set_max_width() table.add_row() from pyasm.widget import ThumbWdg, DiscussionWdg, SObjectTaskTableElement td = table.add_cell() td.add_style("width: 250px") td.add_style("vertical-align: top") td.add_style("border-right: solid 1px") title = DivWdg() title.add_class("maq_search_bar") x = DivWdg("[?] [x]") x.add_style("float: right") title.add(x) title.add("Info") td.add(title) thumb = ThumbWdg() thumb.set_sobject(sobject) td.add(thumb) from pyasm.prod.web import AssetInfoWdg info = AssetInfoWdg() info.thumb = thumb info.set_sobject(sobject) td.add(info) td = table.add_cell() td.add_style("vertical-align: top") td.add_style("padding-left: 5px") td.add_style("border-right: solid 1px") # notes title = DivWdg() title.add_class("maq_search_bar") x = DivWdg("[x]") x.add_style("float: right") title.add(x) title.add("Notes") td.add(title) discussion_wdg = DiscussionWdg() discussion_wdg.preprocess() discussion_wdg.set_sobject(sobject) td.add(discussion_wdg) td = table.add_cell() td.add_style("vertical-align: top") td.add_style("padding-left: 5px") td.add_style("border-right: solid 1px") # tasks title = DivWdg() title.add_class("maq_search_bar") x = DivWdg("[x]") x.add_style("float: right") title.add(x) title.add("Custom Properties") td.add(title) search = Search("prod/custom_property") search.add_filter("search_type", "sample3d/book") sobjects = search.get_sobjects() table = TableLayoutWdg(search_type="prod/custom_property", view='table') table.set_sobjects(sobjects) td.add(table) div.add(HtmlElement.hr()) div.add(HtmlElement.br(clear="all")) title_wdg = DivWdg() title_wdg.add_class("maq_search_bar") x = DivWdg("[x]") x.add_style("float: right") title_wdg.add(x) #title_wdg.add_style("font-size: 1.5em") title_wdg.add("Detail" ) div.add(title_wdg) div.add(HtmlElement.br()) # TEST getting schema search_type = sobject.get_base_search_type() schema = Schema.get_by_sobject(sobject) # add a second table table = Table() table.set_max_width() # show the snapshots for this sobject search_type = "sthpw/snapshot" search = Search(search_type) search.add_sobject_filter(sobject) search.set_limit(50) sobjects = search.get_sobjects() table.add_row() nav_td = table.add_cell() nav_td.add_style("width: 100px") nav_td.add_style("vertical-align: top") #section_wdg = my.get_section_wdg(sobject) #nav_td.add( section_wdg ) #from tactic.ui.panel import ManageViewPanelWdg #defined = ManageViewPanelWdg() from tactic.ui.panel import ManageViewWdg defined = ManageViewWdg() nav_td.add(defined) #content_wdg = TableLayoutWdg(search_type=search_type, view='table') #content_wdg.set_sobjects(sobjects) #content_td = table.add_cell() #content_td.set_id("sobject_relation") #content_td.add_style("display: table-cell") #content_td.add_style("vertical-align: top") #content_td.add(content_wdg) div.add(table) return div
def get_display(my): div = DivWdg() sobject = my.get_sobject_from_kwargs() if not sobject: div.add("SObject not found") return div search_type_obj = sobject.get_search_type_obj() title = search_type_obj.get_title() title_wdg = DivWdg() title_wdg.add_style("font-size: 1.8em") title_wdg.add("%s: %s" % (title, sobject.get_code() ) ) div.add(title_wdg) div.add(HtmlElement.hr()) table = Table() table.set_max_width() col1 = table.add_col() col1.add_style('width: 200px') col2 = table.add_col() col2.add_style('width: 320px') col3 = table.add_col() col3.add_style('width: 400px') table.add_row() from pyasm.widget import ThumbWdg, DiscussionWdg, SObjectTaskTableElement td = table.add_cell() td.add_style("vertical-align: top") td.add_style("border-right: solid 1px") title = DivWdg() title.add_class("maq_search_bar") #x = DivWdg("[?] [x]") #x.add_style("float: right") #title.add(x) title.add("Info") td.add(title) thumb = ThumbWdg() thumb.set_sobject(sobject) thumb.set_option("detail", "false") td.add(thumb) from pyasm.prod.web import AssetInfoWdg info = AssetInfoWdg() info.thumb = thumb info.set_sobject(sobject) td.add(info) # tasks td = table.add_cell() td.add_style("vertical-align: top") td.add_style("padding-left: 5px") td.add_style("border-right: solid 1px") title = DivWdg() title.add_class("maq_search_bar") #x = DivWdg("[x]") #x.add_style("float: right") #title.add(x) title.add("Tasks") td.add(title) task_wdg = SObjectTaskTableElement() task_wdg.set_sobject(sobject) td.add(task_wdg) td.add_style('cell-padding','10') # discussion td = table.add_cell() #td.add_style("min-width: 300px") #td.add_style("width: 600px") td.add_style("vertical-align: top") td.add_style("padding-left: 5px") td.add_style("border-right: solid 1px") title = DivWdg() title.add_class("maq_search_bar") #x = DivWdg("[x]") #x.add_style("float: right") #title.add(x) title.add("Notes") td.add(title) discussion_wdg = DiscussionWdg() discussion_wdg.preprocess() discussion_wdg.set_sobject(sobject) td.add(discussion_wdg) note_panel = discussion_wdg.get_note_menu() td.add(note_panel) div.add(table) div.add(HtmlElement.hr()) div.add(HtmlElement.br(clear="all")) title_wdg = DivWdg() title_wdg.add_class("maq_search_bar") #x = DivWdg("[x]") #x.add_style("float: right") #title_wdg.add(x) #title_wdg.add_style("font-size: 1.5em") title_wdg.add("Detail" ) div.add(title_wdg) div.add(HtmlElement.br()) # TEST getting schema search_type = sobject.get_base_search_type() schema = Schema.get_by_sobject(sobject) child_types = schema.get_child_types(search_type) # add a second table table = Table() table.set_max_width() # show the snapshots for this sobject search_type = "sthpw/snapshot" search = Search(search_type) search.add_sobject_filter(sobject) search.set_limit(25) sobjects = search.get_sobjects() table.add_row() nav_td = table.add_cell() nav_td.add_style("width: 100px") nav_td.add_style("vertical-align: top") section_wdg = my.get_section_wdg(sobject) nav_td.add( section_wdg ) parent_key = SearchKey.get_by_sobject(sobject) content_wdg = ViewPanelWdg(search_type=search_type, element_name='Snapshots', \ title='Snapshots', view='table', parent_key=parent_key, do_search=True) #content_wdg.set_sobjects(sobjects) content_td = table.add_cell() content_td.set_id("sobject_relation") content_td.add_style("display: table-cell") content_td.add_style("vertical-align: top") content_td.add_style("padding-left: 10px") content_td.add(content_wdg) div.add(table) return div