diff --git a/customize_signup/README.rst b/customize_signup/README.rst new file mode 100644 index 000000000..8a6375b08 --- /dev/null +++ b/customize_signup/README.rst @@ -0,0 +1,45 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +Customize Signup +================ +This odoo app is helpful if you need to customize the signup page with extra information. + +Configuration +============= +* No additional configurations needed +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +* Developers: (V17) Bhagyadev KP +* Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/customize_signup/__init__.py b/customize_signup/__init__.py new file mode 100644 index 000000000..058e6f8fd --- /dev/null +++ b/customize_signup/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################ +from . import controllers diff --git a/customize_signup/__manifest__.py b/customize_signup/__manifest__.py new file mode 100644 index 000000000..2dc14ba67 --- /dev/null +++ b/customize_signup/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################ +{ + 'name': 'Customize Signup', + 'version': '17.0.1.0.0', + 'category': 'Website', + 'summary': """This odoo app is helpful if you need to customize the signup + page.""", + 'description': """This app helps to add extra information to the signup + page, hence it will be more convenient.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['auth_signup'], + 'data': [ + 'views/signup_template.xml', + ], + 'assets': { + 'web.assets_frontend': [ + 'customize_signup/static/src/css/customize_signup.css', + 'customize_signup/static/src/js/SignUpForm.js', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/customize_signup/controllers/__init__.py b/customize_signup/controllers/__init__.py new file mode 100644 index 000000000..2a1642044 --- /dev/null +++ b/customize_signup/controllers/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################ +from . import customize_signup + diff --git a/customize_signup/controllers/customize_signup.py b/customize_signup/controllers/customize_signup.py new file mode 100644 index 000000000..ede5a7503 --- /dev/null +++ b/customize_signup/controllers/customize_signup.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################ +import base64 +from odoo import http +from odoo.addons.auth_signup.controllers.main import AuthSignupHome +from odoo.http import request + + +class WebAuthSignup(AuthSignupHome): + """This class helps to set extra information in signup.""" + + @http.route('/web/signup', type='http', auth='public', website=True, + sitemap=False, csrf=False) + def web_auth_signup(self, *args, **kw): + """function used to add extra information at the time of signup""" + res = super().web_auth_signup(*args, **kw) + qcontext = self.get_auth_signup_qcontext() + user = request.env['res.users'] + user_sudo = user.sudo().search( + user._get_login_domain(qcontext.get('login')), + order=user._get_login_order(), limit=1) + if 'file' in kw: + data_b64 = kw['file'] + data = base64.b64encode(data_b64.read()) if data_b64 else b'' + user_sudo.partner_id.image_1920 = data + if 'phone' in kw: + user_sudo.partner_id.phone = kw['phone'] + if 'job_position' in kw: + user_sudo.partner_id.function = kw['job_position'] + if 'city' in kw: + user_sudo.partner_id.city = kw['city'] + if 'country' in kw: + country = request.env['res.country'].search( + [('id', '=', kw['country'])]) + user_sudo.partner_id.country_id = country + return res diff --git a/customize_signup/doc/RELEASE_NOTES.md b/customize_signup/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..d00cafb4b --- /dev/null +++ b/customize_signup/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 21.03.2024 +#### Version 17.0.1.0.0 +#### ADD + - Initial Commit for Customize Signup diff --git a/customize_signup/static/description/assets/icons/capture (1).png b/customize_signup/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/customize_signup/static/description/assets/icons/capture (1).png differ diff --git a/customize_signup/static/description/assets/icons/check.png b/customize_signup/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/customize_signup/static/description/assets/icons/check.png differ diff --git a/customize_signup/static/description/assets/icons/chevron.png b/customize_signup/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/customize_signup/static/description/assets/icons/chevron.png differ diff --git a/customize_signup/static/description/assets/icons/cogs.png b/customize_signup/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/customize_signup/static/description/assets/icons/cogs.png differ diff --git a/customize_signup/static/description/assets/icons/consultation.png b/customize_signup/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/customize_signup/static/description/assets/icons/consultation.png differ diff --git a/customize_signup/static/description/assets/icons/ecom-black.png b/customize_signup/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/customize_signup/static/description/assets/icons/ecom-black.png differ diff --git a/customize_signup/static/description/assets/icons/education-black.png b/customize_signup/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/customize_signup/static/description/assets/icons/education-black.png differ diff --git a/customize_signup/static/description/assets/icons/hotel-black.png b/customize_signup/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/customize_signup/static/description/assets/icons/hotel-black.png differ diff --git a/customize_signup/static/description/assets/icons/img.png b/customize_signup/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/customize_signup/static/description/assets/icons/img.png differ diff --git a/customize_signup/static/description/assets/icons/license.png b/customize_signup/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/customize_signup/static/description/assets/icons/license.png differ diff --git a/customize_signup/static/description/assets/icons/lifebuoy.png b/customize_signup/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/customize_signup/static/description/assets/icons/lifebuoy.png differ diff --git a/customize_signup/static/description/assets/icons/manufacturing-black.png b/customize_signup/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/customize_signup/static/description/assets/icons/manufacturing-black.png differ diff --git a/customize_signup/static/description/assets/icons/photo-capture.png b/customize_signup/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/customize_signup/static/description/assets/icons/photo-capture.png differ diff --git a/customize_signup/static/description/assets/icons/pos-black.png b/customize_signup/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/customize_signup/static/description/assets/icons/pos-black.png differ diff --git a/customize_signup/static/description/assets/icons/puzzle.png b/customize_signup/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/customize_signup/static/description/assets/icons/puzzle.png differ diff --git a/customize_signup/static/description/assets/icons/restaurant-black.png b/customize_signup/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/customize_signup/static/description/assets/icons/restaurant-black.png differ diff --git a/customize_signup/static/description/assets/icons/service-black.png b/customize_signup/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/customize_signup/static/description/assets/icons/service-black.png differ diff --git a/customize_signup/static/description/assets/icons/trading-black.png b/customize_signup/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/customize_signup/static/description/assets/icons/trading-black.png differ diff --git a/customize_signup/static/description/assets/icons/training.png b/customize_signup/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/customize_signup/static/description/assets/icons/training.png differ diff --git a/customize_signup/static/description/assets/icons/update.png b/customize_signup/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/customize_signup/static/description/assets/icons/update.png differ diff --git a/customize_signup/static/description/assets/icons/user.png b/customize_signup/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/customize_signup/static/description/assets/icons/user.png differ diff --git a/customize_signup/static/description/assets/icons/wrench.png b/customize_signup/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/customize_signup/static/description/assets/icons/wrench.png differ diff --git a/customize_signup/static/description/assets/misc/Cybrosys R.png b/customize_signup/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/customize_signup/static/description/assets/misc/Cybrosys R.png differ diff --git a/customize_signup/static/description/assets/misc/email.svg b/customize_signup/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/customize_signup/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/customize_signup/static/description/assets/misc/phone.svg b/customize_signup/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/customize_signup/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/customize_signup/static/description/assets/misc/star (1) 2.svg b/customize_signup/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/customize_signup/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/customize_signup/static/description/assets/misc/support (1) 1.svg b/customize_signup/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/customize_signup/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/customize_signup/static/description/assets/misc/support-email.svg b/customize_signup/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/customize_signup/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/customize_signup/static/description/assets/misc/tick-mark.svg b/customize_signup/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/customize_signup/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/customize_signup/static/description/assets/misc/whatsapp 1.svg b/customize_signup/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/customize_signup/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/customize_signup/static/description/assets/misc/whatsapp.svg b/customize_signup/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/customize_signup/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/customize_signup/static/description/assets/modules/1.jpg b/customize_signup/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..08bbafeb6 Binary files /dev/null and b/customize_signup/static/description/assets/modules/1.jpg differ diff --git a/customize_signup/static/description/assets/modules/2.png b/customize_signup/static/description/assets/modules/2.png new file mode 100644 index 000000000..66730082c Binary files /dev/null and b/customize_signup/static/description/assets/modules/2.png differ diff --git a/customize_signup/static/description/assets/modules/3.jpg b/customize_signup/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..3d171226b Binary files /dev/null and b/customize_signup/static/description/assets/modules/3.jpg differ diff --git a/customize_signup/static/description/assets/modules/4.jpg b/customize_signup/static/description/assets/modules/4.jpg new file mode 100644 index 000000000..1f3f2e27f Binary files /dev/null and b/customize_signup/static/description/assets/modules/4.jpg differ diff --git a/customize_signup/static/description/assets/modules/5.jpg b/customize_signup/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..0db717519 Binary files /dev/null and b/customize_signup/static/description/assets/modules/5.jpg differ diff --git a/customize_signup/static/description/assets/modules/6.jpg b/customize_signup/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..cd62a577c Binary files /dev/null and b/customize_signup/static/description/assets/modules/6.jpg differ diff --git a/customize_signup/static/description/assets/screenshots/1.png b/customize_signup/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..c04f815fe Binary files /dev/null and b/customize_signup/static/description/assets/screenshots/1.png differ diff --git a/customize_signup/static/description/assets/screenshots/2.png b/customize_signup/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..63cda04a9 Binary files /dev/null and b/customize_signup/static/description/assets/screenshots/2.png differ diff --git a/customize_signup/static/description/assets/screenshots/3.png b/customize_signup/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..5652d140e Binary files /dev/null and b/customize_signup/static/description/assets/screenshots/3.png differ diff --git a/customize_signup/static/description/assets/screenshots/4.png b/customize_signup/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..b87f1e340 Binary files /dev/null and b/customize_signup/static/description/assets/screenshots/4.png differ diff --git a/customize_signup/static/description/assets/screenshots/5.png b/customize_signup/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..c0b515d47 Binary files /dev/null and b/customize_signup/static/description/assets/screenshots/5.png differ diff --git a/customize_signup/static/description/assets/screenshots/6.png b/customize_signup/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..8681136c1 Binary files /dev/null and b/customize_signup/static/description/assets/screenshots/6.png differ diff --git a/customize_signup/static/description/assets/screenshots/hero.gif b/customize_signup/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..2fb818448 Binary files /dev/null and b/customize_signup/static/description/assets/screenshots/hero.gif differ diff --git a/customize_signup/static/description/banner.jpg b/customize_signup/static/description/banner.jpg new file mode 100644 index 000000000..c7cec711c Binary files /dev/null and b/customize_signup/static/description/banner.jpg differ diff --git a/customize_signup/static/description/icon.png b/customize_signup/static/description/icon.png new file mode 100644 index 000000000..6a249ad55 Binary files /dev/null and b/customize_signup/static/description/icon.png differ diff --git a/customize_signup/static/description/index.html b/customize_signup/static/description/index.html new file mode 100644 index 000000000..21d1a1b7e --- /dev/null +++ b/customize_signup/static/description/index.html @@ -0,0 +1,755 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

Customize Signup

+

+ This odoo app is helpful if you need to customize the signup page with extra information. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Customize Signup With Extra Information. +

+
+
+
+
+
+
+ +
+
+

Button to Show the Extra Information.

+
+
+
+
+
+
+ +
+
+

Button to Hide the Extra Information.

+
+
+
+
+
+
+ +
+
+

The Extra Information will be Created Inside the Related Partner of the Signup User.

+
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+

Inside the signup page you can enter extra information using Extra Information button. +

+
+
+
+
+
+
+ +
+
+

+ After clicking the button more fields will be visible, You can add information in it and make it more convenient. Also added a button to hide the information.

+
+
+
+
+
+
+ +
+
+

+ After clicking the Hide information button, extra fields will be hide.

+
+
+
+
+
+
+ +
+
+

+ After signup a new user is created.

+
+
+
+
+
+
+ +
+
+

+ Related partner of that particular user.

+
+
+
+
+
+
+ +
+
+

+ Information added at the time of Signup.

+
+
+
+
+
+
+
    +
  • + Customize Signup With Extra Information. +
  • +
  • + Button to Show the Extra Information. +
  • +
  • + Button to Hide the Extra Information. +
  • +
  • + The Extra Information will be Created Inside the Related Partner of the Signup User. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:21st March 2024 +
+

+ Initial Commit for Customize Signup.

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Licensing Consultancy

+
+
+
+
+
+
+

+ Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

+ Education

+

A platform for educational management

+
+
+
+
+ +

+ Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & + Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service + Management

+

Keep track of services and invoice

+
+
+
+
+ +

+ Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel + Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

+ Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got + questions or need help? Get in touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi to + us on WhatsApp!

+
+91 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/customize_signup/static/src/css/customize_signup.css b/customize_signup/static/src/css/customize_signup.css new file mode 100644 index 000000000..7a19c6520 --- /dev/null +++ b/customize_signup/static/src/css/customize_signup.css @@ -0,0 +1,10 @@ +.information { + display: none; +} +#info { + margin-left: 76px; +} +#hide_info { + display:none; + margin-left: -43px; +} diff --git a/customize_signup/static/src/js/SignUpForm.js b/customize_signup/static/src/js/SignUpForm.js new file mode 100644 index 000000000..0ce244c16 --- /dev/null +++ b/customize_signup/static/src/js/SignUpForm.js @@ -0,0 +1,103 @@ +/** @odoo-module **/ +import publicWidget from "@web/legacy/js/public/public_widget"; +import Dialog from "@web/legacy/js/core/dialog"; +import { _t } from "@web/core/l10n/translation"; + +publicWidget.registry.SignUpForm = publicWidget.Widget.extend({ + selector: '.oe_signup_form', + events: { + 'click #info': '_extraInfo', + 'click #hide_info': '_hideInfo', + 'click .btn-primary':'_signupBtn', + "input #phone": "validateNumber", + 'change #file': 'validateImageFile', + }, + /** + * this method is used to store the information in the local storage + */ + start: function(){ + if (localStorage.getItem('city')){ + this.$el.find('#city').val(localStorage.getItem('city')) + } + this.$el.find('#job_position').val(localStorage.getItem('job_position')) + this.$el.find('#phone').val(localStorage.getItem('phone')) + this.$el.find('#country').val(localStorage.getItem('country')) + }, + /** + * Removes stored data from localStorage related to user signup information. + */ + _signupBtn:function (){ + localStorage.removeItem('city') + localStorage.removeItem('job_position') + localStorage.removeItem('phone') + localStorage.removeItem('country'); + }, + /** + * this method is used to show the extra information given in the + * signup form + */ + _extraInfo: function () { + this.$el.find("#data").toggle(); + if (info.style.display == 'none') { + info.style.display = 'block'; + } else { + info.style.display = 'none'; + hide_info.style.display = 'block'; + } + }, + /** + * this method is used to hide the extra information given in the + * signup form + */ + _hideInfo: function () { + this.$el.find("#data").toggle(); + if (hide_info.style.display == 'none') { + hide_info.style.display = 'block'; + } else { + hide_info.style.display = 'none'; + info.style.marginLeft= '-37px', info.style.display = 'block'; + } + }, + /** + * this method is used to validate phone number field given in the + * signup form + */ + validateNumber: function (ev) { + const input = this.$(ev.currentTarget); + const inputValue = input.val(); + if (inputValue.length > 0) { + if (!/^\d+$/.test(inputValue)) { + input.val(''); // Clear the field + return new Dialog(null, { + title: "Error:", + size: "medium", + $content: `

Enter a valid number.

`, + buttons: [{ text: _t("Ok"), close: true }], + }).open(); + } + } + return; + }, + /** + * this method is used to validate File field given in the + * signup form + */ + validateImageFile: function (ev) { + const fileInput = this.$(ev.currentTarget); + const file = fileInput[0].files[0]; + + if (file) { + const allowedExtensions = /(\.jpg|\.jpeg|\.png|\.gif)$/i; + if (!allowedExtensions.exec(file.name)) { + fileInput.val(''); + return new Dialog(null, { + title: 'Error:', + size: 'medium', + $content: '

Enter a valid image file (JPEG, JPG, PNG, GIF).

', + buttons: [{ text: 'Ok', close: true }], + }).open(); + } + } + return; + } +}); diff --git a/customize_signup/views/signup_template.xml b/customize_signup/views/signup_template.xml new file mode 100644 index 000000000..d2780e34e --- /dev/null +++ b/customize_signup/views/signup_template.xml @@ -0,0 +1,49 @@ + + + + +