Rushabh Mehta | 51008f2 | 2016-01-01 17:23:12 +0530 | [diff] [blame] | 1 | {% extends "templates/web.html" %} |
| 2 | |
Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 3 | {% block title %} {{ "My Profile" }} {% endblock %} |
| 4 | |
| 5 | {% block header %}<h2>My Profile</h2>{% endblock %} |
| 6 | |
Rushabh Mehta | 51008f2 | 2016-01-01 17:23:12 +0530 | [diff] [blame] | 7 | {% block page_content %} |
Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 8 | <div class="user-content" style="max-width: 500px;"> |
Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 9 | <div class="alert alert-warning" id="message" style="display: none;"></div> |
| 10 | <form> |
| 11 | <fieldset> |
| 12 | <label>Full Name</label> |
| 13 | <input class="form-control" type="text" id="fullname" placeholder="Your Name"> |
| 14 | </fieldset> |
| 15 | <fieldset> |
| 16 | <label>Company Name</label> |
| 17 | <input class="form-control" type="text" id="company_name" placeholder="Company Name" value="{{ company_name }}"> |
| 18 | </fieldset> |
| 19 | <fieldset> |
| 20 | <label>Mobile No</label> |
| 21 | <input class="form-control" type="text" id="mobile_no" placeholder="Mobile No" value="{{ mobile_no }}"> |
| 22 | </fieldset> |
| 23 | <fieldset> |
| 24 | <label>Phone</label> |
| 25 | <input class="form-control" type="text" id="phone" placeholder="Phone" value="{{ phone }}"> |
| 26 | </fieldset> |
| 27 | <button id="update_user" type="submit" class="btn btn-default">Update</button> |
| 28 | </form> |
| 29 | </div> |
| 30 | <script> |
Rushabh Mehta | 51008f2 | 2016-01-01 17:23:12 +0530 | [diff] [blame] | 31 | frappe.ready(function() { |
Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 32 | $("#fullname").val(getCookie("full_name") || ""); |
| 33 | $("#update_user").click(function() { |
| 34 | frappe.call({ |
Nabin Hait | 7ba4d02 | 2015-11-05 16:55:10 +0530 | [diff] [blame] | 35 | method: "erpnext.templates.pages.edit_profile.update_user", |
Rushabh Mehta | 3daa49a | 2014-10-21 16:16:30 +0530 | [diff] [blame] | 36 | type: "POST", |
| 37 | args: { |
| 38 | fullname: $("#fullname").val(), |
| 39 | company_name: $("#company_name").val(), |
| 40 | mobile_no: $("#mobile_no").val(), |
| 41 | phone: $("#phone").val() |
| 42 | }, |
| 43 | btn: this, |
| 44 | msg: $("#message"), |
| 45 | callback: function(r) { |
| 46 | if(!r.exc) $("#user-full-name").html($("#fullname").val()); |
| 47 | } |
| 48 | }); |
| 49 | return false; |
| 50 | }) |
| 51 | }) |
| 52 | </script> |
| 53 | <!-- no-sidebar --> |
| 54 | {% endblock %} |
| 55 | |