diff --git a/customize_signup/README.rst b/customize_signup/README.rst new file mode 100644 index 000000000..4bfe717e2 --- /dev/null +++ b/customize_signup/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://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 + +License +------- +Lesser General Public License, Version 3 (LGPL v3) +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: (V14) Busthana Shirin, + (V15) Aysha Shalin, + (V16) Athira Premanand, + 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..e4f366751 --- /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: Cybrosys Techno Solutions(odoo@cybrosys.com) +# +# 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..2bb57b2dd --- /dev/null +++ b/customize_signup/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Technologies (odoo@cybrosys.com) +# +# 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': '14.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': ['base', 'auth_signup', 'website'], + 'data': [ + 'views/signup_templates.xml', + ], + '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..3630bfd5f --- /dev/null +++ b/customize_signup/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# 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..3d04b7c5a --- /dev/null +++ b/customize_signup/controllers/signup.py @@ -0,0 +1,55 @@ +""""Customize Signup""" +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions(odoo@cybrosys.com) +# +# 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 add extra information in signup page.""" + @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'].sudo().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..5c2bbd773 --- /dev/null +++ b/customize_signup/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 29.07.2024 +#### Version 14.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/call_for_price_website.png b/customize_signup/static/description/assets/modules/call_for_price_website.png new file mode 100644 index 000000000..88b9cb312 Binary files /dev/null and b/customize_signup/static/description/assets/modules/call_for_price_website.png differ diff --git a/customize_signup/static/description/assets/modules/odoo_website_helpdesk_dashboard.png b/customize_signup/static/description/assets/modules/odoo_website_helpdesk_dashboard.png new file mode 100644 index 000000000..679801d45 Binary files /dev/null and b/customize_signup/static/description/assets/modules/odoo_website_helpdesk_dashboard.png differ diff --git a/customize_signup/static/description/assets/modules/product_visibility_website.png b/customize_signup/static/description/assets/modules/product_visibility_website.png new file mode 100644 index 000000000..8fe953215 Binary files /dev/null and b/customize_signup/static/description/assets/modules/product_visibility_website.png differ diff --git a/customize_signup/static/description/assets/modules/website_hide_variants.png b/customize_signup/static/description/assets/modules/website_hide_variants.png new file mode 100644 index 000000000..50c641400 Binary files /dev/null and b/customize_signup/static/description/assets/modules/website_hide_variants.png differ diff --git a/customize_signup/static/description/assets/modules/website_product_attachments.png b/customize_signup/static/description/assets/modules/website_product_attachments.png new file mode 100644 index 000000000..206e5a38d Binary files /dev/null and b/customize_signup/static/description/assets/modules/website_product_attachments.png differ diff --git a/customize_signup/static/description/assets/modules/website_product_publish.png b/customize_signup/static/description/assets/modules/website_product_publish.png new file mode 100644 index 000000000..dd0a54579 Binary files /dev/null and b/customize_signup/static/description/assets/modules/website_product_publish.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..9d615cb4c 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..c0b3d2b6e 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..41ceebde8 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..92a66eb63 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..d6e4894ad 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..23a4372b8 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..cc1180efd 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..f885ca9f5 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..decdb5caa 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..993d8ac3f --- /dev/null +++ b/customize_signup/static/description/index.html @@ -0,0 +1,488 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Customize Signup

+

+ This Module Helps Customize the Signup Page with Extra Information. +

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

Explore This Module

+
+ + + + +
+
+ +
+

Overview

+
+
+
+ This Odoo Application Improves the Signup Page by Enabling Customization with Additional Information, Enhancing + Convenience. If this Feature is Unnecessary, it can be Effortlessly Hidden using the "Hide Information" button. +
+
+ + + +
+
+ +
+

Features

+
+
+
+
+ + Customize Signup With Extra Information. +
+
+ + Button to Show the Extra Information. +
+
+ + Button to Hide the Extra Information. +
+
+ + + The Additional Information will be Included within the Related Partner Profile of the Signed-up User. +
+
+
+ + + +
+
+ +
+

Screenshots

+
+
+
+
+

To Enable Customers Sign up in to Odoo, go to Settings -> General Settings -> Customer Account and Select Free sign up +

+ +
+
+

On the Signup Page, you can Input Extra Information + by Selecting 'Extra Information' button. +

+ +
+
+

+ Clicking the button will Reveal more Fields where you can Add Information. Additionally, a button has been Included to Hide this Information. +

+ +
+
+

After Clicking the 'Hide Information' button, + Extra Fields are Hidden.

+ +
+
+

After signup, a New User is created with the Related Partner of that Particular User.

+ +
+
+

Information Added at the time of Signup will be Stored.

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

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

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/customize_signup/static/src/css/signup.css b/customize_signup/static/src/css/signup.css new file mode 100644 index 000000000..11e9b84d0 --- /dev/null +++ b/customize_signup/static/src/css/signup.css @@ -0,0 +1,15 @@ +.information { + display: none; +} +#info { + margin-left: 0px; +} +#hide_info { + display:none; +} +.field-city { + margin-top: 10px; +} +.field-job-position{ + margin-top: -15px; +} diff --git a/customize_signup/static/src/js/signup.js b/customize_signup/static/src/js/signup.js new file mode 100644 index 000000000..b239ffc57 --- /dev/null +++ b/customize_signup/static/src/js/signup.js @@ -0,0 +1,88 @@ +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"); +// Define a new widget named 'SignUpForm' that extends the 'publicWidget.Widget' class +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 local storage related to user sign-up 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= '0px', 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; + }, + // This method is used to validate the image 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(''); // 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..a18fd79b8 --- /dev/null +++ b/customize_signup/views/signup_templates.xml @@ -0,0 +1,69 @@ + + +