From 1e4a220e85e3136deb6c806a6e6e04d2beaeec03 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 21 Feb 2014 18:31:04 +0530 Subject: [PATCH] Fixed Website Styling and Statics Syncing --- frappe/website/css/website.css | 4 ++- frappe/website/doctype/web_page/web_page.py | 31 +++++++++++---------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/frappe/website/css/website.css b/frappe/website/css/website.css index ab83d35037..6d6bbdba8e 100644 --- a/frappe/website/css/website.css +++ b/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 */ - diff --git a/frappe/website/doctype/web_page/web_page.py b/frappe/website/doctype/web_page/web_page.py index 2549db9673..8575742d5f 100644 --- a/frappe/website/doctype/web_page/web_page.py +++ b/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")