Browse Source

[IMP] add button signup company or individual

9.0_remove_national_register_number
houssine 5 years ago
parent
commit
498ce40cee
  1. 20
      easy_my_coop/controllers/AuthSignupHome.py
  2. 28
      easy_my_coop/view/auth_signup_template.xml

20
easy_my_coop/controllers/AuthSignupHome.py

@ -54,11 +54,19 @@ class AuthSignupHome(AuthSignupHome):
'acc_number': iban})
request.cr.commit()
@http.route('/web/company_signup', type='http', auth='public', website=True)
@http.route('/web/company_signup', type='http', auth='public',
website=True)
def web_auth_company_signup(self, *args, **kw):
qcontext = request.params.copy()
qcontext['company'] = True
return self.web_auth_signup()
vals = {}
vals['company'] = True
return self.web_auth_signup(**vals)
@http.route('/web/individual_signup', type='http', auth='public',
website=True)
def web_auth_individua_signup(self, *args, **kw):
vals = {}
vals['company'] = False
return self.web_auth_signup(**vals)
@http.route('/web/signup', type='http', auth='public', website=True)
def web_auth_signup(self, *args, **kw):
@ -69,8 +77,8 @@ class AuthSignupHome(AuthSignupHome):
sub_req_obj = request.env['subscription.request']
render_template = 'auth_signup.signup'
if qcontext.get('company', False):
render_template = 'auth_signup.company_signup'
if kw.get('company', False):
render_template = 'easy_my_coop.company_signup'
if qcontext.get("login") != qcontext.get("confirm_email"):
qcontext["error"] = _("The email address doesn't seem to match"

28
easy_my_coop/view/auth_signup_template.xml

@ -19,10 +19,12 @@
<template id="easy_my_coop_signup"
inherit_id="auth_signup.signup" name="Easy My Coop Sign up login">
<div t-attf-class="form-group">
<a class='btn btn-primary' href="/web/company_signup">You are a company? Click here.</a>
<br/>
</div>
<xpath expr="//t[@t-call='auth_signup.fields']" position="before">
<div t-attf-class="form-group">
<a class='btn btn-primary' href="/web/company_signup">You are a company? Click here.</a>
<br/>
</div>
</xpath>
<xpath expr="//t[@t-esc='error']/.." position="replace" />
<xpath expr="//input[@name='csrf_token']" position="after">
<p class="alert alert-danger" t-if="error">
@ -152,6 +154,10 @@
<template id="company_signup" name="Company sign up login">
<t t-call="web.login_layout">
<div t-attf-class="form-group">
<a class='btn btn-primary' href="/web/individual_signup">You are a individual? Click here.</a>
<br/>
</div>
<form class="oe_signup_form" role="form" method="post"
t-if="not message">
<input type="hidden" name="csrf_token"
@ -252,6 +258,20 @@
Contact Person
</label>
</div>
<div class="form-group field-name">
<label for="name" class="control-label">Your Name</label>
<input type="text" name="name" t-att-value="name"
id="name" class="form-control" placeholder="Doe"
required="required"
t-att-readonly="'readonly' if only_passwords else None" />
</div>
<div class="form-group field-name">
<label for="firstname" class="control-label">Your firstname</label>
<input type="text" name="firstname" t-att-value="firstname"
id="firstname" class="form-control" placeholder="John"
required="required"
t-att-readonly="'readonly' if only_passwords else None" />
</div>
<div class="form-group field-login">
<label for="login" class="control-label">Your Email</label>
<input type="text" name="login" t-att-value="login"

Loading…
Cancel
Save