diff --git a/foundation/erpnext_foundation/doctype/chapter/chapter.json b/foundation/erpnext_foundation/doctype/chapter/chapter.json index 94cb6076..095c2a01 100644 --- a/foundation/erpnext_foundation/doctype/chapter/chapter.json +++ b/foundation/erpnext_foundation/doctype/chapter/chapter.json @@ -61,7 +61,7 @@ "label": "Chapter Head", "length": 0, "no_copy": 0, - "options": "User", + "options": "Member", "permlevel": 0, "precision": "", "print_hide": 0, @@ -170,6 +170,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "description": "chapters/chapter_name", "fieldname": "route", "fieldtype": "Data", "hidden": 0, @@ -189,7 +190,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 1, + "reqd": 0, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -297,7 +298,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-08-02 13:04:00.723298", + "modified": "2017-11-08 04:10:39.262164", "modified_by": "Administrator", "module": "ERPNext Foundation", "name": "Chapter", diff --git a/foundation/erpnext_foundation/doctype/chapter/chapter.py b/foundation/erpnext_foundation/doctype/chapter/chapter.py index 67bd2342..a927748c 100644 --- a/foundation/erpnext_foundation/doctype/chapter/chapter.py +++ b/foundation/erpnext_foundation/doctype/chapter/chapter.py @@ -11,13 +11,20 @@ from frappe import _ class Chapter(WebsiteGenerator): def get_context(self, context): context.no_cache = True + context.parents = [dict(label='View Chapters', + route='chapters', title='View Chapters')] + context.published = self.published def validate(self): + if not self.route: + self.route = 'chapters/' + self.scrub(self.title) + + chapter_head = self.chapter_head chapter = frappe.get_all('Chapter', filters={'published': True}, fields=['chapter_head']) # if chapter_head in [d.chapter_head for d in chapter]: - # frappe.throw(_('You are not allow to create more than one Chapter')) + # frappe.throw(_('You are not allow to create more than one Chapter')) def enable(self): chapter = frappe.get_doc('Chapter', frappe.form_dict.name) diff --git a/foundation/erpnext_foundation/doctype/chapter/templates/chapter_row.html b/foundation/erpnext_foundation/doctype/chapter/templates/chapter_row.html index 042aede1..81abb9ee 100644 --- a/foundation/erpnext_foundation/doctype/chapter/templates/chapter_row.html +++ b/foundation/erpnext_foundation/doctype/chapter/templates/chapter_row.html @@ -1,17 +1,19 @@ -
+{% if published %} + +{% endif %} \ No newline at end of file diff --git a/foundation/erpnext_foundation/web_form/chapter/__init__.py b/foundation/erpnext_foundation/web_form/chapter/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/foundation/erpnext_foundation/web_form/chapter/chapter.js b/foundation/erpnext_foundation/web_form/chapter/chapter.js new file mode 100644 index 00000000..699703c5 --- /dev/null +++ b/foundation/erpnext_foundation/web_form/chapter/chapter.js @@ -0,0 +1,3 @@ +frappe.ready(function() { + // bind events here +}) \ No newline at end of file diff --git a/foundation/erpnext_foundation/web_form/chapter/chapter.json b/foundation/erpnext_foundation/web_form/chapter/chapter.json new file mode 100644 index 00000000..42bbfa6d --- /dev/null +++ b/foundation/erpnext_foundation/web_form/chapter/chapter.json @@ -0,0 +1,107 @@ +{ + "accept_payment": 0, + "allow_comments": 0, + "allow_delete": 0, + "allow_edit": 1, + "allow_incomplete": 0, + "allow_multiple": 0, + "allow_print": 0, + "amount": 0.0, + "amount_based_on_field": 0, + "creation": "2017-11-08 03:27:03.739352", + "currency": "USD", + "doc_type": "Chapter", + "docstatus": 0, + "doctype": "Web Form", + "idx": 0, + "introduction_text": "Update Chapter Profile that will be shown on your Chapter Listing.", + "is_standard": 1, + "login_required": 1, + "max_attachment_size": 0, + "modified": "2017-11-08 04:10:21.294071", + "modified_by": "Administrator", + "module": "ERPNext Foundation", + "name": "chapter", + "owner": "Administrator", + "payment_button_label": "Buy Now", + "published": 1, + "route": "chapter-settings", + "show_sidebar": 1, + "sidebar_items": [], + "success_url": "/chapters", + "title": "Chapter", + "web_form_fields": [ + { + "fieldname": "title", + "fieldtype": "Data", + "hidden": 0, + "label": "Title", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "chapter_head", + "fieldtype": "Data", + "hidden": 0, + "label": "Chapter Head Email", + "max_length": 0, + "max_value": 0, + "options": "", + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "introduction", + "fieldtype": "Text Editor", + "hidden": 0, + "label": "Introduction", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "meetup_embed_html", + "fieldtype": "Data", + "hidden": 0, + "label": "Meetup Embed HTML", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 0 + }, + { + "fieldname": "region", + "fieldtype": "Data", + "hidden": 0, + "label": "Region", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "address", + "fieldtype": "Text", + "hidden": 0, + "label": "Address", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 0 + }, + { + "description": "chapters/chapter_name", + "fieldname": "route", + "fieldtype": "Data", + "hidden": 0, + "label": "Route", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 0 + } + ] +} \ No newline at end of file diff --git a/foundation/erpnext_foundation/web_form/chapter/chapter.py b/foundation/erpnext_foundation/web_form/chapter/chapter.py new file mode 100644 index 00000000..3f9621da --- /dev/null +++ b/foundation/erpnext_foundation/web_form/chapter/chapter.py @@ -0,0 +1,9 @@ +from __future__ import unicode_literals + +import frappe + +def get_context(context): + # do your magic here + pass + +