You did not say so before. Forget the action. In views.html:
{if auth.user:}}
{{=T('Welcome %s',auth.user.first_name)}}
[{{=A(T('logout'),_href=URL(r=request,c='default',f='user/
logout'))}}]
{{else}}
{{form=auth.login()}} <<<
<div class="ez-box statusbar-v2">
{{=form.custom.begin}}
Username: {{=form.custom.widget.username}}
Password: {{=form.custom.widget.password}}
<input type="submit" value="Login" />
{{=form.custom.end}}
</div>
{{pass}}
On 10 Lug, 18:37, Phyo Arkar <[email protected]> wrote:
> What i am trying to do is include login/logout form in Every view so i am
> putting it in layout.html . Thats why it is confusing.
> Lol , but i finally got it working , Thank you Prof!
>
> i added {{form=auth()}} inside there..
>
> {if auth.user:}}
> {{=T('Welcome %s',auth.user.first_name)}}
> [{{=A(T('logout'),_href=URL(r=request,c='default',f='user/logout'))}}]
> {{pass}}
> {{form=auth()}} << HERE lol..
> {{if request.args(0)=='login':}}
>
> <div class="ez-box statusbar-v2">
> {{=form.custom.begin}}
> Username: {{=form.custom.widget.username}}
> Password: {{=form.custom.widget.password}}
> <input type="submit" value="Login" />
> {{=form.custom.end}}
> </div>
>
> {{else:}}
> {{=form}}
> {{pass}}
>
> But i think it is BAD way ?
>
> On Sat, Jul 10, 2010 at 11:09 PM, mdipierro <[email protected]> wrote:
> > {{if auth.user:}}
> > {{=T('Welcome %s',auth.user.first_name)}}
> > [{{=A(T('logout'),_href=URL(r=request,c='default',f='user/logout'))}}]
> > {{pass}}
> > {{if request.args(0)=='login':}} If this is a login form user custom
>
> > <div class="ez-box statusbar-v2">
> > {{=form.custom.begin}}
> > Username: {{=form.custom.widget.username}}
> > Password: {{=form.custom.widget.password}}
> > <input type="submit" value="Login" />
> > {{=form.custom.end}}
> > </div>
>
> > {{else:}} use default form for register/profile/etc/etc.
> > {{=form}}
> > {{pass}}