浏览代码

Fixed Website Styling and Statics Syncing

version-14
Anand Doshi 11 年前
父节点
当前提交
1e4a220e85
共有 2 个文件被更改,包括 19 次插入16 次删除
  1. +3
    -1
      frappe/website/css/website.css
  2. +16
    -15
      frappe/website/doctype/web_page/web_page.py

+ 3
- 1
frappe/website/css/website.css 查看文件

@@ -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 */


+ 16
- 15
frappe/website/doctype/web_page/web_page.py 查看文件

@@ -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")


正在加载...
取消
保存