|
@@ -6,8 +6,8 @@ |
|
|
|
|
|
|
|
|
{% block page_content %} |
|
|
{% block page_content %} |
|
|
<div class="user-content" style="max-width: 500px; padding: 50px 0px;"> |
|
|
<div class="user-content" style="max-width: 500px; padding: 50px 0px;"> |
|
|
<div class="alert alert-warning" id="message" style="display: none;"></div> |
|
|
|
|
|
<form> |
|
|
|
|
|
|
|
|
<div class="alert alert-warning message" style="display: none;"></div> |
|
|
|
|
|
<form role = "form"> |
|
|
<fieldset> |
|
|
<fieldset> |
|
|
<label>{{ _("Full Name") }}</label> |
|
|
<label>{{ _("Full Name") }}</label> |
|
|
<input class="form-control" type="text" id="fullname" value="{{ user.full_name or "" }}"> |
|
|
<input class="form-control" type="text" id="fullname" value="{{ user.full_name or "" }}"> |
|
@@ -16,31 +16,47 @@ |
|
|
<label>{{ _("Phone") }}</label> |
|
|
<label>{{ _("Phone") }}</label> |
|
|
<input class="form-control" type="text" id="phone" value="{{ user.phone or "" }}"> |
|
|
<input class="form-control" type="text" id="phone" value="{{ user.phone or "" }}"> |
|
|
</fieldset> |
|
|
</fieldset> |
|
|
<button id="update_user" type="submit" class="btn btn-default">{{ _("Update") }}</button> |
|
|
|
|
|
|
|
|
<button type="submit" class="btn btn-default" id="update_user">{{ _("Update") }}</button> |
|
|
</form> |
|
|
</form> |
|
|
</div> |
|
|
</div> |
|
|
<script> |
|
|
|
|
|
frappe.ready(function() { |
|
|
|
|
|
$("#fullname").val(getCookie("full_name") || ""); |
|
|
|
|
|
$("#update_user").click(function() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript"> |
|
|
|
|
|
|
|
|
|
|
|
frappe.ready(function(){ |
|
|
|
|
|
$("#update_user").on("click",function(){ |
|
|
|
|
|
var name = document.getElementById("fullname").value; |
|
|
|
|
|
var phone = document.getElementById("phone").value; |
|
|
|
|
|
|
|
|
frappe.call({ |
|
|
frappe.call({ |
|
|
method: "frappe.templates.pages.edit_profile.update_user", |
|
|
|
|
|
type: "POST", |
|
|
type: "POST", |
|
|
|
|
|
method: "frappe.www.edit_profile.update_user", |
|
|
|
|
|
btn: $("#update_user"), |
|
|
args: { |
|
|
args: { |
|
|
fullname: $("#fullname").val(), |
|
|
|
|
|
org_name: $("#org_name").val(), |
|
|
|
|
|
phone: $("#phone").val() |
|
|
|
|
|
|
|
|
fullname: name, |
|
|
|
|
|
phone: phone |
|
|
}, |
|
|
}, |
|
|
btn: this, |
|
|
|
|
|
msg: $("#message"), |
|
|
|
|
|
callback: function(r) { |
|
|
callback: function(r) { |
|
|
if(!r.exc) $("#user-full-name").html($("#fullname").val()); |
|
|
|
|
|
|
|
|
if(r.message) { |
|
|
|
|
|
frappe.msgprint(__(r.message)); |
|
|
|
|
|
setTimeout(function() { |
|
|
|
|
|
window.location.href = "/edit-profile"; |
|
|
|
|
|
},2000); |
|
|
|
|
|
} |
|
|
|
|
|
if(r.exc) { |
|
|
|
|
|
frappe.msgprint(r.exc); |
|
|
|
|
|
setTimeout(function() { |
|
|
|
|
|
window.location.href = "/me"; |
|
|
|
|
|
},2000); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
return false; |
|
|
return false; |
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
{% endblock %} |
|
|
{% endblock %} |
|
|
|
|
|
|