blob: cd6552ab752ff31345696bfd19384e950aaa0908 [file] [log] [blame]
Rushabh Mehta5ab81632012-05-08 12:58:32 +05301window.home_page = "index";
Rushabh Mehtaa9209432012-05-07 18:00:57 +05302// footer signup widget
3// automatically adds it to the .layout-main div of the page
4// adds events and also random goodies.
5
6erpnext.set_request_signup = function(page_name) {
7
8 // goodies
9 var goodies = [
10 "ERPNext also contains a module to build your website. \
11The way it works is, when you log out, the app becomes your website. \
12This website is generated from ERPNext.",
13
14 "You can add custom fields to your transactions in ERPNext to capture specific information about your business.",
15
16 "All forms in ERPNext can be customized, if you feel there are features you do not want to use, you can hide them.",
17
18 "You can email transactions like Quotations and Invoices directly from the system. You can also set this process to become automatic",
19
20 "You can create your own Roles and assign user to those roles. You can also set detailed permissions for each role in transactions.",
21
22 "ERPNext allows you to assign any transaction like an Invoice or Customer Issue to a user. You can also add comments on any transaction."
23
24 ];
25
26
27 // add the footer
28
29 $('#page-' + page_name + ' .layout-main').append('<div class="page-footer">\
30<h2 style="padding: 0px">Try before you buy. \
31Request a 30-day Free Trial.</h2><br>\
32\
33<input name="company_name" type="text" placeholder="Company Name"> \
34<input name="sender_name" type="text" placeholder="Your Name"> \
35<input name="email" type="text" placeholder="Email"> \
36<input name="password" type="password" placeholder="Password"> \
37<button class="btn btn-success btn-small btn-request">Request</button>\
38\
39<p>Note: Free trials usually take one business day to setup. \
40Please fill out your genuine information because we verify \
41your name and company before setting up a demo to \
42ensure that spammers don\'t crash our servers. \
43If you would like to see something right now, \
44<a href="#!demo">jump to the demo.</a></p>\
45\
46<p style="font-size: 90%; margin-top: 10px;">\
47<i class="icon-hand-right"></i> <b>ERPNext Goodies:</b> <span class="goodie">'
48
49+ goodies[parseInt(Math.random() * goodies.length)]+
50
51'</goodie></p>\
52</span>');
53
54 // bind the events
55
56 $('#page-'+page_name+' .btn-request').click(function() {
57
58 var page = $('#page-' + wn.container.page.page_name);
59 var args = {
60 sender_name: page.find('[name="sender_name"]').val(),
61 company_name: page.find('[name="company_name"]').val(),
62 email: page.find('[name="email"]').val(),
63 password: page.find('[name="password"]').val()
64 }
65
66 if(!(args.sender_name && args.company_name && args.email && args.password)) {
67 msgprint("All fields are necessary. Please try again.");
68 return;
69 }
70
71
72 erpnext.send_message({
73 subject:'New Trial Request',
74 sender: page.find('[name="sender_name"]').val(),
75 message: args,
76 callback: function() {
77 page.find(':input').val('');
78 }
79 });
80 });
81}