Fixed Website Styling and Statics Syncing

This commit is contained in:
Anand Doshi 2014-02-21 18:31:04 +05:30
parent 632efb4fb5
commit 1e4a220e85
2 changed files with 19 additions and 16 deletions

View file

@ -57,6 +57,9 @@ img {
overflow: hidden;
background-color: #ddd;
border: 1px solid #eee;
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
}
.avatar-small {
@ -425,4 +428,3 @@ a.active {
}
/* end - needs review */

View file

@ -56,7 +56,22 @@ def _sync_statics():
try:
sitemap = frappe.bean("Website Sitemap", url)
except frappe.DoesNotExistError:
title, content = get_static_content(fpath)
if not title:
title = page_name.replace("-", " ").replace("_", " ").title()
to_insert.append([frappe.bean({
"doctype":"Web Page",
"idx": priority,
"title": title,
"page_name": page_name,
"main_section": content,
"published": 1,
"parent_website_sitemap": parent_website_sitemap
}), os.path.getmtime(fpath)])
else:
if str(os.path.getmtime(fpath))!=sitemap.doc.static_file_timestamp \
or cint(sitemap.doc.idx) != cint(priority):
@ -74,20 +89,6 @@ def _sync_statics():
sitemap.save()
synced.append(url)
except frappe.DoesNotExistError:
title, content = get_static_content(fpath)
if not title:
title = page_name.replace("-", " ").replace("_", " ").title()
to_insert.append([frappe.bean({
"doctype":"Web Page",
"idx": priority,
"title": title,
"page_name": page_name,
"main_section": content,
"published": 1,
"parent_website_sitemap": parent_website_sitemap
}), os.path.getmtime(fpath)])
for app in frappe.get_installed_apps():
statics_path = frappe.get_app_path(app, "templates", "statics")