[style] [website]
This commit is contained in:
parent
4e5135af51
commit
3f605787f5
4 changed files with 31 additions and 14 deletions
|
|
@ -215,13 +215,16 @@ fieldset {
|
|||
.page-header .lead {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.page-content {
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
.sidebar-item {
|
||||
/*background-color: #f7f7f7;*/
|
||||
border-left: 1px solid #d1d8dd;
|
||||
margin-left: -30px;
|
||||
padding: 5px 15px;
|
||||
color: #8d99a6;
|
||||
font-size: 85%;
|
||||
font-size: 12px;
|
||||
}
|
||||
.sidebar-item:first-child {
|
||||
padding-top: 10px;
|
||||
|
|
@ -363,7 +366,7 @@ a.active {
|
|||
padding: 0px;
|
||||
background-color: transparent;
|
||||
border-radius: 0px;
|
||||
font-size: 85%;
|
||||
font-size: 12px;
|
||||
}
|
||||
.breadcrumb a {
|
||||
color: inherit;
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ fieldset {
|
|||
}
|
||||
|
||||
.page-content {
|
||||
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
|
||||
.sidebar-item {
|
||||
|
|
@ -258,7 +258,7 @@ fieldset {
|
|||
margin-left: -30px;
|
||||
padding: 5px 15px;
|
||||
color: @text-muted;
|
||||
font-size: 85%;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.sidebar-item:first-child {
|
||||
|
|
@ -432,7 +432,7 @@ a.active {
|
|||
padding: 0px;
|
||||
background-color: transparent;
|
||||
border-radius: 0px;
|
||||
font-size: 85%;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.breadcrumb a {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,13 @@
|
|||
<div class="sidebar-exists"></div>
|
||||
{% if children -%}
|
||||
<div class="sidebar-items">
|
||||
{% if parents -%}
|
||||
<div class="sidebar-item">
|
||||
<a href="{{ parents[-1].name }}" class="no-decoration">
|
||||
<i class="icon-angle-left"></i> {{ _("Back") }}
|
||||
</a>
|
||||
</div>
|
||||
{%- endif %}
|
||||
{%- for child in children -%}
|
||||
<div class="sidebar-item">
|
||||
<a href="{{ child.name }}" class="no-decoration {% if (pathname or "")==(child.name or "") %}active{% endif %}">
|
||||
|
|
|
|||
|
|
@ -142,13 +142,20 @@ class WebsiteGenerator(Document):
|
|||
if context.parents:
|
||||
return context.parents
|
||||
|
||||
home_page = get_home_page()
|
||||
|
||||
parents = []
|
||||
parent = self
|
||||
while parent:
|
||||
_parent_field = getattr(parent, "parent_website_route_field", None)
|
||||
_parent_val = parent.get(_parent_field) if _parent_field else None
|
||||
me = self
|
||||
while me:
|
||||
_parent_field = getattr(me, "parent_website_route_field", None)
|
||||
_parent_val = me.get(_parent_field) if _parent_field else None
|
||||
|
||||
# if no parent and not home page, then parent is home page
|
||||
if not _parent_val and me.get_route() != home_page:
|
||||
_parent_val = home_page
|
||||
|
||||
if _parent_val:
|
||||
df = parent.meta.get_field(_parent_field)
|
||||
df = me.meta.get_field(_parent_field)
|
||||
parent_doc = frappe.get_doc(df.options, _parent_val)
|
||||
|
||||
if not parent_doc.website_published():
|
||||
|
|
@ -165,15 +172,15 @@ class WebsiteGenerator(Document):
|
|||
raise frappe.ValidationError, "Recursion in parent link"
|
||||
|
||||
parents.append(parent_info)
|
||||
parent = parent_doc
|
||||
me = parent_doc
|
||||
else:
|
||||
# parent route is a page e.g. "blog"
|
||||
if parent.get("parent_website_route"):
|
||||
page_route = get_page_route(parent.parent_website_route)
|
||||
if me.get("parent_website_route"):
|
||||
page_route = get_page_route(me.parent_website_route)
|
||||
if page_route:
|
||||
parents.append(frappe._dict(name = page_route.name,
|
||||
title=page_route.page_title))
|
||||
parent = None
|
||||
me = None
|
||||
|
||||
parents.reverse()
|
||||
return parents
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue