diff --git a/foundation/erpnext_foundation/doctype/chapter/templates/chapter.html b/foundation/erpnext_foundation/doctype/chapter/templates/chapter.html index 10b0f95b..c6691f38 100644 --- a/foundation/erpnext_foundation/doctype/chapter/templates/chapter.html +++ b/foundation/erpnext_foundation/doctype/chapter/templates/chapter.html @@ -8,14 +8,14 @@ {% if members %}
| Serial No. | Member Name | -Member Email | Website URL |
|---|---|---|---|
| {{ i }} | {{ frappe.db.get_value('User', user.user, 'full_name') }} | -{{ frappe.db.get_value('User', user.user, 'email') }} | {% if user.website_url %} {{ user.website_url }} @@ -29,7 +29,6 @@ {{ user.introduction }} |
{{ address }}
+ {% endblock %} diff --git a/foundation/erpnext_foundation/doctype/chapter_member/chapter_member.json b/foundation/erpnext_foundation/doctype/chapter_member/chapter_member.json index eefae909..c681087c 100644 --- a/foundation/erpnext_foundation/doctype/chapter_member/chapter_member.json +++ b/foundation/erpnext_foundation/doctype/chapter_member/chapter_member.json @@ -68,7 +68,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -98,7 +98,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -128,7 +128,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -144,7 +144,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-05-12 16:36:07.139907", + "modified": "2017-05-16 15:24:25.355107", "modified_by": "Administrator", "module": "ERPNext Foundation", "name": "Chapter Member", diff --git a/foundation/www/join-chapter.html b/foundation/www/join-chapter.html index 4850376a..0cc1ab12 100644 --- a/foundation/www/join-chapter.html +++ b/foundation/www/join-chapter.html @@ -35,12 +35,12 @@You are not a member of {{ chapter.title }}!
+Please signup and login to join this chapter
+ + + {% endif %} +{% endblock %} \ No newline at end of file diff --git a/foundation/www/leave_chapter.py b/foundation/www/leave_chapter.py new file mode 100644 index 00000000..96932bba --- /dev/null +++ b/foundation/www/leave_chapter.py @@ -0,0 +1,14 @@ +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]: + user = frappe.session.user + parent = frappe.form_dict.name + frappe.db.sql("""delete from `tabChapter Member` where parent = %s and user = %s """, (parent, user)) + + context.member_deleted = True + + context.chapter = chapter