diff --git a/customize_signup/README.rst b/customize_signup/README.rst new file mode 100644 index 000000000..a80ef0335 --- /dev/null +++ b/customize_signup/README.rst @@ -0,0 +1,44 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-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 `__ + +Credits +------- +* Developers: version 16: Athira Premanand @cybrosys + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.odoo.com/documentation/user/13.0/legal/licenses/licenses.html) + +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..304a6d19b --- /dev/null +++ b/customize_signup/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) 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..d89dbc4e8 --- /dev/null +++ b/customize_signup/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Technologies () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Customize Signup', + 'version': '16.0.1.0.0', + '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', + 'website': "https://www.cybrosys.com", + 'category': 'Website', + 'maintainer': 'Cybrosys Techno Solutions', + 'depends': ['base', 'web', 'auth_signup'], + 'data': [ + 'views/signup_templates.xml', + ], + 'assets': { + 'web.assets_frontend': [ + 'customize_signup/static/src/css/signup.css', + 'customize_signup/static/src/js/signup.js', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-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..16c4dc087 --- /dev/null +++ b/customize_signup/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from. import signup diff --git a/customize_signup/controllers/signup.py b/customize_signup/controllers/signup.py new file mode 100644 index 000000000..b27daf100 --- /dev/null +++ b/customize_signup/controllers/signup.py @@ -0,0 +1,57 @@ +""""Customize Signup""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) 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..928e1b283 --- /dev/null +++ b/customize_signup/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 06.01.2024 +#### Version 16.0.1.0.0 +#### ADD + - Initial Commit for Customize Signup 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/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/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/categories.png b/customize_signup/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/customize_signup/static/description/assets/misc/categories.png differ diff --git a/customize_signup/static/description/assets/misc/check-box.png b/customize_signup/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/customize_signup/static/description/assets/misc/check-box.png differ diff --git a/customize_signup/static/description/assets/misc/compass.png b/customize_signup/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/customize_signup/static/description/assets/misc/compass.png differ diff --git a/customize_signup/static/description/assets/misc/corporate.png b/customize_signup/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/customize_signup/static/description/assets/misc/corporate.png differ diff --git a/customize_signup/static/description/assets/misc/customer-support.png b/customize_signup/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/customize_signup/static/description/assets/misc/customer-support.png differ diff --git a/customize_signup/static/description/assets/misc/cybrosys-logo.png b/customize_signup/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/customize_signup/static/description/assets/misc/cybrosys-logo.png differ diff --git a/customize_signup/static/description/assets/misc/features.png b/customize_signup/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/customize_signup/static/description/assets/misc/features.png differ diff --git a/customize_signup/static/description/assets/misc/logo.png b/customize_signup/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/customize_signup/static/description/assets/misc/logo.png differ diff --git a/customize_signup/static/description/assets/misc/pictures.png b/customize_signup/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/customize_signup/static/description/assets/misc/pictures.png differ diff --git a/customize_signup/static/description/assets/misc/pie-chart.png b/customize_signup/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/customize_signup/static/description/assets/misc/pie-chart.png differ diff --git a/customize_signup/static/description/assets/misc/right-arrow.png b/customize_signup/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/customize_signup/static/description/assets/misc/right-arrow.png differ diff --git a/customize_signup/static/description/assets/misc/star.png b/customize_signup/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/customize_signup/static/description/assets/misc/star.png differ diff --git a/customize_signup/static/description/assets/misc/support.png b/customize_signup/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/customize_signup/static/description/assets/misc/support.png differ diff --git a/customize_signup/static/description/assets/misc/whatsapp.png b/customize_signup/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/customize_signup/static/description/assets/misc/whatsapp.png differ diff --git a/customize_signup/static/description/assets/modules/1.png b/customize_signup/static/description/assets/modules/1.png new file mode 100644 index 000000000..df65629bf Binary files /dev/null and b/customize_signup/static/description/assets/modules/1.png 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..6058f6c3b 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.png b/customize_signup/static/description/assets/modules/3.png new file mode 100644 index 000000000..163485cfd Binary files /dev/null and b/customize_signup/static/description/assets/modules/3.png differ diff --git a/customize_signup/static/description/assets/modules/4.png b/customize_signup/static/description/assets/modules/4.png new file mode 100644 index 000000000..618e3e6c4 Binary files /dev/null and b/customize_signup/static/description/assets/modules/4.png differ diff --git a/customize_signup/static/description/assets/modules/5.png b/customize_signup/static/description/assets/modules/5.png new file mode 100644 index 000000000..2a722d66e Binary files /dev/null and b/customize_signup/static/description/assets/modules/5.png differ diff --git a/customize_signup/static/description/assets/modules/6.png b/customize_signup/static/description/assets/modules/6.png new file mode 100644 index 000000000..a44d454aa Binary files /dev/null and b/customize_signup/static/description/assets/modules/6.png 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..c95a8f4f1 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..5bf7fc171 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..99fae70a0 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..cd29298d2 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..26de07fd4 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..f25357806 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..9fd996a85 Binary files /dev/null and b/customize_signup/static/description/assets/screenshots/hero.gif differ diff --git a/customize_signup/static/description/banner.png b/customize_signup/static/description/banner.png new file mode 100644 index 000000000..7323ebf6d Binary files /dev/null and b/customize_signup/static/description/banner.png differ diff --git a/customize_signup/static/description/icon.png b/customize_signup/static/description/icon.png new file mode 100644 index 000000000..84d9df48a 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..a1d437021 --- /dev/null +++ b/customize_signup/static/description/index.html @@ -0,0 +1,564 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+ +
+
+ +
+
+
+ +

+ Customize Signup

+

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

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

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ This odoo app is helpful if you need to customize the signup page with + extra information. + It will make it more convenient. + If you don't want this feature you can easily hide it through hide + information button. + +
+
+ + + +
+
+ +
+

Features +

+
+
+
+
+ + 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. +
+
+
+ + + +
+
+ +
+

Screenshots +

+
+
+
+ +
+

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 are Hide.

+ +
+ +
+

After signup, A New User is Created.

+ +
+ +
+

Related Partner of that Particular User.

+ +
+ +
+

Information added at the time of Signup.

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

Related + Products +

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

Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ 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 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/customize_signup/static/src/css/signup.css b/customize_signup/static/src/css/signup.css new file mode 100644 index 000000000..7a19c6520 --- /dev/null +++ b/customize_signup/static/src/css/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/signup.js b/customize_signup/static/src/js/signup.js new file mode 100644 index 000000000..d7442c767 --- /dev/null +++ b/customize_signup/static/src/js/signup.js @@ -0,0 +1,98 @@ +odoo.define('customize_signup.signup', function (require) { +'use strict'; +var publicWidget = require('web.public.widget'); + const { _t } = require("web.core"); + const Dialog = require("web.Dialog"); +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')) + }, + _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: `

${_.str.escapeHTML("Enter Valid Number ") || ""}

`, + buttons: [{ text: _t("Ok"), close: true }], + }).open(); + } + } + return; +}, +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(''); // Clear the file input + 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_templates.xml b/customize_signup/views/signup_templates.xml new file mode 100644 index 000000000..f4ea428f0 --- /dev/null +++ b/customize_signup/views/signup_templates.xml @@ -0,0 +1,49 @@ + + + + +