Rushabh Mehta | a75efa7 | 2013-03-19 17:59:49 +0530 | [diff] [blame^] | 1 | {% extends "html/page.html" %} |
| 2 | |
| 3 | {% set title="My Profile" %} |
| 4 | |
| 5 | {% block content %} |
| 6 | <div class="span9"> |
| 7 | <h2>My Profile</h2> |
| 8 | <hr> |
| 9 | <div class="alert" id="message" style="display: none;"></div> |
| 10 | <form class="form-horizontal"> |
| 11 | <div class="control-group"> |
| 12 | <label class="control-label" for="fullname">Full Name</label> |
| 13 | <div class="controls"> |
| 14 | <input type="text" id="fullname" placeholder="Your Name"> |
| 15 | </div> |
| 16 | </div> |
| 17 | <div class="control-group"> |
| 18 | <label class="control-label" for="password">Password</label> |
| 19 | <div class="controls"> |
| 20 | <input type="password" id="password" placeholder="Password"> |
| 21 | </div> |
| 22 | </div> |
| 23 | <div class="control-group"> |
| 24 | <div class="controls"> |
| 25 | <button id="update_profile" type="submit" class="btn">Update</button> |
| 26 | </div> |
| 27 | </div> |
| 28 | </form> |
| 29 | </div> |
| 30 | <script> |
| 31 | $(document).ready(function() { |
| 32 | $("#fullname").val(getCookie("full_name") || ""); |
| 33 | $("#update_profile").click(function() { |
| 34 | wn.call({ |
| 35 | method: "core.doctype.profile.profile.update_profile", |
| 36 | type: "POST", |
| 37 | args: { |
| 38 | fullname: $("#fullname").val(), |
| 39 | password: $("#password").val() |
| 40 | }, |
| 41 | btn: this, |
| 42 | msg: $("#message"), |
| 43 | callback: function(r) { |
| 44 | if(!r.exc) $("#user-full-name").html($("#fullname").val()); |
| 45 | } |
| 46 | }); |
| 47 | return false; |
| 48 | }) |
| 49 | }) |
| 50 | </script> |
| 51 | {% endblock %} |