diff --git a/frappe/translate.py b/frappe/translate.py index 7f9ec738b4..182a93f527 100644 --- a/frappe/translate.py +++ b/frappe/translate.py @@ -224,6 +224,7 @@ def get_messages_from_page_or_report(doctype, name, module=None): module = frappe.db.get_value(doctype, name, "module") file_path = frappe.get_module_path(module, doctype, name, name) messages = get_messages_from_file(file_path + ".js") + messages = get_messages_from_file(file_path + ".html") return clean(messages) diff --git a/frappe/website/sitemap.py b/frappe/website/sitemap.py index f5583d1df1..c84971e837 100644 --- a/frappe/website/sitemap.py +++ b/frappe/website/sitemap.py @@ -83,3 +83,11 @@ def get_route_children(pathname, home_page=None): children = [frappe.get_doc("Website Route", pathname)] + children return children + +def get_next(route): + siblings = get_route_children(frappe.db.get_value("Website Route", + route, "parent_website_route")) + for i, r in enumerate(siblings): + if i < len(siblings) - 1: + if route==r.name: + return siblings[i+1] diff --git a/frappe/website/statics.py b/frappe/website/statics.py index dea0b884a4..3f6f480f71 100644 --- a/frappe/website/statics.py +++ b/frappe/website/statics.py @@ -7,7 +7,7 @@ import frappe, os, time from frappe import _ from frappe.utils import cint from markdown2 import markdown -from frappe.website.sitemap import get_route_children +from frappe.website.sitemap import get_route_children, get_next def sync_statics(): s = sync() @@ -200,6 +200,16 @@ def get_static_content(fpath, docname, route): "items":children}) content = content.replace("{index}", html) + if "{next}" in content: + next_item = get_next(route) + html = "" + if next_item: + html = '''

+
+ {page_title} +

'''.format(**next_item) + content = content.replace("{next}", html) + content = markdown(content) d.main_section = unicode(content.encode("utf-8"), 'utf-8')