def __init__(self, view): super(PopupTestPanel, self).__init__(view) popup_a = self.add_child(PopupA(view, view.as_bookmark(), '#contents')) popup_a.add_js_button('Butt1') popup_a.add_js_button('Butt2') popup_contents = self.add_child(P(view, text='this is the content of the popup')) popup_contents.set_id('contents')
def __init__(self, view): super(PopupTestPanel, self).__init__(view) popup_a = self.add_child(PopupA(view, view.as_bookmark(), '#contents')) popup_contents = self.add_child(P(view, text='this is the content of the popup')) popup_contents.set_id('contents') form = self.add_child(Form(view, 'aform')).use_layout(FormLayout()) checkbox = form.layout.add_input(CheckboxInput(form, self.fields.field)) popup_a.add_js_button('Checkit', CheckCheckboxScript(checkbox))
def __init__(self, view): super().__init__(view) self.add_child( PopupA(view, view.as_bookmark(), '#contents', center_vertically=True)) popup_contents = self.add_child( P(view, text='this is the content of the popup')) popup_contents.set_id('contents')
def create_terms_inputs(self): terms_inputs = self.add_child(FieldSet(self.view, legend_text=_('Terms and conditions'))).use_layout(FormLayout()) terms_prompt = P(self.view, text=_('Please read and accept our {terms}. You may also be interested ' 'to read our {privacypolicy} and our {disclaimer}.')) popup = PopupA(self.view, self.bookmarks.terms_bookmark, '#terms', close_button=False) terms_inputs.add_child(terms_prompt.format(terms=popup, privacypolicy=PopupA(self.view, self.bookmarks.privacy_bookmark, '#privacypolicy'), disclaimer=PopupA(self.view, self.bookmarks.disclaimer_bookmark, '#disclaimer'))) terms_cue = P(self.view, _('You can only register if you agree to the terms and conditions.')) accept_checkbox = CheckboxInput(self, self.account_management_interface.fields.accept_terms) terms_inputs.layout.add_input(CueInput(accept_checkbox, terms_cue)) popup.add_js_button(_('Accept'), CheckCheckboxScript(accept_checkbox), style='primary') popup.add_js_button(_('Cancel'))