From 74fb550a702c8ca8d2d315db11445e5ba51140fe Mon Sep 17 00:00:00 2001 From: Vishal Date: Fri, 1 Dec 2017 13:46:04 +0530 Subject: [PATCH] [new] sidebar added on chapter web page --- erpnext/hooks.py | 4 ++- erpnext/non_profit/doctype/chapter/chapter.py | 1 + .../chapter/templates/chapter_row.html | 34 ++++++++++--------- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 0b7d3eecc0..8d82b45325 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -126,6 +126,7 @@ website_route_rules = [ {"from_route": "/boms", "to_route": "BOM"}, {"from_route": "/timesheets", "to_route": "Timesheet"}, {"from_route": "/grant-application", "to_route": "Grant Application"}, + {"from_route": "/chapters", "to_route": "Chapter"}, ] standard_portal_menu_items = [ @@ -146,7 +147,8 @@ standard_portal_menu_items = [ {"title": _("Fees"), "route": "/fees", "reference_doctype": "Fees", "role":"Student"}, {"title": _("Newsletter"), "route": "/newsletters", "reference_doctype": "Newsletter"}, {"title": _("Admission"), "route": "/admissions", "reference_doctype": "Student Admission"}, - {"title": _("Grant Application"), "route": "/grant-application", "reference_doctype": "Grant Application"} + {"title": _("Grant Application"), "route": "/grant-application", "reference_doctype": "Grant Application"}, + {"title": _("Chapter"), "route": "/chapters", "reference_doctype": "Chapter"} ] default_roles = [ diff --git a/erpnext/non_profit/doctype/chapter/chapter.py b/erpnext/non_profit/doctype/chapter/chapter.py index 7ee74d2a38..67e2296397 100644 --- a/erpnext/non_profit/doctype/chapter/chapter.py +++ b/erpnext/non_profit/doctype/chapter/chapter.py @@ -30,6 +30,7 @@ class Chapter(WebsiteGenerator): def get_list_context(context): context.allow_guest = True context.no_cache = True + context.show_sidebar = True context.title = 'All Chapters' context.no_breadcrumbs = True context.order_by = 'creation desc' diff --git a/erpnext/non_profit/doctype/chapter/templates/chapter_row.html b/erpnext/non_profit/doctype/chapter/templates/chapter_row.html index b6780e2328..050655397a 100644 --- a/erpnext/non_profit/doctype/chapter/templates/chapter_row.html +++ b/erpnext/non_profit/doctype/chapter/templates/chapter_row.html @@ -1,19 +1,21 @@ -
- -

{{ doc.title }}

-

- {{ frappe.db.get_value('User', chapter_head, 'full_name') }} - - {% if members %} - Members: {{ members|length }} - {% else %} - Members: 0 - {% endif %} - -

-

{{ html2text(doc.introduction[:200]) }}{% if introduction|len > 200 %}...{% endif %}

-
-
+{% if doc.published %} +
+ +

{{ doc.title }}

+

+ {{ frappe.db.get_value('User', chapter_head, 'full_name') }} + + {% if members %} + Members: {{ members|length }} + {% else %} + Members: 0 + {% endif %} + +

+

{{ html2text(doc.introduction[:200]) }}{% if introduction|len > 200 %}...{% endif %}

+
+
+{% endif %}