brotherton-erpnext/erpnext/templates/pages/non_profit/leave-chapter.html
Vishal Dhayagude eec0f7fd6b [non_profit][fix] Chapter listing and join and leave chapter issue (#12463)
* [fix] Chapter listing and Join and leave chapter issue

* [minor] Changes in chapter html, chapter title to chapter name
2018-01-15 14:10:23 +05:30

42 lines
1.2 KiB
HTML

{% extends "templates/web.html" %}
{% block page_content %}
{% if member_deleted %}
<p>You are not a member of {{ chapter.name }}!</p>
<div>
<form>
<div class="form-group">
<label for="leave">Why do you want to leave this chapter</label>
<input type="text" name="leave" class="form-control" id="leave">
</div>
<button type="button" class="btn btn-default btn-leave" data-title= "{{ chapter.name }}" id="btn-leave">Submit
</button>
</form>
</div>
<p>Please signup and login to join this chapter</p>
<p><a href="/join-chapter?name={{ chapter.name }}" class='btn btn-primary'>Become Member agian</a></p>
{% endif %}
<script>
frappe.ready(function() {
$(".btn-leave").on("click", function() {
var leave = $("#leave").val();
var user_id = frappe.session.user;
var title = $(this).attr("data-title");
frappe.call({
method: "erpnext.non_profit.doctype.chapter.chapter.leave",
args: {
leave_reason: leave,
user_id: user_id,
title: title
},
callback: function(r) {
if(r.message) {
frappe.msgprint(r.message)
}
}
})
});
})
</script>
{% endblock %}