> I forgot you also need to include in your controller instructions to
> open and close the dialog e.g.
How would I include that in the user function:
def user():
form=auth()
if isinstance(form,FORM):
if 'auth' in globals():
if not auth.is_logged_in():
form[0][-1]
[1].append(INPUT(_type="button",_value="Cancel",_onclick="window.location='%s';"%URL('admin','index')))
else:
form[0][-1]
[1].append(INPUT(_type="button",_value="Cancel",_onclick="window.location='%s';"%URL('admin','admin')))
if request.args(0)=='login':
form.element(_type='submit')['_value']='Login'
if request.args(0)=='not_authorized':
auth.messages.logged_out='Insufficient privileges, you are
logged out'
redirect(URL('user',args='logout'))
return dict(form=form)
Kind regards,
Annet.
> if form.process(.....
> response.js="$('#dialogdiv').dialog('close');"
> elif form.errors:
> pass
> else:
> response.js="$('#dialogdiv').dialog('open').focus();"
>
> On Jan 18, 1:44 pm, apple <[email protected]> wrote:
>
>
>
>
>
>
>
> > Ah you want the whole URL to be in a dialog. I spent ages figuring
> > this out and the answer is already included in web2py!! You just
> > include the code below and then you can just replace any url with
> > dialog(url) and it will show up in a dialog. Brilliant!!
>
> > // create dialogbox
> > document.write("<div id='dialogdiv' style='display:none'></div>")
> > $(document).ready(function(){
> > $('#dialogdiv').dialog({autoOpen : false, modal : false, width :
> > 'auto'});
>
> > })
>
> > // open url in dialog box
> > function dialog(url) {
> > web2py_ajax_page("get", url, null , 'dialogdiv')}
>
> > ############
> > you can get rid of the dialog bar in css:
>
> > .ui-dialog-titlebar { display:none; }
> > ################################
>
> > I don't know why you have scroll bars in your dialog because I don't.
>
> > On Jan 18, 8:44 am, Annet <[email protected]> wrote:
>
> > > Does the first problem has anything to do with auth_menu:
>
> > > in menu.py:
>
> > > if 'auth' in globals():
> > > if not auth.is_logged_in():
> > > response.auth_menu = [
> > > ['Login',request.function=='user' and
> > > request.args(0)=='login',URL('default','user/login')],
> > > ['Gebruikersnaam opvragen',request.function=='user' and
> > > request.args(0)=='retrieve_username',URL('default','user/
> > > retrieve_username')],
> > > ['Wachtwoord opvragen',request.function=='user'and
> > > request.args(0)=='request_reset_password',URL('default','user/
> > > request_reset_password')]]
> > > else:
> > > response.auth_menu = [
> > > ['Logout',request.function=='user'and
> > > request.args(0)=='logout',URL('default','user/logout')],
> > > ['Profiel wijzigen',request.function=='user' and
> > > request.args(0)=='profile',URL('default','user/profile')],
> > > ['Wachtwoord wijzigen',request.function=='user' and
> > > request.args(0)=='change_password',URL('default','user/
> > > change_password')]]
>
> > > in admin/index.html:
>
> > > <div class="ez-box">
> > > {{if response.auth_menu:}}
> > > <p>
> > > {{for _name,_active,_link in response.auth_menu:}}
> > > <a {{if _active:}} class="active" {{pass}} href="{{=_link}}"
> > > style="padding-right: 6px;">{{=_name}}</a>
> > > {{pass}}
> > > </p>
> > > {{pass}}
> > > </div> <!-- ez-box -->
>
> > > Annet.