def get_new_tab_wdg(my): widget = Widget() span = SpanWdg() swap = SwapDisplayWdg.get_triangle_wdg() title = SpanWdg("Tab Creation") span.add(swap) span.add(title) span.add_style("float: left") widget.add(span) widget.add(HtmlElement.br()) # add the tab selector div = DivWdg() SwapDisplayWdg.create_swap_title(title, swap, div) tab_text = TextWdg("tab") tab_text.set_persistence() span = SpanWdg(css="med") span.add("Tab: ") span.add(tab_text) div.add(span) # parent index_text = TextWdg("parent_tab") index_text.set_persistence() span = SpanWdg(css="med") span.add("Parent Tab: ") span.add(index_text) span.add( HintWdg( "Enter the name of the tab that this will fall under. Leave empty to put on the main tab" )) div.add(span) # index index_text = TextWdg("index") index_text.set_attr("size", "4") index_text.set_persistence() span = SpanWdg(css="med") span.add("Index: ") span.add(index_text) span.add( HintWdg("Enter the numeric location for this tab to be placed")) div.add(span) WebContainer.register_cmd("CreateTabCmd") button = IconSubmitWdg("Create Tab", IconWdg.CREATE, True) div.add(button) widget.add(div) return widget
def get_new_tab_wdg(self): widget = Widget() span = SpanWdg() swap = SwapDisplayWdg.get_triangle_wdg() title = SpanWdg("Tab Creation") span.add(swap) span.add(title) span.add_style("float: left") widget.add(span) widget.add(HtmlElement.br() ) # add the tab selector div = DivWdg() SwapDisplayWdg.create_swap_title( title, swap, div) tab_text = TextWdg("tab") tab_text.set_persistence() span = SpanWdg(css="med") span.add("Tab: ") span.add(tab_text) div.add(span) # parent index_text = TextWdg("parent_tab") index_text.set_persistence() span = SpanWdg(css="med") span.add("Parent Tab: ") span.add(index_text) span.add(HintWdg("Enter the name of the tab that this will fall under. Leave empty to put on the main tab") ) div.add(span) # index index_text = TextWdg("index") index_text.set_attr("size", "4") index_text.set_persistence() span = SpanWdg(css="med") span.add("Index: ") span.add(index_text) span.add(HintWdg("Enter the numeric location for this tab to be placed") ) div.add(span) WebContainer.register_cmd("CreateTabCmd") button = IconSubmitWdg("Create Tab", IconWdg.CREATE, True) div.add(button) widget.add(div) return widget
def init(my): search = Search("sthpw/queue") search.add_order_by("priority desc") search.add_order_by("timestamp desc") widget = Widget() div = DivWdg(css="filter_box") span = SpanWdg(css="med") from pyasm.prod.web import SearchFilterWdg search_filter = SearchFilterWdg(columns=Queue.get_search_columns()) search_filter.alter_search(search) span.add(search_filter) div.add(span) span = SpanWdg(css="med") priority_wdg = TextWdg("priority_search") priority_wdg.set_persistence() priority = priority_wdg.get_value() if priority: search.add_filter("priority", priority) span.add("Priority: ") span.add(priority_wdg) div.add(span) select = SelectWdg("queue_state") select.set_option("values", "|pending|locked|error|done") select.set_option("labels", "All|pending|locked|error|done") select.add_event("onchange", "document.form.submit()") select.set_persistence() span = SpanWdg(css="med") span.add("State: ") span.add(select) div.add(span) queue_state = select.get_value() if queue_state != "": search.add_filter("state", queue_state) user_select = SelectWdg("user_select") user_select.add_empty_option() user_search = Search("sthpw/login") user_select.set_search_for_options(user_search, "login", "login") user_select.add_event("onchange", "document.form.submit()") user_select.set_persistence() div.add("User: "******"": search.add_filter("login", queue_user) search_limit = SearchLimitWdg() search_limit.set_limit(10) div.add(search_limit) search_limit.alter_search(search) widget.add(div) sobjects = search.get_sobjects() table = TableWdg("sthpw/queue") table.set_sobjects(sobjects) widget.add(table) my.add(widget)