Right now the view user.html contains
{{=form}}
You can replace by a custom form depending on the specific case
{{if request.args(0)=='login':}}
custom form for login
{{elif reqquest.args(0)=='profile':}}
...
{{pass}}
On 10 Lug, 18:31, elfuego1 <[email protected]> wrote:
> But where do I have to put my customized registration form code to
> have it working and not disturbing any other part of the framework?
> Please write me where to place it and I'll put it there.
>
> On 11 Lip, 00:54, mdipierro <[email protected]> wrote:
>
> > form=auth() makes ONE form based on request.args(0)
> > You can make specific forms
>
> > form=auth.login()
> > form=auth.register()
> > form=auth.profle()
> > etc.
>
> > Make the form you what. Where you want and customize them.
> > Just do NOT CALL form.accepts(). because this is done automatically,
> > as in CRUD.
>
> > Massimo
>
> > On 10 Lug, 17:45, elfuego1 <[email protected]> wrote:
>
> > > But where do I have to put my customized registration form code?
> > > I describe what I can see right now.
> > > On login page I have login form and registration form (both default,
> > > based on db.auth_user structure).
> > > On registration page I have registration form (again default, based on
> > > db.auth_user structure).
>
> > > I don't know where and how to insert my own code?!
>
> > > On 11 Lip, 00:38, mdipierro <[email protected]> wrote:
>
> > > > No. I am assuming the regular user method. I think it should work.
>
> > > > On 10 Lug, 17:37, elfuego1 <[email protected]> wrote:
>
> > > > > Should I somehow define my registration form in the Controller (in
> > > > > user method)?
>
> > > > > On 11 Lip, 00:31, elfuego1 <[email protected]> wrote:
>
> > > > > > Now I have registration form on login and registration pages.
>
> > > > > > On 11 Lip, 00:27, mdipierro <[email protected]> wrote:
>
> > > > > > > {{if request.args(0)=='login':}}{{=auth.register()}}{{pass}}
> > > > > > > <form action="" enctype="multipart/form-data" method="post">
> > > > > > > <h2>{{=T( 'Registration form' )}}</h2><hr>
> > > > > > > {{=form}}
>
> > > > > > > ?
>
> > > > > > > On 10 Lug, 11:39, elfuego1 <[email protected]> wrote:
>
> > > > > > > > User methon in Controller "default.py":
>
> > > > > > > > def user():
> > > > > > > > form=auth()
> > > > > > > > form[0][-1]
> > > > > > > > [1].append(INPUT(_type="button",_value="Cancel",_onclick="window.location='%s';"%URL(r=request,f='index')))
> > > > > > > > return dict(form=form)
>
> > > > > > > > In my View "user.html" I had added:
> > > > > > > > {{if request.args(0)=='login':}}{{=auth.login()}}{{pass}}
>
> > > > > > > > full View:
>
> > > > > > > > {{extend 'layout.html'}}
>
> > > > > > > > {{if request.args(0)=='login':}}{{=auth.login()}}{{pass}}
> > > > > > > > <form action="" enctype="multipart/form-data" method="post">
> > > > > > > > <h2>{{=T( 'Registration form' )}}</h2><hr>
> > > > > > > > {{=form}}
>
> > > > > > > > On login page I'd like to replace email with login for
> > > > > > > > authentication
> > > > > > > > - HOW DO I DO THAT?
> > > > > > > > I did make my own registration page. When I put it into View
> > > > > > > > "user.html" I can see it all right, BUT mdipierro you told me
> > > > > > > > NOT TO
> > > > > > > > DO THAT!
> > > > > > > > So WHERE DO I PUT MY CODE FOR REGISTRATION FORM?
>
> > > > > > > > Right now on login page I can see two login forms.
> > > > > > > > One generated by this:
> > > > > > > > {{if request.args(0)=='login':}}{{=auth.login()}}{{pass}}
> > > > > > > > Second generated by:
> > > > > > > > {{=form}}
>
> > > > > > > > But without {{=form}} I won't see any registration form.
> > > > > > > > SO WHAT TO DO TO SORT THIS OUT FINALLY?
> > > > > > > > PLEASE HELP!!!!!!
>
> > > > > > > > On 10 Lip, 17:49, elfuego1 <[email protected]> wrote:
>
> > > > > > > > > Where do I have to insert code of my customized registration
> > > > > > > > > form to
> > > > > > > > > have it work properly with default login form?
>
> > > > > > > > > On 10 Lip, 13:57, elfuego1 <[email protected]> wrote:
>
> > > > > > > > > > I did it this way:
> > > > > > > > > > In my user.html I had added: {{if
> > > > > > > > > > request.args(0)=='login':}}
> > > > > > > > > > {{=auth.login()}}{{pass}}
> > > > > > > > > > Now when I go to registration page I see only my custom
> > > > > > > > > > registration
> > > > > > > > > > form, BUT when I go to login page I see login as well as
> > > > > > > > > > custom
> > > > > > > > > > registration form. Do I have to move my registration form
> > > > > > > > > > to some
> > > > > > > > > > separate page and somehow redirect to it in layout.html ?
>
> > > > > > > > > > On 10 Lip, 10:08, mdipierro <[email protected]> wrote:
>
> > > > > > > > > > > What's the controller?
>
> > > > > > > > > > > Anyway:
> > > > > > > > > > > You cannot have <html><body>..</html> in there since it
> > > > > > > > > > > extends
> > > > > > > > > > > layout.html (html is in there already)
>
> > > > > > > > > > > Try this instead.
> > > > > > > > > > > {{extend 'layout.html'}}
> > > > > > > > > > > {{=form}}
> > > > > > > > > > > {{if
> > > > > > > > > > > request.args(0)=='login':}}{{=auth.register()}}{{pass}}
>
> > > > > > > > > > > On 10 Lug, 02:55, elfuego1 <[email protected]> wrote:
>
> > > > > > > > > > > > I also have problem with submit button. It doesn't work.
>
> > > > > > > > > > > > My user.html content:
>
> > > > > > > > > > > > {{extend 'layout.html'}}
> > > > > > > > > > > > <html>
> > > > > > > > > > > > <body>
> > > > > > > > > > > > <form action="" enctype="multipart/form-data"
> > > > > > > > > > > > method="post">
>
> > > > > > > > > > > > <table>
> > > > > > > > > > > > <tr>
> > > > > > > > > > > > <label
> > > > > > > > > > > > for="register_login">{{=lbl.login}}</label>
> > > > > > > > > > > > <td>{{=wdgt.login}}</td>
> > > > > > > > > > > > </tr>
> > > > > > > > > > > > <tr>
> > > > > > > > > > > > <label for="password">{{=lbl.password}}</label>
> > > > > > > > > > > > <td>{{=wdgt.password}}<td>
> > > > > > > > > > > > </tr>
> > > > > > > > > > > > <tr>
> > > > > > > > > > > > <label for="password2"{{=T('Verify
> > > > > > > > > > > > Password')}}</label>
> > > > > > > > > > > > <input class="password" name="password2">{{if
> > > > > > > > > > > > form.errors.password2:}}<div class="error">NO
> > > > > > > > > > > > MATCH</div>{{pass}}</
> > > > > > > > > > > > input>
> > > > > > > > > > > > </tr>
> > > > > > > > > > > > <tr>
> > > > > > > > > > > > <label
> > > > > > > > > > > > for="register_first_name">{{=lbl.first_name}}</label>
> > > > > > > > > > > > <td>{{=wdgt.first_name}}</td>
> > > > > > > > > > > > </tr>
> > > > > > > > > > > > <tr>
> > > > > > > > > > > > <label
> > > > > > > > > > > > for="register_last_name">{{=lbl.last_name}}</label>
> > > > > > > > > > > > <td>{{=wdgt.last_name}}</td>
> > > > > > > > > > > > </tr>
> > > > > > > > > > > > <tr>
> > > > > > > > > > > > <label
> > > > > > > > > > > > for="register_email">{{=lbl.email}}</label>
> > > > > > > > > > > > <td>{{=wdgt.email}}</td>
> > > > > > > > > > > > </tr>
> > > > > > > > > > > > <tr>
> > > > > > > > > > > > <label
> > > > > > > > > > > > for="register_phone1">{{=lbl.phone_no1}}</label>
> > > > > > > > > > > > <td>{{=wdgt.phone_no1}}</td>
> > > > > > > > > > > > </tr>
> > > > > > > > > > > > </table>
> > > > > > > > > > > > <input type="submit" id="bsubmit" name="bsubmit"
> > > > > > > > > > > > value="Submit" />
> > > > > > > > > > > > </form>
> > > > > > > > > > > > </body>
> > > > > > > > > > > > </html>
>
> > > > > > > > > > > > {{=form}}
>
> > > > > > > > > > > > On 10 Lip, 09:36, mdipierro <[email protected]>
> > > > > > > > > > > > wrote:
>
> > > > > > > > > > > > > Can you show the user.html?
>
> > > > > > > > > > > > > On 10 Lug, 02:18, elfuego1 <[email protected]> wrote:
>
> > > > > > > > > > > > > > One more thing.
> > > > > > > > > > > > > > At the bottom of my registration form there is
> > > > > > > > > > > > > > {{=form}} code.
> > > > > > > > > > > > > > It seems that I need to redirect login link to
> > > > > > > > > > > > > > completly different
> > > > > > > > > > > > > > page.
> > > > > > > > > > > > > > Can you show where do I need to make changes to
> > > > > > > > > > > > > > have it working?
>
> > > > > > > > > > > > > > On 10 Lip, 08:50, elfuego1 <[email protected]>
> > > > > > > > > > > > > > wrote:
>
> > > > > > > > > > > > > > > Hi everybody,
>
> > > > > > > > > > > > > > > I had customized my registration form, but when I
> > > > > > > > > > > > > > > go to login page my
> > > > > > > > > > > > > > > registration form shows up there too?!
> > > > > > > > > > > > > > > It looks like that:
> > > > > > > > > > > > > > > Fields like password, password verification and
> > > > > > > > > > > > > > > e-mail have valid
> > > > > > > > > > > > > > > description in label field.
> > > > > > > > > > > > > > > All the other fields are marked "None".
> > > > > > > > > > > > > > > Below my custom form there is login part
> > > > > > > > > > > > > > > requesting: E-mail address
> > > > > > > > > > > > > > > and Password.
>
> > > > > > > > > > > > > > > I had read that def user(): exposes two
> > > > > > > > > > > > > > > linkshttp://..../[app]/default/user/loginhttp://..../[app]/default/user/register
> > > > > > > > > > > > > > > In user.html I had just added code for my
> > > > > > > > > > > > > > > registration form. I don't
> > > > > > > > > > > > > > > know what caused that kind of behaviour...
> > > > > > > > > > > > > > > Can you please help me separate those two, so
> > > > > > > > > > > > > > > they would appear on 2
> > > > > > > > > > > > > > > separate pages as they should?