refactor: Remove non profit templates
This commit is contained in:
parent
768e6b2e0e
commit
72fe559031
@ -1,59 +0,0 @@
|
||||
{% extends "templates/web.html" %}
|
||||
|
||||
{% block page_content %}
|
||||
|
||||
{% macro chapter_button() %}
|
||||
<p><a href="/{{ chapter.route }}" class='btn btn-primary'>
|
||||
Go to Chapter Page</a></p>
|
||||
{% endmacro %}
|
||||
{% if frappe.session.user=='Guest' %}
|
||||
<p>Please signup and login to join this chapter</p>
|
||||
<p><a href="/login?redirect-to=/{{ chapter.route }}" class='btn btn-primary'>Login</a></p>
|
||||
{% else %}
|
||||
{% if already_member %}
|
||||
<p>You are already a member of {{ chapter.name }}!</p>
|
||||
{{ chapter_button() }}
|
||||
<p><a href="">Leave Chapter</a></p>
|
||||
{% else %}
|
||||
{% if request.method=='POST' %}
|
||||
<p>Welcome to chapter {{ chapter.name }}!</p>
|
||||
{{ chapter_button() }}
|
||||
{% else %}
|
||||
<div style="padding: 20px 0;">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-8">
|
||||
<form name="user-intro" action="/non_profit/join-chapter" method='POST'>
|
||||
<div class="form-group">
|
||||
<input name="name" class="hidden form-control" type="text"
|
||||
value="{{chapter.name}}">
|
||||
<input name="csrf_token" class="hidden form-control" type="text"
|
||||
value="{{frappe.session.csrf_token}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="user" class="">User Name</label>
|
||||
<input name="user" class="form-control" type="text" value="{{ frappe.session.user }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="website_url" class="">Website URL</label>
|
||||
<input name="website_url" required class="form-control" type="text"
|
||||
placeholder="https://example.com" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="introduction" class="">Introduction</label>
|
||||
<textarea name="introduction" required class="form-control"
|
||||
placeholder="Your profession and how you are associated with ERPNext"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="Submit" id="update_member" class="btn btn-primary">
|
||||
Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
@ -1,12 +0,0 @@
|
||||
// Copyright (c) 2017, EOSSF and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Chapter Member', {
|
||||
onsubmit: function (frm) {
|
||||
console.log("here" + frappe.session.user)
|
||||
// body...
|
||||
}
|
||||
refresh: function(frm) {
|
||||
|
||||
}
|
||||
});
|
@ -1,23 +0,0 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def get_context(context):
|
||||
context.no_cache = True
|
||||
chapter = frappe.get_doc('Chapter', frappe.form_dict.name)
|
||||
if frappe.session.user!='Guest':
|
||||
if frappe.session.user in [d.user for d in chapter.members if d.enabled == 1]:
|
||||
context.already_member = True
|
||||
else:
|
||||
if frappe.request.method=='GET':
|
||||
pass
|
||||
elif frappe.request.method=='POST':
|
||||
chapter.append('members', dict(
|
||||
user=frappe.session.user,
|
||||
introduction=frappe.form_dict.introduction,
|
||||
website_url=frappe.form_dict.website_url,
|
||||
enabled=1
|
||||
))
|
||||
chapter.save(ignore_permissions=1)
|
||||
frappe.db.commit()
|
||||
|
||||
context.chapter = chapter
|
@ -1,42 +0,0 @@
|
||||
{% 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-light 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 %}
|
@ -1,8 +0,0 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def get_context(context):
|
||||
context.no_cache = True
|
||||
chapter = frappe.get_doc('Chapter', frappe.form_dict.name)
|
||||
context.member_deleted = True
|
||||
context.chapter = chapter
|
Loading…
x
Reference in New Issue
Block a user