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