[new] sidebar added on chapter web page

This commit is contained in:
Vishal
2017-12-01 13:46:04 +05:30
parent a72a3bd536
commit 74fb550a70
3 changed files with 22 additions and 17 deletions

View File

@@ -126,6 +126,7 @@ website_route_rules = [
{"from_route": "/boms", "to_route": "BOM"}, {"from_route": "/boms", "to_route": "BOM"},
{"from_route": "/timesheets", "to_route": "Timesheet"}, {"from_route": "/timesheets", "to_route": "Timesheet"},
{"from_route": "/grant-application", "to_route": "Grant Application"}, {"from_route": "/grant-application", "to_route": "Grant Application"},
{"from_route": "/chapters", "to_route": "Chapter"},
] ]
standard_portal_menu_items = [ standard_portal_menu_items = [
@@ -146,7 +147,8 @@ standard_portal_menu_items = [
{"title": _("Fees"), "route": "/fees", "reference_doctype": "Fees", "role":"Student"}, {"title": _("Fees"), "route": "/fees", "reference_doctype": "Fees", "role":"Student"},
{"title": _("Newsletter"), "route": "/newsletters", "reference_doctype": "Newsletter"}, {"title": _("Newsletter"), "route": "/newsletters", "reference_doctype": "Newsletter"},
{"title": _("Admission"), "route": "/admissions", "reference_doctype": "Student Admission"}, {"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 = [ default_roles = [

View File

@@ -30,6 +30,7 @@ class Chapter(WebsiteGenerator):
def get_list_context(context): def get_list_context(context):
context.allow_guest = True context.allow_guest = True
context.no_cache = True context.no_cache = True
context.show_sidebar = True
context.title = 'All Chapters' context.title = 'All Chapters'
context.no_breadcrumbs = True context.no_breadcrumbs = True
context.order_by = 'creation desc' context.order_by = 'creation desc'

View File

@@ -1,19 +1,21 @@
<div style="margin-bottom: 30px; max-width: 600px" class="with-border clickable"> {% if doc.published %}
<a href="/{{ doc.route }}"> <div style="margin-bottom: 30px; max-width: 600px" class="with-border clickable">
<h3>{{ doc.title }}</h3> <a href="/{{ doc.route }}">
<p> <h3>{{ doc.title }}</h3>
<span class="label">{{ frappe.db.get_value('User', chapter_head, 'full_name') }}</span> <p>
<span class="label"> <span class="label">{{ frappe.db.get_value('User', chapter_head, 'full_name') }}</span>
{% if members %} <span class="label">
Members: {{ members|length }} {% if members %}
{% else %} Members: {{ members|length }}
Members: 0 {% else %}
{% endif %} Members: 0
</span> {% endif %}
</p> </span>
<p>{{ html2text(doc.introduction[:200]) }}{% if introduction|len > 200 %}...{% endif %}</p> </p>
</a> <p>{{ html2text(doc.introduction[:200]) }}{% if introduction|len > 200 %}...{% endif %}</p>
</div> </a>
</div>
{% endif %}
<style type="text/css"> <style type="text/css">
.label { .label {