Yes. This worked.
def main_page():
main_pg=DIV('')
form = auth.login()
dialog = modal_wrapper(form, _id='cont_id', header='Header',
footer='footer')
main_pg.append(dialog)
return dict(main_pg = main_pg)
def modal_wrapper(content, _id, header='', footer=''):
main_wrap = DIV('', _class="modal fade", _role="dialog", _id=_id,
_tabindex="-1" )
title_id = _id + '_title'
main_wrap['_aria-labelledby']=title_id
dialog_div=DIV('', _class="modal-dialog" , _role="document")
content_div=DIV('', _class="modal-content")
header_div = DIV( _class="modal-header")
close_cross = BUTTON(
SPAN(XML('×'), **{'_aria-hidden':"true"}),
_type="button", _class="close",
data={'dismiss':"modal"},
**{'_aria-label':"Close"}
)
title_h4 = H4( header, _class="modal-title", _id = title_id)
body_div = DIV( content, _class="modal-body")
close_btn = BUTTON('Close', _type="button", _class="btn btn-default",
data={'dismiss':"modal"})
footer_div = DIV( footer, close_btn, _class="modal-footer")
# gluon all
main_wrap[0] = dialog_div
dialog_div[0] = content_div
header_div.append(close_cross)
header_div.append(title_h4)
[content_div.append(c) for c in (header_div, body_div, footer_div)]
return main_wrap
{{=A( 'login to continue',_onclick=""" $('#cont_id').modal('show')
""")}}
{{=main_pg}}
On Tuesday, June 28, 2016 at 1:54:16 PM UTC-4, pbreit wrote:
>
> You should be able to put the Web2py login form on a modal using something
> like:
>
> def mylogin(): return dict(form=auth.login())
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.