summaryrefslogtreecommitdiff
path: root/addons/website_crm/static
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/website_crm/static
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/website_crm/static')
-rw-r--r--addons/website_crm/static/description/icon.pngbin0 -> 8662 bytes
-rw-r--r--addons/website_crm/static/description/icon.svg1
-rw-r--r--addons/website_crm/static/src/js/website_crm_editor.js56
-rw-r--r--addons/website_crm/static/tests/tours/website_crm.js42
4 files changed, 99 insertions, 0 deletions
diff --git a/addons/website_crm/static/description/icon.png b/addons/website_crm/static/description/icon.png
new file mode 100644
index 00000000..c27e9447
--- /dev/null
+++ b/addons/website_crm/static/description/icon.png
Binary files differ
diff --git a/addons/website_crm/static/description/icon.svg b/addons/website_crm/static/description/icon.svg
new file mode 100644
index 00000000..308be18a
--- /dev/null
+++ b/addons/website_crm/static/description/icon.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="70" height="70" viewBox="0 0 70 70"><defs><path id="a" d="M4 0h61c4 0 5 1 5 5v60c0 4-1 5-5 5H4c-3 0-4-1-4-5V5c0-4 1-5 4-5z"/><linearGradient id="c" x1="100%" x2="0%" y1="0%" y2="100%"><stop offset="0%" stop-color="#94B6C8"/><stop offset="100%" stop-color="#6A9EBA"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><mask id="b" fill="#fff"><use xlink:href="#a"/></mask><g mask="url(#b)"><path fill="url(#c)" d="M0 0H70V70H0z"/><path fill="#FFF" fill-opacity=".383" d="M4 1h61c2.667 0 4.333.667 5 2V0H0v3c.667-1.333 2-2 4-2z"/><path fill="#393939" d="M4 69c-2 0-4-1-4-4V36.068L12.746 22l2.101-1h17.128L39 14h10v2.968l-4.079 4.3v6.773L52 21l7 2-.691 19.842L37.604 69H4z" opacity=".324"/><path fill="#000" fill-opacity=".383" d="M4 69h61c2.667 0 4.333-1 5-3v4H0v-4c.667 2 2 3 4 3z"/><path fill="#000" d="M52 44h3a2 2 0 0 0 2-2V27a2 2 0 0 0-2-2h-3v-2h4a3 3 0 0 1 3 3v17a3 3 0 0 1-3 3h-4v-2zM36 25H16a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h20v2H15a3 3 0 0 1-3-3V26a3 3 0 0 1 3-3h21v2zm7 25V19h-4v-3h10v3h-4v31h4v3H39v-3h4zM30.468 33.075c.097-.07.24-.005.24.106v4.606c0 .597-.533 1.08-1.19 1.08H19.19c-.657 0-1.191-.483-1.191-1.08v-4.604c0-.113.141-.176.24-.106.557.392 1.294.89 3.826 2.559.524.347 1.407 1.076 2.288 1.072.887.007 1.788-.739 2.291-1.072 2.532-1.67 3.267-2.17 3.823-2.561zm-6.114 2.691c-.575.01-1.405-.658-1.822-.932-3.293-2.17-3.544-2.36-4.304-2.9A.526.526 0 0 1 18 31.51v-.428c0-.597.534-1.081 1.191-1.081h10.326c.658 0 1.192.484 1.192 1.081v.428a.523.523 0 0 1-.229.426c-.76.54-1.01.73-4.304 2.899-.417.274-1.246.941-1.822.932z" opacity=".3"/><path fill="#FFF" d="M52 42h3a2 2 0 0 0 2-2V25a2 2 0 0 0-2-2h-3v-2h4a3 3 0 0 1 3 3v17a3 3 0 0 1-3 3h-4v-2zM36 23H16a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h20v2H15a3 3 0 0 1-3-3V24a3 3 0 0 1 3-3h21v2zm7 25V17h-4v-3h10v3h-4v31h4v3H39v-3h4zM30.468 31.075c.097-.07.24-.005.24.106v4.606c0 .597-.533 1.08-1.19 1.08H19.19c-.657 0-1.191-.483-1.191-1.08v-4.604c0-.113.141-.176.24-.106.557.392 1.294.89 3.826 2.559.524.347 1.407 1.076 2.288 1.072.887.007 1.788-.739 2.291-1.072 2.532-1.67 3.267-2.17 3.823-2.561zm-6.114 2.691c-.575.01-1.405-.658-1.822-.932-3.293-2.17-3.544-2.36-4.304-2.9A.526.526 0 0 1 18 29.51v-.428c0-.597.534-1.081 1.191-1.081h10.326c.658 0 1.192.484 1.192 1.081v.428a.523.523 0 0 1-.229.426c-.76.54-1.01.73-4.304 2.899-.417.274-1.246.941-1.822.932z"/></g></g></svg> \ No newline at end of file
diff --git a/addons/website_crm/static/src/js/website_crm_editor.js b/addons/website_crm/static/src/js/website_crm_editor.js
new file mode 100644
index 00000000..361ae783
--- /dev/null
+++ b/addons/website_crm/static/src/js/website_crm_editor.js
@@ -0,0 +1,56 @@
+odoo.define('website_crm.form', function (require) {
+'use strict';
+
+var core = require('web.core');
+var FormEditorRegistry = require('website_form.form_editor_registry');
+
+var _t = core._t;
+
+FormEditorRegistry.add('create_lead', {
+ formFields: [{
+ type: 'char',
+ required: true,
+ name: 'contact_name',
+ string: 'Your Name',
+ }, {
+ type: 'tel',
+ name: 'phone',
+ string: 'Phone Number',
+ }, {
+ type: 'email',
+ required: true,
+ name: 'email_from',
+ string: 'Your Email',
+ }, {
+ type: 'char',
+ required: true,
+ name: 'partner_name',
+ string: 'Your Company',
+ }, {
+ type: 'char',
+ modelRequired: true,
+ name: 'name',
+ string: 'Subject',
+ }, {
+ type: 'text',
+ required: true,
+ name: 'description',
+ string: 'Your Question',
+ }],
+ fields: [{
+ name: 'team_id',
+ type: 'many2one',
+ relation: 'crm.team',
+ domain: [['use_opportunities', '=', true]],
+ string: _t('Sales Team'),
+ title: _t('Assign leads/opportunities to a sales team.'),
+ }, {
+ name: 'user_id',
+ type: 'many2one',
+ relation: 'res.users',
+ string: _t('Salesperson'),
+ title: _t('Assign leads/opportunities to a salesperson.'),
+ }],
+});
+
+});
diff --git a/addons/website_crm/static/tests/tours/website_crm.js b/addons/website_crm/static/tests/tours/website_crm.js
new file mode 100644
index 00000000..3638fa45
--- /dev/null
+++ b/addons/website_crm/static/tests/tours/website_crm.js
@@ -0,0 +1,42 @@
+odoo.define('website_crm.tour', function(require) {
+ 'use strict';
+
+ var tour = require('web_tour.tour');
+
+ tour.register('website_crm_tour', {
+ test: true,
+ url: '/contactus',
+ }, [{
+ content: "Complete name",
+ trigger: "input[name=contact_name]",
+ run: "text John Smith",
+ }, {
+ content: "Complete phone number",
+ trigger: "input[name=phone]",
+ run: "text +32 485 118.218"
+ }, {
+ content: "Complete Email",
+ trigger: "input[name=email_from]",
+ run: "text john@smith.com"
+ }, {
+ content: "Complete Company",
+ trigger: "input[name=partner_name]",
+ run: "text Odoo S.A."
+ }, {
+ content: "Complete Subject",
+ trigger: "input[name=name]",
+ run: "text Useless message"
+ }, {
+ content: "Complete Subject",
+ trigger: "textarea[name=description]",
+ run: "text ### TOUR DATA ###"
+ }, {
+ content: "Send the form",
+ trigger: ".s_website_form_send"
+ }, {
+ content: "Check we were redirected to the success page",
+ trigger: "#wrap:has(h1:contains('Thank You!'))"
+ }]);
+
+ return {};
+});