def get_advanced_definition_wdg(my): # add the advanced entry advanced = DivWdg() advanced.add_style("margin-top: 10px") advanced.add_style("padding: 10px") advanced.add_border() title = DivWdg() title.add_style("color: black") title.add("Advanced - XML Column Definition") title.add_style("margin-top: -23") advanced.add(title) advanced.add("<br/>") input = TextAreaWdg("config_xml") input.set_id("config_xml") input.set_option("rows", "10") input.set_option("cols", "70") input.set_value(my.config_string) advanced.add(input) advanced.add(HtmlElement.br(2)) button_div = DivWdg() button_div.add_style("text-align: center") button = ActionButtonWdg(title="Save Definition") #button = ProdIconButtonWdg("Save Definition") button.add_event("onclick", "spt.custom_project.save_definition_cbk()") button_div.add(button) button_div.add_style("margin-left: 130px") advanced.add(button_div) return advanced
def get_advanced_definition_wdg(self): # add the advanced entry advanced = DivWdg() advanced.add_style("margin-top: 10px") advanced.add_style("padding: 10px") advanced.add_border() title = DivWdg() title.add_style("color: black") title.add("Advanced - XML Column Definition") title.add_style("margin-top: -23") advanced.add(title) advanced.add("<br/>") input = TextAreaWdg("config_xml") input.set_id("config_xml") input.set_option("rows", "10") input.set_option("cols", "70") input.set_value(self.config_string) advanced.add(input) advanced.add(HtmlElement.br(2)) button_div = DivWdg() button_div.add_style("text-align: center") button = ActionButtonWdg(title="Save Definition") #button = ProdIconButtonWdg("Save Definition") button.add_event("onclick", "spt.custom_project.save_definition_cbk()") button_div.add(button) button_div.add_style("margin-left: 130px") advanced.add(button_div) return advanced
def get_error_wdg(my): div = DivWdg() error_div = DivWdg() error_div.add("Error %s" % my.status) div.add(error_div) error_div.add_style("font-size: 18px") error_div.add_style("font-weight: bold") error_div.add_style("padding: 10px") error_div.add_style("width: auto") error_div.add_gradient("background", "background") error_div.add_border() error_div.add_style("margin-left: 5px") error_div.add_style("margin-right: 5px") error_div.add_style("margin-top: -10px") div.add("<br/>") span = DivWdg() #span.add_color("color", "color") span.add_style("color", "#FFF") if my.status == 404: span.add( HtmlElement.b( "You have tried to access a url that is not recognized.")) else: span.add(HtmlElement.b(my.message)) span.add(HtmlElement.br(2)) web = WebContainer.get_web() root = web.get_site_root() if my.message.startswith('No project ['): label = 'You may need to correct the default_project setting in the TACTIC config.' else: label = "Go to the Main page for a list of valid projects" span.add(label) div.add(span) div.add(HtmlElement.br()) from tactic.ui.widget import ActionButtonWdg button_div = DivWdg() button_div.add_style("width: 90px") button_div.add_style("margin: 0px auto") div.add(button_div) button = ActionButtonWdg(title="Go to Main", tip='Click to go to main page') button_div.add(button) button.add_behavior({ 'type': 'click_up', 'cbjs_action': ''' document.location = '/'; ''' }) button.add_event("onmouseup", "document.location='/'") return div
def get_error_wdg(my): div = DivWdg() error_div = DivWdg() error_div.add("Error %s" % my.status) div.add(error_div) error_div.add_style("font-size: 18px") error_div.add_style("font-weight: bold") error_div.add_style("padding: 10px") error_div.add_style("width: auto") error_div.add_gradient("background", "background") error_div.add_border() error_div.add_style("margin-left: 5px") error_div.add_style("margin-right: 5px") error_div.add_style("margin-top: -10px") div.add("<br/>") span = DivWdg() #span.add_color("color", "color") span.add_style("color", "#FFF") if my.status == 404: span.add(HtmlElement.b("You have tried to access a url that is not recognized.")) else: span.add(HtmlElement.b(my.message)) span.add(HtmlElement.br(2)) web = WebContainer.get_web() root = web.get_site_root() if my.message.startswith('No project ['): label = 'You may need to correct the default_project setting in the TACTIC config.' else: label = "Go to the Main page for a list of valid projects" span.add(label) div.add(span) div.add(HtmlElement.br()) from tactic.ui.widget import ActionButtonWdg button_div = DivWdg() button_div.add_style("width: 90px") button_div.add_style("margin: 0px auto") div.add(button_div) button = ActionButtonWdg(title="Go to Main", tip='Click to go to main page') button_div.add(button) button.add_behavior( { 'type': 'click_up', 'cbjs_action': ''' document.location = '/'; ''' } ) button.add_event("onmouseup", "document.location='/'") return div
def get_display(my): web = WebContainer.get_web() login_name = web.get_form_value('login') hidden = HiddenWdg('login', login_name) box = DivWdg(css='login') if web.is_IE(): box.add_style("margin-top: 150px") box.add_style("margin-bottom: 150px") else: box.add_style("margin-top: auto") box.add_style("margin-bottom: auto") box.add_style("text-align: center") div = DivWdg() div.add_style("margin: 0px 0px") div.add_class("centered") div.add_style("padding-top: 95px") sthpw = SpanWdg("SOUTHPAW TECHNOLOGY INC", css="login_sthpw") sthpw.add_style("color: #CCCCCC") div.add(sthpw) div.add(HtmlElement.br()) div.add(hidden) box.add(div) # hidden element in the form to pass message that this was not # actually a typical submitted form, but rather the result # of a login page div.add(HiddenWdg("is_from_login", "yes")) div.add_style("font-size: 10px") table = Table(css="login") table.center() table.set_attr("cellpadding", "3px") table.add_row() table2 = Table(css="login") table2.center() table2.add_style("width: 240px") table2.add_row() td = table2.add_header( 'After reset, the new password will be sent to the email address for [ %s ].' % login_name) td.add_color('color', 'color', +80) table2.add_row_cell(' ') # build the button manually from tactic.ui.widget import ActionButtonWdg button = ActionButtonWdg(tip='Reset Password', title='Reset') button.add_style('margin: auto') button.add_event( 'onclick', "document.form.elements['reset_password'].value='true'; document.form.submit()" ) table2.add_row() td = table2.add_cell(button) hidden = HiddenWdg('reset_password') td.add(hidden) #th.add_class('center_content') table2.add_row() div.add(HtmlElement.br()) div.add(table) div.add(HtmlElement.spacer_div(1, 14)) div.add(table2) #div.add(HiddenWdg(my.LOGIN_MSG)) #box.add(script) widget = Widget() #widget.add( HtmlElement.br(3) ) table = Table() table.add_style("width: 100%") table.add_style("height: 85%") table.add_row() td = table.add_cell() td.add_style("vertical-align: middle") td.add_style("text-align: center") td.add_style("background: transparent") td.add(box) widget.add(table) return widget
def get_display(my): web = WebContainer.get_web() login_name = web.get_form_value('login') hidden = HiddenWdg('login', login_name) box = DivWdg(css='login') if web.is_IE(): box.add_style("margin-top: 150px") box.add_style("margin-bottom: 150px") else: box.add_style("margin-top: auto") box.add_style("margin-bottom: auto") box.add_style("text-align: center") div = DivWdg() div.add_style("margin: 0px 0px") div.add_class("centered") div.add_style("padding-top: 95px") sthpw = SpanWdg("SOUTHPAW TECHNOLOGY INC", css="login_sthpw") sthpw.add_style("color: #CCCCCC") div.add( sthpw ) div.add( HtmlElement.br() ) div.add(hidden) box.add(div) # hidden element in the form to pass message that this was not # actually a typical submitted form, but rather the result # of a login page div.add( HiddenWdg("is_from_login", "yes") ) div.add_style("font-size: 10px") table = Table(css="login") table.center() table.set_attr("cellpadding", "3px") table.add_row() table2 = Table(css="login") table2.center() table2.add_style("width: 240px") table2.add_row() td = table2.add_header('After reset, the new password will be sent to the email address for [ %s ].'%login_name) td.add_color('color','color', + 80) table2.add_row_cell(' ') # build the button manually from tactic.ui.widget import ActionButtonWdg button = ActionButtonWdg(tip='Reset Password', title='Reset') button.add_style('margin: auto') button.add_event('onclick',"document.form.elements['reset_password'].value='true'; document.form.submit()") table2.add_row() td = table2.add_cell(button) hidden = HiddenWdg('reset_password') td.add(hidden) #th.add_class('center_content') table2.add_row() div.add(HtmlElement.br()) div.add(table) div.add( HtmlElement.spacer_div(1,14) ) div.add(table2) #div.add(HiddenWdg(my.LOGIN_MSG)) #box.add(script) widget = Widget() #widget.add( HtmlElement.br(3) ) table = Table() table.add_style("width: 100%") table.add_style("height: 85%") table.add_row() td = table.add_cell() td.add_style("vertical-align: middle") td.add_style("text-align: center") td.add_style("background: transparent") td.add(box) widget.add(table) return widget