@@ -1,7 +1,7 @@ | |||||
{% if children -%} | {% if children -%} | ||||
{%- for child in children -%} | {%- for child in children -%} | ||||
<div class="sidebar-item"> | <div class="sidebar-item"> | ||||
<a href="/{{ child.name|lower }}" class="no-decoration"> | |||||
<a href="{{ child.name }}" class="no-decoration {% if child.name == pathname %}active{% endif %}"> | |||||
{{ child.page_title }} | {{ child.page_title }} | ||||
{% if not child.public_read %} | {% if not child.public_read %} | ||||
(<i class="icon-fixed-width icon-lock"></i>) | (<i class="icon-fixed-width icon-lock"></i>) | ||||
@@ -388,6 +388,12 @@ a.no-decoration { | |||||
color: inherit; | color: inherit; | ||||
} | } | ||||
a.active { | |||||
pointer-events: none; | |||||
cursor: default; | |||||
color: initial; | |||||
} | |||||
.page-breadcrumbs .breadcrumb { | .page-breadcrumbs .breadcrumb { | ||||
padding: 0px; | padding: 0px; | ||||
margin-bottom: 2px; | margin-bottom: 2px; | ||||
@@ -244,23 +244,19 @@ $.extend(wn, { | |||||
}, | }, | ||||
load_via_ajax: function(href) { | load_via_ajax: function(href) { | ||||
console.log("calling ajax"); | |||||
// console.log("calling ajax"); | |||||
window.previous_href = href; | window.previous_href = href; | ||||
history.pushState(null, null, href); | history.pushState(null, null, href); | ||||
$.ajax({ url: href, cache: false }).done(function(data) { | $.ajax({ url: href, cache: false }).done(function(data) { | ||||
history.replaceState(data, data.title, href); | history.replaceState(data, data.title, href); | ||||
$("html, body").animate({ scrollTop: 0 }, "slow"); | |||||
wn.render_json(data); | wn.render_json(data); | ||||
}) | }) | ||||
}, | }, | ||||
render_json: function(data) { | render_json: function(data) { | ||||
if(data.reload) { | if(data.reload) { | ||||
window.location = location.href; | window.location = location.href; | ||||
// } else if(data.html) { | |||||
// var newDoc = document.open("text/html", "replace"); | |||||
// newDoc.write(data.html); | |||||
// newDoc.close(); | |||||
} else { | } else { | ||||
$('[data-html-block]').each(function(i, section) { | $('[data-html-block]').each(function(i, section) { | ||||
var $section = $(section); | var $section = $(section); | ||||
@@ -147,7 +147,14 @@ def build_sitemap_options(path): | |||||
sitemap_options.children = webnotes.conn.sql("""select * from `tabWebsite Sitemap` | sitemap_options.children = webnotes.conn.sql("""select * from `tabWebsite Sitemap` | ||||
where parent_website_sitemap=%s | where parent_website_sitemap=%s | ||||
and public_read=1 order by idx asc, page_title asc""", (sitemap_options.name,), as_dict=True) | |||||
and public_read=1 order by -idx desc, page_title asc""", (sitemap_options.pathname,), as_dict=True) | |||||
# leaf node, show siblings | |||||
if not sitemap_options.children: | |||||
sitemap_options.children = webnotes.conn.sql("""select * from `tabWebsite Sitemap` | |||||
where ifnull(parent_website_sitemap, '')=%s | |||||
and public_read=1 order by -idx desc, page_title asc""", | |||||
sitemap_options.parent_website_sitemap or "", as_dict=True) | |||||
# determine templates to be used | # determine templates to be used | ||||
if not sitemap_options.base_template_path: | if not sitemap_options.base_template_path: | ||||