52 lines
1.3 KiB
HTML
52 lines
1.3 KiB
HTML
{% extends "html/page.html" %}
|
|
|
|
{% set title="My Profile" %}
|
|
|
|
{% block content %}
|
|
<div class="span9">
|
|
<h2>My Profile</h2>
|
|
<hr>
|
|
<div class="alert" id="message" style="display: none;"></div>
|
|
<form class="form-horizontal">
|
|
<div class="control-group">
|
|
<label class="control-label" for="fullname">Full Name</label>
|
|
<div class="controls">
|
|
<input type="text" id="fullname" placeholder="Your Name">
|
|
</div>
|
|
</div>
|
|
<div class="control-group">
|
|
<label class="control-label" for="password">Password</label>
|
|
<div class="controls">
|
|
<input type="password" id="password" placeholder="Password">
|
|
</div>
|
|
</div>
|
|
<div class="control-group">
|
|
<div class="controls">
|
|
<button id="update_profile" type="submit" class="btn">Update</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<script>
|
|
$(document).ready(function() {
|
|
$("#fullname").val(getCookie("full_name") || "");
|
|
$("#update_profile").click(function() {
|
|
wn.call({
|
|
method: "core.doctype.profile.profile.update_profile",
|
|
type: "POST",
|
|
args: {
|
|
fullname: $("#fullname").val(),
|
|
password: $("#password").val()
|
|
},
|
|
btn: this,
|
|
msg: $("#message"),
|
|
callback: function(r) {
|
|
if(!r.exc) $("#user-full-name").html($("#fullname").val());
|
|
}
|
|
});
|
|
return false;
|
|
})
|
|
})
|
|
</script>
|
|
{% endblock %}
|